Setuptools not passing arguments for entry_points
Date : March 29 2020, 07:55 AM
Any of those help The setuptools console_scripts entry point wants a function of no arguments. Happily, optparse (Parser for command line options) doesn't need to be passed any arguments, it will read in sys.argv[1:] and use that as it's input.
|
Setuptools with entry_points
Date : March 29 2020, 07:55 AM
Hope that helps You don't instruct setuptools to install the z_script. Use find_packages or list z_script in the py_modules keyword. ...
packages = find_packages(),
...
...
py_modules = ['z_script'],
...
|
Use argparse with Setuptools entry_points
Date : March 29 2020, 07:55 AM
wish helps you The reason you don't want to return from error is that the parser will continue parsing. Some errors are raised near the end (e.g. about unparsed strings), but others can occur early (e.g. bad type for the first argument string). The behavior of parse_args is unpredictable if you return from the error method. Normally you want the parser to quit and return control your code. What you want to do is wrap the parse_args() call in a try: except SystemExit: block. I often use test scripts like this: for test in ['-o FILE',
...
]:
print(test)
try:
print(parser.parse_args(test.split()))
except SystemExit:
pass
|
Adding a setuptools command using `entry_points`
Tag : python , By : user122937
Date : March 29 2020, 07:55 AM
hop of those help? If your goal is to add a setuptools command to be run via $ python ./setup.py abc I have had success with the following.
import sphinx.setup_command
setup(
...
cmdclass={
'abc': sphinx.setup_command.BuildDoc
}, ...
)
|
setuptools 'entry_points' parameter usage
Tag : python , By : user178709
Date : March 29 2020, 07:55 AM
|