Packaging legacy Fortran in Python. Is it OK to use setuptools and numpy.distutils?

This seems to work but I have questions. Is it generally good practice to mix setuptools and numpy.distribute? Does the order I import them matter? Should I always import setuptools first? Is there an official up-to-date tutorial for packaging extensions to numpy? Perhaps even one with some discussion Fortran extensions? You should not need to … Read more

How to configure __main__.py, __init__.py, and setup.py for a basic package setup?

You have almost everything you need (even a bit more)! I’d go with the following setup: code.py: foo = 1 __init__.py: from .code import foo Doing a relative import here because __init__.py will be used when importing the whole package. Note that we explicitly mark the import as relative by using the .-syntax because this … Read more

How do setuptools, distribute, and pip relate to one another?

[2014-10 TL;DR: distribute is dead, use pip, the new setuptools, and, for binary distributions, wheels. More below.] [Original answer] Distribute is was a fork of the older setuptools so nearly all comments that follow apply equally to Distribute and setuptools. Setuptools was an attempt to fill in a number of holes in the even older … Read more

How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix

We also develop software projects that depend on numpy, scipy and other PyPI packages. Hands down, the best tool currently available out there for managing remote installations is zc.buildout. It is very easy to use. You download a bootstrapping script from their website and distribute that with your package. You write a “local deployment” file, … Read more

How to set up entry_points in setup.cfg

The section must be [options.entry_points]. See an example at https://github.com/github/octodns/blob/4b44ab14b1f0a52f1051c67656d6e3dd6f0ba903/setup.cfg#L34 [options.entry_points] console_scripts = octodns-compare = octodns.cmds.compare:main octodns-dump = octodns.cmds.dump:main octodns-report = octodns.cmds.report:main octodns-sync = octodns.cmds.sync:main octodns-validate = octodns.cmds.validate:main

How to specify version ranges in install_requires (setuptools, distribute)

According to the documentation, your syntax should work correctly. The documentation states that: setuptools and pkg_resources use a common syntax for specifying a project’s required dependencies. This syntax consists of a project’s PyPI name, optionally followed by a comma-separated list of “extras” in square brackets, optionally followed by a comma-separated list of version specifiers. A … Read more

Automatic version number both in setup.py (setuptools) AND source code?

You could also reverse the dependency: put the version in mylib/__init__.py, parse that file in setup.py to get the version parameter, and use git tag $(setup.py –version) on the command line to create your tag. git tag -a v$(python setup.py –version) -m ‘description of version’ Is there anything more complicated you want to do that … Read more

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