setup.py

cl : Command line warning D9002 : ignoring unknown option "-O3"

cl : Command line warning D9002 : ignoring unknown option "-O3" Question: I want to build a project that uses various flags by type -O3 -Wall -std=c++11 using cython, but I get an error: cl : Command line warning D9002 : ignoring unknown option Maybe it is possible to replace compilation with VS with Cmake, …

Total answers: 1

Migration from setup.py to pyproject.toml: how to specify package name?

Migration from setup.py to pyproject.toml: how to specify package name? Question: I’m currently trying to move our internal projects away from setup.py to pyproject.toml (PEP-518). I’d like to not use build backend specific configuration if possible, even though I do specify the backend in the [build-system] section by require‘ing it. The pyproject.toml files are more …

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

How to get `setup.cfg` metadata at the command line (Python)

How to get `setup.cfg` metadata at the command line (Python) Question: When you have a setup.py file, you can get the name of the package via the command: C:somedir>python setup.py –name And this would print the name of the package to the command line. In an attempt to adhere to best practice, I’m trying to …

Total answers: 3

Questions on pyproject.toml vs setup.py

Questions on pyproject.toml vs setup.py Question: Reading up on pyproject.toml, python -m pip install, poetry, flit, etc – I have several questions regarding replacing setup.py with pyproject.toml. My biggest question was – how does a toml file replace a setup.py. Meaning, a toml file can’t do everything a py file can. Reading into it, poetry …

Total answers: 2

ModuleNotFoundError despite declairing install_requires in setup.py

ModuleNotFoundError despite declairing install_requires in setup.py Question: I wrote create a package uploaded to PyPI for testing, but I keep getting a ModuleNotFoundError for pandas when I try to import it to a virtual environment. I import pandas in a file in the package and therefore, declared it in setup.py under install_requires = [‘pandas’]. Before …

Total answers: 2

How to add PyTorch LTS version in setup.py?

How to add PyTorch LTS version in setup.py? Question: I would like to know how I can include pytorch LTS version in my setup.py file for a library. From the instructions on https://pytorch.org/get-started/locally/#start-locally , we can see that it needs additional information to find the package. Here is the command they suggest : pip3 install …

Total answers: 1

Python setup config install_requires "good practices"

Python setup config install_requires "good practices" Question: My question here may seem really naive but I never found any clue about it on web resources. The question is, concerning install_requires argument for setup() function or setup.cfg file, is it a good practice to mention every package used, even python built-in ones such as os for …

Total answers: 3

Specifying command line scripts in pyproject.toml

Specifying command line scripts in pyproject.toml Question: I’m trying to add a pyproject.toml to a project that’s been using setup.py in order to enable support by pipx. I’d like to specify the command line scripts the project includes in pyproject.toml, but all the guides I can find give instructions for use with poetry, which I …

Total answers: 2

Why is pip editable install causing issue with subpackages?

Why is pip editable install causing issue with subpackages? Question: The Problem I’m having an issue using editable install for my package. Inside my package I have three subpackages as shown in my setup.py file. Everything works fine if I install with pip install ., but if I install with pip install -e . then …

Total answers: 1