Skip to content

Commit d91665c

Browse files
committed
Merge branch 'main' into ufmt
2 parents 6dcfd59 + bc3f8f6 commit d91665c

File tree

38 files changed

+178
-50
lines changed

38 files changed

+178
-50
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/config.yml.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ jobs:
190190
- image: circleci/python:3.7
191191
steps:
192192
- checkout
193-
- run: pip install --user --progress-bar=off "ufmt>=1.3" usort==0.6.4 black==21.8b0 flake8
194-
- run: ufmt check .
195-
- run: flake8 --config=setup.cfg .
193+
- run:
194+
command: |
195+
pip install --user --progress-bar off pre-commit
196+
pre-commit install-hooks
197+
- run: pre-commit run --all-files
196198

197199
python_type_check:
198200
docker:

.circleci/unittest/linux/scripts/run-clang-format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
SOFTWARE.
24-
"""
25-
"""A wrapper script around clang-format, suitable for linting multiple files
24+
25+
A wrapper script around clang-format, suitable for linting multiple files
2626
and to use for continuous integration.
2727
2828
This is an alternative API for the clang-format command line.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda%
1+
start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda%

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://gitlab.com/pycqa/flake8
3+
rev: 3.9.2
4+
hooks:
5+
- id: flake8
6+
args: [--config=setup.cfg]
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.0.1
9+
hooks:
10+
- id: check-docstring-first
11+
- id: check-toml
12+
- id: check-yaml
13+
exclude: packaging/.*
14+
- id: end-of-file-fixer

CONTRIBUTING.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If you plan to modify the code or documentation, please follow the steps below:
6464
2. If you have modified the code (new feature or bug-fix), please add unit tests.
6565
3. If you have changed APIs, update the documentation. Make sure the documentation builds.
6666
4. Ensure the test suite passes.
67-
5. Make sure your code passes `flake8` formatting check.
67+
5. Make sure your code passes the formatting checks (see below).
6868

6969
For more details about pull requests,
7070
please read [GitHub's guides](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).
@@ -75,9 +75,19 @@ If you would like to contribute a new dataset, please see [here](#New-dataset).
7575

7676
### Code formatting and typing
7777

78-
New code should be compatible with Python 3.X versions and be compliant with PEP8. To check the codebase, please run
78+
Contributions should be compatible with Python 3.X versions and be compliant with PEP8. To check the codebase, please
79+
either run
7980
```bash
80-
flake8 --config=setup.cfg .
81+
pre-commit run --all-files
82+
```
83+
or run
84+
```bash
85+
pre-commit install
86+
```
87+
once to perform these checks automatically before every `git commit`. If `pre-commit` is not available you can install
88+
it with
89+
```
90+
pip install pre-commit
8191
```
8292

8393
The codebase has type annotations, please make sure to add type hints if required. We use `mypy` tool for type checking:

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ otherwise, add the include and library paths in the environment variables ``TORC
106106
.. _libjpeg: http://ijg.org/
107107
.. _libjpeg-turbo: https://libjpeg-turbo.org/
108108

109-
C++ API
110-
=======
111-
TorchVision also offers a C++ API that contains C++ equivalent of python models.
109+
Using the models on C++
110+
=======================
111+
TorchVision provides an example project for how to use the models on C++ using JIT Script.
112112

113113
Installation From source:
114114

android/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ allprojects {
3939
ext.deps = [
4040
jsr305: 'com.google.code.findbugs:jsr305:3.0.1',
4141
]
42-

android/test_app/app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
android:background="@android:color/black"
1515
android:textColor="@android:color/white" />
1616

17-
</FrameLayout>
17+
</FrameLayout>

docs/source/_static/css/custom_torchvision.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ torchvision it just hides the links. So we have to put them back here */
99
article.pytorch-article .sphx-glr-download-link-note.admonition.note,
1010
article.pytorch-article .reference.download.internal, article.pytorch-article .sphx-glr-signature {
1111
display: block;
12-
}
12+
}

0 commit comments

Comments
 (0)