Make transformers-cli cross-platform (#4131)

* make transformers-cli cross-platform

Using "scripts" is a useful option in setup.py particularly when you want to get access to non-python scripts. However, in this case we want to have an entry point into some of our own Python scripts. To do this in a concise, cross-platfom way, we can use entry_points.console_scripts. This change is necessary to provide the CLI on different platforms, which "scripts" does not ensure. Usage remains the same, but the "transformers-cli" script has to be moved (be part of the library) and renamed (underscore + extension)

* make style & quality
This commit is contained in:
Bram Vanroy
2020-05-26 16:00:51 +02:00
committed by GitHub
parent c589eae2b8
commit 8cc6807e89
2 changed files with 12 additions and 5 deletions

View File

@@ -127,7 +127,9 @@ setup(
"sacremoses",
],
extras_require=extras,
scripts=["transformers-cli"],
entry_points={
"console_scripts": ["transformers-cli=transformers.commands.transformers_cli:main"]
},
python_requires=">=3.6.0",
classifiers=[
"Development Status :: 5 - Production/Stable",