[Distutils] pkg_resources on Windows

Andrea Crotti andrea.crotti.0 at gmail.com
Tue Dec 13 15:42:24 CET 2011

On 12/13/2011 02:25 PM, Guy Rozendorn wrote:
> If your console_scripts section in setup.py point to a correct entry 
> point, then distribute should've created a dev_main.exe executable 
> wrapper, and a dev_main-script.py under C:\Python25\Scripts.
> The executable wrapper reads the generated python file and extracts 
> the pyhton executable path from the shebang file, and calls 
> CreateProcess with that python executable.
> If you don't have these two files, then, I can guess that either:
> * You're using an old version of distribute
> * Your setup.py is incorrect.
> - Guy

The version of setuptools is  rather old right.
Anyway this is the setup.py:

from setuptools import setup
from psi.devsonly.api import build_config

#TODO: what if this module is having some nasty side effects??
import os
from os.path import join
config = build_config()
config['setup_requires'] = []
config['package_data'] = {
     # any package containing this file should be included
     '': ['windows_easy_install.pth']

bindir = join('psi', 'devsonly', 'bin')
scripts = [join(bindir, x) for x in os.listdir(bindir) if x.endswith('.py')]

# networkx in particular is very hard to build
extra_requires = ('rope', 'pygraphviz', 'networkx')

# we might need to be able to find out the version number at setup time
# so the egg telling this should have to be there in setup_requires
config['scripts'] = scripts


Where build_config is something done somewhere else constructing a 
similar dictionary:
     # entry points should also be an external file
     config = {
         'name': modname('.'),
         'version': '0.1',
         # 'version': get_svn_revision_cmd(),
         'author': "Airbus",
         'test_suite': 'nose.collector',
         'packages': find_packages(),
         'install_requires': requires,
         'zip_safe': False,
         'entry_points': entry_points,
         'setup_requires': ['psi.devsonly'],  # this is somehow late 
because every
         'namespace_packages': list(modname_generator(modname('.'))),
         'tests_require': test_requires + 

Any hint is welcome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20111213/a46483e4/attachment.html>

More information about the Distutils-SIG mailing list