Sort imports for optional third-party libraries.

These libraries aren't always installed in the virtual environment where
isort is running. Declaring them properly avoids mixing these
third-party imports with local imports.
This commit is contained in:
Aymeric Augustin
2019-12-22 11:17:48 +01:00
parent 2a34d5b71b
commit c11b3e2926
10 changed files with 28 additions and 16 deletions

View File

@@ -95,7 +95,7 @@ jobs:
steps:
- checkout
- run: sudo pip install --editable .
- run: sudo pip install torch tensorflow tensorboardX scikit-learn
- run: sudo pip install torch tensorflow
- run: sudo pip install black git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort flake8
- run: black --check --line-length 119 examples templates transformers utils
- run: isort --check-only --recursive examples templates transformers utils