Closed svisser closed 10 years ago
Wheel created. Hope it works.
I can confirm the installation via wheel works :)
Downloading/unpacking objectpath
Using version 0.3 (newest of versions: 0.3, 0.3, 0.3, 0.2)
Downloading objectpath-0.3-py2-none-any.whl
Downloading from URL https://pypi.python.org/packages/2.7/o/objectpath/objectpath-0.3-py2-none-any.whl#md5=69e679d317521e6d585d1de8fdae915c (from https://pypi.python.org/simple/objectpath/)
Installing collected packages: objectpath
Successfully installed objectpath
Cleaning up...
From your repos I see that you are an expert in packaging:). I've been sitting here for a few hours and trying to figure out how to include shell scripts to OP distribution so that one could run it from console by writing objectpath
. Setuptools are very confusing. Do you possibly know how to do that?
Python packaging is indeed in a confusing situation hence why there's a lot of active development towards new and better standards.
For shell-scripts you could use the entry_points=
setting in a setup()
call in setup.py
. For example:
setup(
...
entry_points={
'console_scripts': ['objectpath = objectpath.path.to.main:main']
}
)
In this case objectpath
is the name of the command-line tool, objectpath.path.to.main
is the Python module path to the module with the main function and main
is the name of the function that needs to be called. When the package is then installed, the command-line tool will be created for you and it'll run that main
function when you run it.
Thanks a lot! I will try to make it work. Seems that I need to rearrange file structure once again:).
Greetings, Adrian Kalbarczyk
2014-09-04 1:55 GMT+02:00 Simeon Visser notifications@github.com:
Python packaging is indeed in a confusing situation hence why there's a lot of active development towards new and better standards.
For shell-scripts you could use the entry_points= setting in a setup() call in setup.py. For example:
setup( ... entry_points={ 'console_scripts': ['objectpath = objectpath.path.to.main:main'] })
In this case objectpath is the name of the command-line tool, objectpath.path.to.main is the Python module path to the module with the main function and main is the name of the function that needs to be called. When the package is then installed, the command-line tool will be created for you and it'll run that main function when you run it.
— Reply to this email directly or view it on GitHub https://github.com/adriank/ObjectPath/issues/12#issuecomment-54386261.
The
.egg
package format is outdated. The new standard for Python packaging are wheels, see http://pythonwheels.com.