Commit 6be7cdda authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

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 .
parent ced0a942
...@@ -97,9 +97,9 @@ jobs: ...@@ -97,9 +97,9 @@ jobs:
- run: sudo pip install --editable . - run: sudo pip install --editable .
- run: sudo pip install torch tensorflow - run: sudo pip install torch tensorflow
- run: sudo pip install black git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort flake8 - 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: black --check --line-length 119 examples templates tests src utils
- run: isort --check-only --recursive examples templates tests transformers utils - run: isort --check-only --recursive examples templates tests src utils
- run: flake8 examples templates tests transformers utils - run: flake8 examples templates tests src utils
check_repository_consistency: check_repository_consistency:
working_directory: ~/transformers working_directory: ~/transformers
docker: docker:
......
.PHONY: style .PHONY: style
style: style:
black --line-length 119 examples templates tests transformers utils black --line-length 119 examples templates tests src utils
isort --recursive examples templates tests transformers utils isort --recursive examples templates tests src utils
...@@ -56,7 +56,8 @@ setup( ...@@ -56,7 +56,8 @@ setup(
keywords="NLP deep learning transformer pytorch tensorflow BERT GPT GPT-2 google openai CMU", keywords="NLP deep learning transformer pytorch tensorflow BERT GPT GPT-2 google openai CMU",
license="Apache", license="Apache",
url="https://github.com/huggingface/transformers", url="https://github.com/huggingface/transformers",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_dir = {'': 'src'},
packages=find_packages("src"),
install_requires=[ install_requires=[
"numpy", "numpy",
"boto3", "boto3",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment