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 packaging: wheels vs tarball (tar.gz)

This answered it for me (directly from the wheel PEP): Python needs a package format that is easier to install than sdist. Python’s sdist packages are defined by and require the distutils and setuptools build systems, running arbitrary code to build-and-install, and re-compile, code just so it can be installed into a new virtualenv. This … Read more

define ant property from environment with default value

An example from the Ant documentation of how to get an environment variable into a property: <property environment=”env”/> <echo message=”Number of Processors = ${env.NUMBER_OF_PROCESSORS}”/> <echo message=”ANT_HOME is set to = ${env.ANT_HOME}”/> In your case, you would use ${env.RELEASE_VER}. Then for the conditional part, the documentation here says that there are three possible attributes: Attribute Description … Read more

Using an extra python package index url with setup.py

If you’re the package maintainer, and you want to host one or more dependencies for your package somewhere other than PyPi, you can use the dependency_links option of setuptools in your distribution’s setup.py file. This allows you to provide an explicit location where your package can be located. For example: from setuptools import setup setup( … Read more

What is the advantage of setting zip_safe to True when packaging a Python project?

Zip files take up less space on disk, which also means they’re more quickly read from disk. Since most things are I/O bound, the overhead in decompressing the packaging may be less than the overhead in reading a larger file from disk. Moreover, it’s likely that a single, small-ish zip file is stored sequentially on … Read more

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