Note that there are some explanatory texts on larger screens.

plurals
  1. PONon-generated script with SetupTools/Distribute in setup.py
    text
    copied!<p>I'm trying to get a non-generated script when I run <code>setup.py install</code> for a Python Package that I am building.</p> <p>I have read the distutils documentation but couldn't find clear examples on how to accomplish this.</p> <p>Mercurial does this in some part by importing the <code>install_scripts</code> :</p> <pre><code>from distutils.command.install_scripts import install_scripts </code></pre> <p>And then goes on to replace some things within their <code>hg</code> script. This <code>hg</code> executable ends up being used overriding the default behavior of using something like this:</p> <pre><code>#!/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') </code></pre> <p>I am trying <em>not</em> to end up using pkg_resources importing my <code>foo</code> 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.</p> <p>This is a copy of the base setup.py that I am using:</p> <pre><code>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 = "", ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload