distutils

List of PyPI classifiers

List of PyPI classifiers Question: I can get a list of trove classifiers like this: >>> import requests >>> response = requests.get(‘https://pypi.python.org/pypi’, params={‘:action’: ‘list_classifiers’}) >>> classifiers = response.text.splitlines() >>> len(classifiers) 649 >>> classifiers[:5] [‘Development Status :: 1 – Planning’, ‘Development Status :: 2 – Pre-Alpha’, ‘Development Status :: 3 – Alpha’, ‘Development Status :: 4 …

Total answers: 2

What is the graft command in Python's MANIFEST.in file?

What is the graft command in Python's MANIFEST.in file? Question: I found a Python project with a MANIFEST.in file. I can guess at the meaning of much of it, but I am unclear on the meaning of the line: graft tools Asked By: Michael Felt || Source Answers: You can see such a file in …

Total answers: 1

What does `python setup.py check` actually do?

What does `python setup.py check` actually do? Question: What exactly does python setup.py check actually do? Asked By: Dave || Source Answers: First stop, the distutils package documentation: The check command performs some tests on the meta-data of a package. For example, it verifies that all required meta-data are provided as the arguments passed to …

Total answers: 2

How to add package data recursively in Python setup.py?

How to add package data recursively in Python setup.py? Question: I have a new library that has to include a lot of subfolders of small datafiles, and I’m trying to add them as package data. Imagine I have my library as so: library – foo.py – bar.py data subfolderA subfolderA1 subfolderA2 subfolderB subfolderB1 … I …

Total answers: 11

DistutilsOptionError: must supply either home or prefix/exec-prefix — not both

DistutilsOptionError: must supply either home or prefix/exec-prefix — not both Question: I’ve been usually installed python packages through pip. For Google App Engine, I need to install packages to another target directory. I’ve tried: pip install -I flask-restful –target ./lib but it fails with: must supply either home or prefix/exec-prefix — not both How can …

Total answers: 8

install_requires based on python version

install_requires based on python version Question: I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ “threadpool >= 1.2.7 if python_version < 3.2.0”, ], How can one make that? Asked By: iTayb || Source …

Total answers: 2

How to access python package metadata from within the python console?

How to access python package metadata from within the python console? Question: If I have built a python package employing distutils.core, e.g. via setup( ext_package=”foo”, author=”me”, version=”1.0″, description=”foo package”, packages=[“foo”,], ) where does all the metadata go (what is it intended for?) and how can I access it from within python. Specifically, how can I …

Total answers: 7

LNK1181: cannot open input file 'm.lib'

LNK1181: cannot open input file 'm.lib' Question: When trying to install a certain Python geophysical toolkit, I get this error: LINK : fatal error LNK1181: cannot open input file ‘m.lib’ I believe it is due to my use of the MSVC’s buildtools. In their setup.py I found: setup(…, ext_modules=[ Extension(…, […], libraries=[‘m’], … ]) What …

Total answers: 2

Python: How to force overwriting of files when using setup.py install (distutil)

Python: How to force overwriting of files when using setup.py install (distutil) Question: I am using distutil to install my python code using python setup.py install I run into problems when I want to install an older branch of my code over a new one: setup.py install won’t overwrite older files. A work around is …

Total answers: 3

How do I run tox in a project that has no setup.py?

How do I run tox in a project that has no setup.py? Question: I would like to use tox to run my unittests in two virtualenvs, since my application has to support 2 different Python versions. My problem is that tox requires a setup.py, but I have none since my application is not a module …

Total answers: 4