How to Bootstrap numpy installation in setup.py

The following works at least with numpy1.8 and python{2.6,2.7,3.3}: from setuptools import setup from setuptools.command.build_ext import build_ext as _build_ext class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process: __builtins__.__NUMPY_SETUP__ = False import numpy self.include_dirs.append(numpy.get_include()) setup( … cmdclass={‘build_ext’:build_ext}, setup_requires=[‘numpy’], … ) For a small explanation, see why it … Read more

“setup.py upload” is failing with “Upload failed (401): You must be identified to edit package information”

Just found this page, which solves the issue: I also noticed that while it was asking me to save my login information, and I hit Y everytime, it still asked me for the username and password. It turned out that it was saving the information incorrectly as follows: [pypi] username:dcramer password:******* Changing it out to … Read more

Does pip handle extras_requires from setuptools/distribute based sources?

We use setup.py and pip to manage development dependencies for our packages, though you need a newer version of pip (we’re using 1.4.1 currently). #!/usr/bin/env python from setuptools import setup from myproject import __version__ required = [ ‘gevent’, ‘flask’, … ] extras = { ‘develop’: [ ‘Fabric’, ‘nose’, ] } setup( name=”my-project”, version=__version__, description=”My awsome … Read more

Specify where to install ‘tests_require’ dependencies of a distribute/setuptools package

You cannot specify where the test requirements are installed. The whole point of the tests_require parameter is to specify dependencies that are not required for the installation of the package but only for running the tests (as you can imagine many consumers might want to install the package but not run the tests). If you … Read more

How to write a minimally working pyproject.toml file that can install packages?

my question differ because I ask for a human-written pyproject.toml First, the pyproject.toml file is always “human-writable“. Then, it is important to know that in this context setuptools and Poetry take the role of what are called “build back-ends” (in a “PEP 517” sense), and there are many such build back-ends available today, setuptools and … Read more

Extending setuptools extension to use CMake in setup.py?

What you basically need to do is to override the build_ext command class in your setup.py and register it in the command classes. In your custom impl of build_ext, configure and call cmake to configure and then build the extension modules. Unfortunately, the official docs are rather laconic about how to implement custom distutils commands … Read more

Python: Multiple packages in one repository or one package per repository?

One aspect is covered here https://pip.readthedocs.io/en/stable/reference/pip_install/#vcs-support (Updated link: https://pip.pypa.io/en/stable/topics/vcs-support/) In particular, if setup.py is not in the root directory you have to specify the subdirectory where to find setup.py in the pip install command. So if your repository layout is: pkg_dir/ setup.py # setup.py for package pkg some_module.py other_dir/ some_file some_other_file You’ll need to use … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)