Move source code inside a src subdirectory.

This prevents transformers from being importable simply because the CWD
is the root of the git repository, while not being importable from other
directories. That led to inconsistent behavior, especially in examples.

Once you fetch this commit, in your dev environment, you must run:

    $ pip uninstall transformers
    $ pip install -e .
This commit is contained in:
Aymeric Augustin 2019-12-22 13:54:22 +01:00
parent ced0a94204
commit 6be7cdda66
102 changed files with 7 additions and 6 deletions

View File

@ -97,9 +97,9 @@ jobs:
- run: sudo pip install --editable .
- 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 tests transformers utils
- run: isort --check-only --recursive examples templates tests transformers utils
- run: flake8 examples templates tests transformers utils
- run: black --check --line-length 119 examples templates tests src utils
- run: isort --check-only --recursive examples templates tests src utils
- run: flake8 examples templates tests src utils
check_repository_consistency:
working_directory: ~/transformers
docker:

View File

@ -1,5 +1,5 @@
.PHONY: style
style:
black --line-length 119 examples templates tests transformers utils
isort --recursive examples templates tests transformers utils
black --line-length 119 examples templates tests src utils
isort --recursive examples templates tests src utils

View File

@ -56,7 +56,8 @@ setup(
keywords="NLP deep learning transformer pytorch tensorflow BERT GPT GPT-2 google openai CMU",
license="Apache",
url="https://github.com/huggingface/transformers",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_dir = {'': 'src'},
packages=find_packages("src"),
install_requires=[
"numpy",
"boto3",

Some files were not shown because too many files have changed in this diff Show More