distutils

Nested Python C Extensions/Modules?

How do I compile a C-Python module such that it is local to another? E.g. if I have a module named "bar" and another module named "mymodule", how do I compile "bar" so that it imported via "import mymodule.bar"? (Sorry if this is poorly phrased, I wasn't sure what the proper term for it was.) I tried the following in setup.py, but it d...

Uploading to the cheeseshop different versions of a package for different versions of Python

I have an open-source Python project (called GarlicSim), and I maintain 4 different versions of it for Python versions 2.4, 2.5, 2.6 and 3.1. Yes, maybe it's unusual, but I like using as much features as possible. I keep them in 4 different forks of the repository. Now I want to upload my project to the cheeseshop. What's the way to do ...

Custom distutils commands

I have a library called "example" that I'm installing into my global site-packages directory. However, I'd like to be able to install two versions, one for production and one for testing (I have a web application and other things that are versioned this way). Is there a way to specify, say "python setup.py stage" that will not only ins...

`pkg_resources.require()` doesn't see wxPython

I'm using Distribute's pkg_resources.require() in my project to check if prerequisites are installed on the user's machine. One of the prerequisites is wxPython. But when I try pkg_resources.require('wxPython'), I'm getting the DistributionNotFound error, even though it's definitely installed and operable on my machine. I also tried the...

Python: Error in uploading an MSI distribution to the cheeseshop

I'm trying to upload an MSI binary distribution of my project to the cheeseshop. I'm doing setup.py bdist_msi register upload. It builds the project and the setup script finishes, but then I get: error: garlicsim-0.1: No such file or directory And no .msi file is uploaded to PyPi. Any clue? ...

Weird PyPI authentication behavior

I'm trying to upload my package to PyPI. It asks me to identify, I do, it gives an OK response (which doesn't happen unless the identification is right), but then it claims I didn't identify! Why? [...] removing 'build\bdist.win32\egg' (and everything under it) running register We need to know who you are, so please choose either: 1. u...

How can I run a Makefile in setup.py?

I need to compile ICU using it's own build mechanism. Therefore the question: How can I run a Makefile from setup.py? Obviously, I only want it to run during the build process, not while installing. ...

How to get the arch string that distutils uses for builds?

When I build a c extension using python setup.py build, the result is created under a directory named build/lib.linux-x86_64-2.6/ where the part after lib. changes by the OS, CPU and Python version. Is there a way I can access the appropriate string for my current architecture from python? Hopefully in a way that is guaranteed to mat...

How to run installed python script?

I used distutils to install my python package, with this setup.py : import distutils.core args = { 'name' : 'plugh', 'version' : '1.0', 'scripts' : [ "scripts/plugh" ], 'packages': [ "plugh" ], } d = distutils.core.setup( **args ) On linux/mac, it works as expected: % plugh hel...

data cache for python package

I have a python module which generates large data files which I want to cache on disk for future use. The cache is likely to end up some hundreds of MB for a normal user, but save a lot of computation time. The files aren't distributed with the module, but are generated the first time the code is run with a given set of parameters. So ...

Referencing an old .lib in setup.py (or How can I convert an old .lib to a .a file)

I'm writing a python wrapper for an old proprietary system with header files, a .lib and some .dlls available to me on Windows. The library that is referenced is in .lib format (header files have references to Borland C & MSC) I've attempted to convert the .lib to a .a file with pexports -- it complains about not being able to load PE ...

Configuring extension modules with distutils/setuptools

I have a Python project with mutiple extension modules written in C, which talk to a third-party library. However, depending on the user's environment and options some modules should not be built, and some compiler flags should be enabled/disabled. The problem is that I have to build the list of extension modules before I call setup(),...

how to distribute python app with glade GUI?

I'm trying to distribute this app that I wrote in python. The application consists of 2 python scripts. 2 .glade files and 1 .png file. Here is my dir structure on this project vasm/ vasmcc.py src/ vasm.py gui/ vasm.glade vasmset.glade logo.png vasmcc is just the python script for the gui... th...

State of Python Packaging: Buildout, Distribute, Distutils, EasyInstall, etc...

The last time I had to worry about installing Python packages was two years ago working with Enthought, NumPy and MayaVi2. That experience gave me lingering nightmares related to quirky behavior installing & updating Python packages in non-standard locations (in $HOME/usr/local2.6/, for example). Anyway, my work is taking me back to in...

setting script path in a buildout using one of the distutils recipes

I am using buildout. I am using it to install openerp. I would like the scripts that openerp creates to run itself available in ${buildout:location}/bin I tried zerokspot.recipe.distutils and collective.recipe.distutils How would I get the scripts built in bin? ...

Can a Python package depend on a specific version control revision of another Python package?

Some useful Python packages are broken on pypi, and the only acceptable version is a particular revision in a revision control system. Can that be expressed in setup.py e.g requires = 'svn://example.org/useful.package/trunk@1234' ? ...

How can I make this long_description and README differ by a couple of sentences?

For a package of mine, I have a README.rst file that is read into the setup.py's long description like so: readme = open('README.rst', 'r') README_TEXT = readme.read() readme.close() setup( ... long_description = README_TEXT, .... ) This way that I can have the README file show up on my github page every time I commit...

Problem installing OpenERP server with buildout !

I'm trying to deploy OpenERP with a buildout and my own piece of code. In fact I would like to build a complete deployement structure allowing me to use OpenERP with custom modules and patch. First of all, before adding any personnal configuration, I was trying to create a buildout which will have the responsability to configure everyth...

How does one instruct distutils to sign generated RPMS?

How do I write the setup.cfg file for distutils such that setup.py bdist_rpm generates a PGP-signed RPM? I'd like to be able to offer signed packages without needing to add a second build system on top of distutils. ...

Does setup.py's extras_require keyword support comma-separated extras?

Setuptools lets you list requirements for optional features # mypackage 'extras_require' : { 'PDF' : ['reportlab'], 'DOCX' : ['docxlib'] } and another package can specify 'requires' : [ 'mypackage[PDF]' ]. If another package wants to require more than one extra from the first package, can it ask for 'requires' : [ 'mypackage[PDF, DOC...