Skip to content

Commit

Permalink
add first_party_detection option to usort and fix unused imports (#34)
Browse files Browse the repository at this point in the history
Summary:
Please read through our [contribution guide](https://github.com/pytorch-labs/torcheval/blob/main/CONTRIBUTING.md) prior to creating your pull request.
<!-- Change Summary -->

Pull Request resolved: #34

Test Plan: Fixes #{issue number}

Reviewed By: DuYicong515

Differential Revision: D39077391

Pulled By: edward-io

fbshipit-source-id: bf6ba7182b4d59b0067f13cd070b7a40b0090415
  • Loading branch information
edward-io authored and facebook-github-bot committed Aug 27, 2022
1 parent 506d923 commit bc14e61
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly_build_cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
conda install pytorch cpuonly -c pytorch-nightly
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -e ".[dev]"
pip install --no-build-isolation -e ".[dev]"
- name: Upload to PyPI
shell: bash -l {0}
env:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/release_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
conda install pytorch cpuonly -c pytorch-nightly
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -e ".[dev]"
pip install --no-build-isolation -e ".[dev]"
- name: Upload to PyPI
shell: bash -l {0}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
conda activate test
conda install pytorch cpuonly -c pytorch-nightly
pip install -r dev-requirements.txt
pip install -e ".[dev]"
pip install --no-build-isolation -e ".[dev]"
- name: Run unit tests with coverage
shell: bash -l {0}
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ dmypy.json
# Cython debug symbols
cython_debug/


# MacOS
.DS_Store

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
Expand Down
1 change: 0 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.usort]

first_party_detection = false
3 changes: 1 addition & 2 deletions tests/metrics/classification/test_precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from typing import List, Optional
from typing import Optional

import torch

from sklearn.metrics import precision_recall_curve
from torch.nn import functional as F

from torcheval.metrics import BinaryPrecisionRecallCurve, MulticlassPrecisionRecallCurve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import logging

from typing import List, Optional, Tuple

Expand Down
1 change: 0 additions & 1 deletion torcheval/metrics/functional/ranking/frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from typing import Optional

import torch

Expand Down

0 comments on commit bc14e61

Please sign in to comment.