I'm trying to get a non-generated script when I run setup.py install for a Python Package that I am building.
I have read the distutils documentation but couldn't find clear examples on how to accomplish this.
Mercurial does this in some part by importing the install_scripts :
from distutils.command.install_scripts import install_scripts
And then goes on to replace some things within their hg script. This hg executable ends up being used overriding the default behavior of using something like 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 am trying not to end up using pkg_resources importing my foo package, but rather
end up with a script I am using. I'm aware why this is auto-generated and still want to
go the other route.
This is a copy of the base setup.py that I am using:
import distribute_setup
distribute_setup.use_setuptools()
from 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 = "",
)