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
16
votes
2 answers

Questions on pyproject.toml vs setup.py

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…
uncrayon
  • 395
  • 2
  • 11
16
votes
1 answer

How to build python project based on pyproject.toml

I would like to understand current state of Python build systems and requirements management. Imagine, that I checked out sources of some project that is using poetry (or pipenv). And this project has pyproject.toml file with build system specified.…
Andrey Tatarinov
  • 530
  • 1
  • 3
  • 11
15
votes
3 answers

MyPy configuration - exclude multiple directories

We're currently using Mypy (v 0.910) in our project with pyproject.toml for configuration. I have the following file structure: src --app --generated --service --data --ingest pyproject.toml: ... [tool.mypy] python_version =…
James B
  • 447
  • 3
  • 15
14
votes
1 answer

Specifying local relative dependency in pyproject.toml

I have the following project structure: root - sample/ - src/ - tests/ - pyproject.toml - libs/ - lol/ - src/ - tests/ - pyproject.toml I'd like to specify lol as a dependency for sample in…
Opal
  • 81,889
  • 28
  • 189
  • 210
14
votes
1 answer

pytest pyproject.toml configuration to ignore a specific path

Are there any ways to set a path to ignore in pyproject.toml like #pyproject.toml [tool.pytest.ini_options] ignore = ["path/to/test"] instead of using addopts: #pyproject.toml [tool.pytest.ini_options] addopts = "--ignore=path/to/test"
Yauhen Mardan
  • 327
  • 3
  • 10
13
votes
3 answers

mypy and pyproject.toml, options only work globally

I wish to use the options disable_error_code = ["name-defined"] and ignore_missing_imports = true only for some specific modules, but I am struggling to make it work. The following is an excerpt of my non-working pyproject.toml…
Barzi2001
  • 989
  • 8
  • 24
12
votes
2 answers

What's difference between [tool.poetry] and [project] in pyproject.toml?

Context So, I'm trying to create a new Python package following this tutorial: https://packaging.python.org/en/latest/tutorials/packaging-projects/ As the tutorial says, in my pyproject.toml I should have this structure: [project] name =…
12
votes
5 answers

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

I want to install mpi4py. The installation fails with the error below. Please share the solution to the same error. note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for…
eve
  • 173
  • 1
  • 2
  • 9
12
votes
1 answer

How to build a universal wheel with pyproject.toml

This is the project directory structure . ├── meow.py └── pyproject.toml 0 directories, 2 files This is the meow.py: def main(): print("meow world") This is the pyproject.toml: [build-system] requires = ["setuptools"] build-backend =…
platypus
  • 1,128
  • 8
  • 15
11
votes
2 answers

Using environment variables in `pyproject.toml` for versioning

I am trying to migrate my package from setup.py to pyproject.toml and I am not sure how to do the dynamic versioning in the same way as before. Currently I can pass the development version using environment variables when the build is for…
Ilya
  • 730
  • 4
  • 16
11
votes
1 answer

Add private GitHub repo to pyproject.toml as new dependency

How can I define a private GitHub repo as a dependency in the project section of my pyproject.toml file? [project] dependencies = [ "my_repo_name>=" ]
Andi
  • 3,196
  • 2
  • 24
  • 44
11
votes
2 answers

How to define "python_requires" in pyproject.toml using setuptools?

Setuptools allows you to specify the minimum python version as such: from setuptools import setup [...] setup(name="my_package_name", python_requires='>3.5.2', [...] However, how can you do this with the pyproject.toml? The following…
gebbissimo
  • 2,137
  • 2
  • 25
  • 35
11
votes
2 answers

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

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…
arne
  • 4,514
  • 1
  • 28
  • 47
11
votes
3 answers

ERROR:Failed building wheel for h5pyFailed to build h5pyERROR:Could not build wheels for h5py,which is required toinstall pyproject.toml-basedprojects

I'm getting this error when I'm running the following command to install tensorflow. python3 -m pip install tensorflow-macos ERROR: Failed building wheel for h5py Failed to build h5py ERROR: Could not build wheels for h5py, which is required to…
Lakshay Rohilla
  • 1,654
  • 6
  • 9
  • 30
11
votes
1 answer

Why won't pytest use pyproject.toml for this deprecation warning

I have a django project managed with pytest and poetry. I'd like to put my pytest config into the pyproject.toml file, so I added: [tool.pytest] filterwarnings = ["ignore::django.utils.deprecation.RemovedInDjango40Warning",…
thclark
  • 4,784
  • 3
  • 39
  • 65
1
2
3
17 18