I have 2 Python scripts that can be used from the shell as they are thanks to argparse.
The relevant part of setup.py:
setup(
# (...)
zip_safe=True,
scripts=['bin/bgce.py', 'bin/sizes.py'],
packages=find_packages(),
data_files=data_files,
entry_points = {
'console_scripts': [
'bgce = bgce:main',
'sizes = sizes:main',]
}
)
I end up with bgce, bgce.py, sizes, sizes.py in /usr/local/bin. All 4 work.
If I leave out either the packages or the scripts line, there are no duplicates, but the files fail like this:
Traceback (most recent call last):
File "/usr/local/bin/bgce", line 9, in <module>
load_entry_point('Backtestground==1.0', 'console_scripts', 'bgce')()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 305, in load_entry_point return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2244, in load_entry_point return ep.load()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1954, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named bgce
What can I do to only have bgce and sizes installed, no duplicates with annoying (for tab-completion) .py attached?