Questions tagged [distutils2]

Distutils2 is the newer and backwards-incompatible version of the python distutils library. It is available for python2.x and 3.x.

Distutils2 is the newer and backwards-incompatible version of the python distutils library. It is available for python2.x and 3.x.

Documentation: http://packages.python.org/Distutils2/
(Also: http://docs.python.org/dev/packaging/introduction.html)
14 questions
42
votes
2 answers

How to overwrite pypi package when doing upload from command line?

I want to automate the upload process bug in some cases the python setup.py upload fails because pypi server already have the save version uploaded. How can I force it to upload, from the script (i know I can remove the old variant using the web…
sorin
  • 161,544
  • 178
  • 535
  • 806
13
votes
3 answers

Compiling an optional cython extension only when possible in setup.py

I have a python module fully implemented in python. (For portability reasons.) The implementation of a small part has been duplicated in a cython module. To improve perfomance where possible. I know how to install the .c modules created by cython…
ARF
  • 7,420
  • 8
  • 45
  • 72
10
votes
4 answers

How to distribute `.desktop` files and icons for a Python package in Gnome (with distutils or setuptools)?

Currently I'm using the auto-tools to build/install and package a project of mine, but I would really like to move to something that feels more "pythonic". My project consists of two scripts, one module, two glade GUI descriptions, and two .desktop…
Magnus
  • 4,644
  • 1
  • 33
  • 49
7
votes
2 answers

Automate compilation of protobuf specs into python classes in setup.py

I have a python project that uses google protobufs as a message format for communicating over the network. Generating python files from the .proto files is straight-forward using the protoc program. How can I configure my setup.py file for the…
Justin Buchanan
  • 404
  • 3
  • 9
7
votes
3 answers

Distributing Python scripts without .py extension

if I'm writing a package in Python for distribution and I put some scripts to be regarded as executables in the scripts of setup.py, is there a standard way to make them not have the *.py extension? Is it sufficient to just make files that do not…
user248237
5
votes
2 answers

Getting error only one sdist may be uploaded

Why is this creating 2 tar.gz files, ‘ python setup.py sdist? I am trying to upload using twine upload -r pypitest dist/*.tar.gz and i get error saying HTTPError: 400 Client Error: Only one sdist may be uploaded per release. for url:…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
5
votes
1 answer

How do I tell distutils about packages in subdirectories?

I have a setup.py file for a project I'm working on that needs to pull in several third party packages that aren't (yet) released in the cheese shop. One of these is the 'spine' and 'pyguts' modules from this git…
Thomi
  • 11,647
  • 13
  • 72
  • 110
4
votes
1 answer

Change output filename in setup.py (distutils.extension)

Here's my setup.py from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize wrapper = Extension( name="libwrapper", ... ) setup( name="libwrapper", …
user10207893
  • 243
  • 1
  • 2
  • 11
2
votes
1 answer

How to build a PEP384-compliant Python extension module and package it with correct ABI3 tag?

mymodule.c starts as follows: #define PY_SSIZE_T_CLEAN #define Py_LIMITED_API 0x03070000 #include "Python.h" It builds with no errors and warnings. Yet, the resulting file is named mymodulename.cpython-37m-x86_64-linux-gnu.so Build command: $…
Dr Leo
  • 379
  • 2
  • 5
2
votes
1 answer

How to upgrade Python along with installed packages?

If I install several packages with Python 2.6 (e.g. using easy_install) and then I want to upgrade to Python 2.7, is there a way to upgrade Python and then automatically "import" all those installed packages along with it? Or do they have to be…
user248237
2
votes
1 answer

Using nosetests with distutils2

I am trying to use nosetests as part of my building/publishing chain, which is based on distutils2 (using the setup.cfg file instead of the "legacy" setup.py script). Unluckily, when I issue: pysetup run test I get: running test running…
mac
  • 42,153
  • 26
  • 121
  • 131
1
vote
0 answers

How do I build a C extension as a submodule to a C extension main module with distutils?

I have two files, module.c and submodule.c. I have the following code in setup.py: from distutils.core import setup, Extension module = Extension('module', sources = ['module.c']) submodule = Extension('submodule', sources =…
gny-001f2
  • 29
  • 5
1
vote
1 answer

How to avoid overwriting previous package installation with distutils

I have a python package that uses distutils. I would like to configure the setup.py to do either of the following: Detect a previously-installed version of the package and raise an error Offer to remove the previously-installed version before…
Luke
  • 11,374
  • 2
  • 48
  • 61
0
votes
1 answer

distutils byte-compiling error in python 2

I have a package that can be installed in python 3 using a distutils based setup.py with the command python setup.py install but gives a SyntaxError in python 2. Is there a way to skip the byte-compilation of this particular module or try to catch…
gypaetus
  • 6,873
  • 3
  • 35
  • 45