setuptools

How to include a .ini file in my python package when installing via pip from TFS2017?

How to include a .ini file in my python package when installing via pip from TFS2017? Question: I have a library that requires a .ini file at some point (a default config file if none provided by the user). Here is the hierarchy, with the required file marked: ├───src │ ├───main │ │ │ MANIFEST.in …

Total answers: 1

How to reference a requirements.txt from a pyproject.toml?

How to reference a requirements.txt in the pyproject.toml of a setuptools project? Question: I’m trying to migrate a setuptools-based project from the legacy setup.py towards modern pyproject.toml configuration. At the same time I want to keep well established workflows based on pip-compile, i.e., a requirements.in that gets compiled to a requirements.txt (for end-user / non-library …

Total answers: 2

`pip install` Gives Error on Some Packages

`pip install` Gives Error on Some Packages Question: Some packages give errors when I try to install them using pip install. This is the error when I try to install chatterbot, but some other packages give this error as well: pip install chatterbot Collecting chatterbot Using cached ChatterBot-1.0.5-py2.py3-none-any.whl (67 kB) Collecting pint>=0.8.1 Downloading Pint-0.19.2.tar.gz (292 …

Total answers: 3

setup.py's install_requires – how do I specify python version range for a specific dependency?

setup.py's install_requires – how do I specify python version range for a specific dependency? Question: I’m working on a python project and the package supports python 3.6 – 3.10. There were these 2 lines in the install_requires list in setup.py: "numpy>=1.18.5, <=1.19.5; python_version==’3.6’", "numpy>=1.19.5; python_version>=’3.7’", And I tried to change them to "numpy>=1.18.5, <=1.19.5; python_version==’3.6’", …

Total answers: 1

How to indicate use_scm_version in setup.cfg?

How to indicate use_scm_version in setup.cfg? Question: I’m switching from using setup.py to setup.cfg. How can I indicate in setup.cfg that I want use_scm_version= True? Asked By: shalva_t || Source Answers: Did you try the following: from setuptools import setup from setuptools.config import read_configuration conf_dict = read_configuration("setup.cfg") PKG_NAME = conf_dict[‘metadata’][‘name’] setup( use_scm_version={"write_to": f"{PKG_NAME}/_version.py"}, ) Source: …

Total answers: 3

How to fix 'UserWarning: Distutils was imported before Setuptools'?

How to fix 'UserWarning: Distutils was imported before Setuptools'? Question: When I cloned some packages including python tools, an error occured: Errors << unique_id:cmake /home/scpark/cps_ws/logs/unique_id/build.cmake.001.log CMake Warning (dev) at CMakeLists.txt:2 (project): Policy CMP0048 is not set: project() command manages VERSION variables. Run "cmake –help-policy CMP0048" for policy details. Use the cmake_policy command to set the …

Total answers: 2

How to specify a different non-pypi package index url to setuptools.setup?

How to specify a different non-pypi package index url to setuptools.setup? Question: I’m trying to specify a package dependency not in pypi [but in jfrog/Artifactory] to setuptoools.setup() Things I’ve tried: Using the dependency_links argument to setuptools.setup() like so: dependency_links=[‘http://USER:PASSWORD@ARTIFACTORYHOST:8082/api/pypi/pypi/simple’] but dependency_links is now deprecated since 19.0 (released 2019-01-22). Using the install_requires argument to setuptools.setup() like …

Total answers: 1

How to interpret the "Package would be ignored" warning generated by setuptools?

How to interpret the "Package would be ignored" warning generated by setuptools? Question: I work on several python packages that contain data within them. I add them via the MANIFEST.in file, passing include_package_data=True to setup. For example: # MANIFEST.in graft mypackage/plugins graft mypackage/data Up to now, this has worked without warnings as far as I …

Total answers: 2

Heroku pip install suddenly started to return an error: use_2to3 is invalid

Heroku pip install suddenly started to return an error: use_2to3 is invalid Question: Heroku deploy started to return this error when trying to deploy a python app: —–> Installing requirements with pip Collecting amqp==2.6.1 Downloading amqp-2.6.1-py2.py3-none-any.whl (48 kB) Collecting anyjson==0.3.3 Downloading anyjson-0.3.3.tar.gz (8.3 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status ‘error’ …

Total answers: 2

How to reference a variable defined in setup.py?

How to reference a variable defined in setup.py? Question: I’ve got the following setup.py: import itertools dependencies = { ‘minimal’: [‘numpy’, ‘requests’], ‘option-a’: [‘scipy’], ‘option-b’: [‘matplotlib’] } setup( install_requires=dependencies[‘minimal’], # minimal dependencies extras_require={ ‘all’: list(itertools.chain(*dependencies.values())), # all dependencies included **{k: v for k, v in dependencies.items() if k != ‘minimal’}, # each extra dependency group …

Total answers: 1