Featured post
python - Non-generated script with SetupTools/Distribute in setup.py -
i'm trying non-generated script when run setup.py install
python package building.
i have read distutils documentation couldn't find clear examples on how accomplish this.
mercurial in part importing install_scripts
:
from distutils.command.install_scripts import install_scripts
and goes on replace things within hg
script. hg
executable ends being used overriding default behavior of using this:
#!/users/alfredo/python/foo/bin/python # easy-install-script: 'foo==0.0.1','foo' __requires__ = 'foo==0.0.1' import pkg_resources pkg_resources.run_script('foo==0.0.1', 'foo')
i trying not end using pkg_resources importing foo
package, rather end script using. i'm aware why auto-generated , still want go other route.
this copy of base setup.py using:
import distribute_setup distribute_setup.use_setuptools() setuptools import setup tests_require = ['pytest'] setup( name = "foo", version = "0.0.1", packages = ['_foo'], scripts = ['foo'], zip_safe = false, package_data = {'': ['distribute_setup.py']}, author = "alfredo deza", author_email = "alfredodeza [at] gmail [dot] com", description = "", long_description = """\ foo """, classifiers=[ 'development status :: 4 - beta', 'intended audience :: developers', 'license :: osi approved :: mit license', 'topic :: software development :: build tools', 'programming language :: python :: 2.5', 'programming language :: python :: 2.6', 'programming language :: python :: 2.7', ], license = "mit", keywords = "", url = "", )
after days of digging around... turns out mercurial not doing special.
even though setup.py
lot of things not anything interfere installing script correctly without pkg_resources linking it.
what difference then?
the difference using distribute, , way works overrides setup
module own (instead of setuptools) , has own different behavior installation.
in case, different way of installing scripts, means script foo
copied on egg location , linked through foo
script imports pkg_resources , links version.
this not want , couldn't find any distribute documentation on it. however, clear provide way of uninstallation later on.
so beware! if want go path, have issues if want uninstall stuff.
until distribute doesn't provide way me customize copy in scripts have switch regular setuptools
- Get link
- X
- Other Apps
Comments
Post a Comment