Questions tagged [pyproject.toml]

Questions pertaining to the python package configuration system based on a pyproject.toml file, as discussed in PEP517 and PEP518, among others.

Questions pertaining to the python package configuration system based on a pyproject.toml file, as discussed in PEP517 and PEP518, among others.

268 questions
11
votes
1 answer

How does one install a setup.cfg + pyproject.toml python project in editable mode with pip?

Is it possible to halve your cake and eat it too: can one install (via some mechanism) a project with the following structure: pyproject.toml setup.cfg src/... scripts/... In editable mode, like one could with a standard setup.py project: python3…
Chris
  • 28,822
  • 27
  • 83
  • 158
10
votes
2 answers

How to insert test-time environment variable with pytest pyproject.toml

Usually, when defining a Environment Variable for pytest using the pytest-env plugin, this is done using pytest.ini: [pytest] env = DATA_DIR = data/test_assets pytest supports pyproject.toml since 6.0. How is an Environment Variable supposed be…
Seanny123
  • 8,776
  • 13
  • 68
  • 124
10
votes
1 answer

Replacing Manifest.in with pyproject.toml

Previously, when defining how to build a Python package, you can include folders using a line in Manifest.in: recursive-include my_package/assets * However, I would like to poetry and the associated pyproject.toml, instead of Manifest.in. Can…
Seanny123
  • 8,776
  • 13
  • 68
  • 124
9
votes
1 answer

Specifying test dependencies in pyproject.toml and getting them installed with pip install -e

I have a Python project with a pyproject.toml similar to the one below. I use python build to generate an package I use to install in production environments. For development environments, I use pip install -e . I'm trying to figure out how to make…
devnectar
  • 99
  • 1
  • 3
9
votes
4 answers

ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects

I'm getting this error when trying to install PyAudio: ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects Does anyone know why this is happening and how to solve? Best
Lakeside52
  • 159
  • 1
  • 2
  • 7
9
votes
2 answers

setuptools pyproject.toml equivalent to `python setup.py clean --all`

I'm migrating from setup.py to pyproject.toml. The commands to install my package appear to be the same, but I can't find what the pyproject.toml command for cleaning up build artifacts is. What is the equivalent to python setup.py clean --all?
ringo
  • 978
  • 7
  • 16
9
votes
1 answer

How to add optional dependencies of a library as 'extra' in poetry and pyproject.toml?

I am building a Python package using pyproject and poetry. My pyproject.toml looks like this: [tool.poetry] authors = ["test"] description = "" name = "test" version = "0.1.0" [tool.poetry.dependencies] spacy = {extras = ["cuda113"], version =…
azizbro
  • 3,069
  • 4
  • 22
  • 36
9
votes
1 answer

Pytest cov does not read pyproject.toml

Pytest cov is not reading its setting from the pyproject.toml file. I am using nox, so I run the test with: python3 -m nox It seems I have the same issue even without nox. In fact, after running a poetry install: poetry run pytest --cov=src passes…
user1315621
  • 3,044
  • 9
  • 42
  • 86
8
votes
1 answer

Pip pyproject.toml: Can optional dependency groups require other optional dependency groups?

I am using the latest version of pip, 23.01. I have a pyproject.toml file with dependencies and optional dependency groups (aka "extras"). To avoid redundancies and make managing optional dependency groups easier, I would like to know how to have…
James
  • 93
  • 1
  • 4
8
votes
2 answers

pyproject.toml and cython extension module

I have an existing python project that is using mostly setup.py to build the project. The project has 2 x Cython extension modules configured in setup.py. Initially I did pip install -e . for development, but since then I'm using python setup.py…
Juergen
  • 699
  • 7
  • 20
8
votes
2 answers

Distribute shell scripts using setuptools and pyproject.toml

I'm trying to distribute a shell script along with a Python package. Ideally, the shell script is installed when I run pip install my_package. I read from this SO that, my expected behavior is exactly what the scripts keyword of setuptools.setup…
8
votes
1 answer

Git versioning with setuptools in pyproject.toml

I'm trying to build a few packages with an automatic versioning set by setuptools-git-versioning. Unfortunately, even following the documentation and the very few resources online, I can manage to make this versioning…
HCKRMVT
  • 355
  • 3
  • 10
8
votes
1 answer

Poetry add/install using ssh+git fails

I am trying to add depedency from git to poetry using SSH ( I am not interested in HTTPS version). The but I get an error whether I use poetry add... poetry add git+ssh://git@github.com:myorg/myproj.git ...or if I add it manually... # Entry in…
Zerg Overmind
  • 955
  • 2
  • 14
  • 28
8
votes
1 answer

How do I read project dependencies from pyproject.toml from my setup.py, to avoid duplicating the information in both files?

We're upgrading to use BeeWare's Briefcase 0.3.1 for packaging, which uses pyproject.toml instead of setup.py to specify how to package, including which dependencies to include in a package. Here's a minimal example of a pyproject.toml for…
Dybber
  • 113
  • 1
  • 7
7
votes
1 answer

Single source of truth for Python project version in presence of pyproject.toml

The pyproject.toml specification affords the ability to specify the project version, e.g. [project] name = "foo" version = "0.0.1" However, it is also a common Python idiom to put __version__ = "0.0.1" in foo/__init__.py so that users can query…
user14717
  • 4,757
  • 2
  • 44
  • 68
1 2
3
17 18