distutils

Directory ignored by "setup.py"

The Selenium setup.py can be found at http://code.google.com/p/selenium/source/browse/trunk/setup.py. When running "python setup.py sdist" the "firefox/test/py" directory is ignored for some reason though it's mentioned in the "package_dir" and in "packages". Any ideas why it's ignored? ...

python distutils does not include data_files

I am new to distutils.. I am trying to include few data files along with the package.. here is my code.. from distutils.core import setup setup(name='Scrapper', version='1.0', description='Scrapper', packages=['app', 'db', 'model', 'util'], data_files=[('app', ['app/scrapper.db'])] ) The zip f...

Python can't locate distutils_path on Mac OSX.

I've been using virtualenv + pip for python development. I'm not sure what happened, but suddenly whenever I try to run a command-line tool or import libraries, I get this error message: Traceback (most recent call last): File "/Users/kyle/.virtualenvs/fj/bin/pip", line 4, in <module> import pkg_resources File "/Users/kyle/.vir...

Python distutils builds extensions differently on different machines.

I have been working on a Python extension module with lots of files. While building on one machine, python setup.py build will happily detect changed files, build just those files, and link the whole thing together, just like make. On another machine, however, a single change to any file triggers a recompile of all sources. Just to be c...

Python packages installation in Windows

I recently began learning Python, and I am a bit confused about how packages are distributed and installed. I understand that the official way of installing packages is distutils: you download the source tarball, unpack it, and run: python setup.py install, then the module will automagically install itself I also know about setuptools ...

Cross-compiling python extensions under Linux using distutils

Hello, everybody! Is there any way to compile both Windows and Linux versions of Python/distutils/SWIG/C++ extensions under Linux? As far as I understand the problem is at least in obtaining windows version of python-dev. Thank you. ...

GCC not recognising standard header files when using swig and distutils

I'm trying to generate a python wrapper for a C++ library that I am putting together. I have just come across SWIG and am trying to use this in conjunction with distutils. I'm modifying someone elses code, so odd errors were to be expected but this one is just confusing. I've managed to generate a c++ wrapper file with SWIG and am now a...

Change the gcc version that distutils uses

I'm on Snow Leopard, and want distutils to use gcc 4.0 and not 4.2, can anyone tell me how to make it do that? I've tried changing the /usr/bin/g* symlinks, and setting the C* environment vars -- but to no avail. Any thoughts? ...

Dynamically Linking Python Extension (.pyd) to Another Extension

Python Extension modules are just dynamic libraries, so I assume it's possible to dynamically link a Python extension to another. The problem is on Windows Python Extensions are are given the .pyd extension instead of .dll, so I can't get distutils to link to them when I run the setup script. (I don't think this is a problem on UNIX beca...

Python distutils.Extension : setting a concurrency level

Dear Stackoverflow, I'm wondering how to reproduce the equivalent of a make -j<n> on a setup.py using distutils.Extension, in order to build a C extension to Python 2.6 . My desired outcome: having setup.py build using a few instances of my C-compiler in the same time, instead of only one. There are probably an environnement var or tw...

Incorrect data_files location using distutils

The distutils documentation specifies that when the target directory for data_files is a relative path, the files will be installed relative to sys.prefix. On my system (Linux Mint), this is /usr; however, the data_files are instead installing to /usr/local. How can I correct this without losing cross-platform support? ...

How to handle configuration files with distutils to respect unixen's FHS?

Suppose we have a program called foo. If use absolute path: setup(..., data_files=[..., ('/etc', ['foo.cfg'])] ) Then foo$ python setup.py --prefix=/usr/local and we will have /etc/foo.cfg. But we should have /usr/local/etc/foo.cfg instead according to FHS. What if we use a relative path? setup(..., data_f...

How to extend distutils with a simple pre uninstall script?

I found Question#1321270 for post install. My main target for the moment is bdist_wininst, but i did not find anything related to uninstall... For clarification: I want to register a com server after installation and de-register it before uninstall. Extended answer: ars' answer seems correct, however, for the completeness of things (I ...

How to bundle a Gnome applet with distutils?

I'm trying to write a Gnome applet in Python. In fact, I've written the app and I'm stuck when it comes to packaging it. I started by looking into distutils. The problem I ran into right away was that when specifying py_modules, an extension of .py is expected. However, Gnome applets are basically shell scripts. (That use the Python int...

How to strip source from distutils binary distributions?

I want to create a bytecode-only distribution from distutils (no really, I do; I know what I'm doing). Using setuptools and the bdist_egg command, you can simply provide the --exclude-source parameter. Unfortunately the standard commands don't have such an option. Is there an easy way to strip the source files just before the tar.gz, z...

How to depends of a system command with python/distutils?

Hi, I'm looking for the most elegant way to notify users of my library that they need a specific unix command to ensure that it will works... When is the bet time for my lib to raise an error: Installation ? When my app call the command ? At the import of my lib ? both? And also how should you detect that the command is missing (if ...

How can I make setuptools install a package that's not on PyPI?

I've just started working with setuptools and virtualenv. My package requires the latest python-gearman that is only available from GitHub. The python-gearman version that's on PyPI is an old one. The Github source is setuptools-compatible, i.e. has setup.py, etc. Is there a way to make setuptools download and install the new version ins...

Question about bdist directory hierarchy

Hey everyone. I just made a small app and then wrote a setup.py file for it. Everything seems to be working, except I can't figure out a small thing. When passing the bdist option to setup.py, it creates the archive gzipped tar file. When I open that file, I notice that the directory structure is: > usr > lib > python2.6 >...

python distutils, writing c extentions with generated source code

I have written a Python extension library in C and I am currently using distutils to build it. I also have a Python script that generates a .h file, which I would like to include with my extension. Is it possible to setup a dependency like this with distutils? Will it be able to notice when my script changes, regenerate the .h file, and...

Create launchable GUI script from Python setuptools (without console window!)

The way I currently add an executable for my Python-based GUI is this: setup( # ... entry_points = {"gui_scripts" : ['frontend = myfrontendmodule.launcher:main']}, # ... ) On Windows, this will create "frontend.exe" and "frontend-script.pyw" in Python's scripts folder (using Python 2.6). When I execute the EXE ...