pip install test dependencies for tox from setup.py

I’ve achieved this by committing a slight abuse of extra requirements. You were almost there trying the extras syntax, just that tests_require deps aren’t automatically available that way. With a setup.py like this: from setuptools import setup test_deps = [ ‘coverage’, ‘pytest’, ] extras = { ‘test’: test_deps, } setup( # Other metadata… tests_require=test_deps, extras_require=extras, … Read more

RemoveError: ‘setuptools’ is a dependency of conda and cannot be removed from conda’s operating environment

While I still did not find how to cleanly uninstall anaconda, I was able to resolve the error by using the following: conda update –force conda conda update anaconda and again conda update conda As a result, I got a stable environment with no dependency conflicts. Seems like something within latest conda is too restrictive … Read more

Install dependencies from setup.py

Just create requirements.txt in your lib folder and add all dependencies like this: gunicorn docutils>=0.3 lxml==0.5a7 Then create a setup.py script and read requirements.txt: import os lib_folder = os.path.dirname(os.path.realpath(__file__)) requirement_path = f”{lib_folder}/requirements.txt” install_requires = [] # Here we’ll add: [“gunicorn”, “docutils>=0.3”, “lxml==0.5a7″] if os.path.isfile(requirement_path): with open(requirement_path) as f: install_requires = f.read().splitlines() setup(name=”mypackage”, install_requires=install_requires, […]) The … Read more

How to install a package using pip in editable mode with pyproject.toml?

PEP 660 – Editable installs for pyproject.toml based builds defines how to build projects that only use pyproject.toml. Build tools must implement PEP 660 for editable installs to work. You need a front-end (such as pip ≥ 21.3) and a backend. The statuses of some popular backends are: Setuptools implements PEP 660 as of version … Read more

What is the correct way to share package version with setup.py and the package?

Set the version in setup.py only, and read your own version with pkg_resources, effectively querying the setuptools metadata: file: setup.py setup( name=”foobar”, version=’1.0.0′, # other attributes ) file: __init__.py from pkg_resources import get_distribution __version__ = get_distribution(‘foobar’).version To make this work in all cases, where you could end up running this without having installed it, test … Read more

How can I include package_data without a MANIFEST.in file?

TL;DR: The keys in the package_data dictionaries are packages; the values are lists of globs. ” is not a valid name for any Python package. If you want to have bar.txt be installed next to the __init__.py of package foo, use package_data={‘foo’: [‘bar.txt’]} I have the layout: foo/ __init__.py bar.txt setup.py Now, if foo is … Read more

Python setuptools: how to include a config file for distribution into /etc

I was doing some research on this issue and I think the answer is in the setuptools documentation: http://peak.telecommunity.com/DevCenter/setuptools#non-package-data-files Next, I quote the extract that I think has the answer: Non-Package Data Files The distutils normally install general “data files” to a platform-specific location (e.g. /usr/share). This feature intended to be used for things like … Read more

Is it possible to express a platform-specific dependency in setup.py without building platform-specific versions of my egg?

For sdist, egg and wheel release from : https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#platform-specific-dependencies Sometimes a project might require a dependency to run on a specific platform. This could to a package that back ports a module so that it can be used in older python versions. Or it could be a package that is required to run on a … Read more

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