python setuptools install_requires is ignored when overriding cmdclass

The same problem just happened to me. It somehow seems like something triggers setuptools to do an ‘old-style install’ with distutils, which indeed does not support install_requires. You call install.run(self) which calls run(self) in setuptools/setuptools/command/install.py, line 51-74 https://bitbucket.org/pypa/setuptools/src/8e8c50925f18eafb7e66fe020aa91a85b9a4b122/setuptools/command/install.py?at=default def run(self): # Explicit request for old-style install? Just do it if self.old_and_unmanageable or self.single_version_externally_managed: return _install.run(self) … Read more

What is the difference between `extras_require()` and `install_requires()` in setup.py?

According to the setuptools documentation, extras_require A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features. and install_requires A string or list of strings specifying what other distributions need to be installed when this one is. The … Read more

Enforcing python version in setup.py

The current best practice (as of this writing in March 2018) is to add a python_requires argument directly to the setup() call in setup.py: from setuptools import setup […] setup(name=”my_package_name”, python_requires=”>3.5.2″, […] Note that this requires setuptools>=24.2.0 and pip>=9.0.0; see the documentation for more information.

Installing Python-2.7 on Ubuntu 10.4

You don’t want zlibc, it’s something else completely. You want zlib1g (which will certainly be installed already) and, as Luper mentioned, the ‘development’ package which is zlib1g-dev. Debian-based Linux distros split each C library into a separate runtime binary package and a development package which delivers the headers for inclusion at compile time. If you … Read more

setup_requires with Cython?

Starting from 18.0 release of setuptools (released on 2015-06-23) it is possible to specify Cython in setup_requires and pass *.pyx modules sources for regular setuptools.Extension: from setuptools import setup, Extension setup( # … setup_requires=[ # Setuptools 18.0 properly handles Cython extensions. ‘setuptools>=18.0’, ‘cython’, ], ext_modules=[ Extension( ‘mylib’, sources=[‘src/mylib.pyx’], ), ], )

How to include and install local dependencies in setup.py in Python?

There is a new technique (Since version 19.1) called Direct references. Just pretend like your file is hosted on localhost. from setuptools import setup path_to_my_project = “/home/user/projects/my_package” # Do any sort of fancy resolving of the path here if you need to setup(# … other arguments install_requires=[f”my_package @ file://localhost/{path_to_my_project}#egg=my_package”] )