-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support requirements in pyproject.toml #12100
Comments
Duplicate of #8049 #11584 and others. This seems to be a common long standing request. Originally I had this question too, following DRY it seemed like duplication to copy simple requirements to 2 places (pyproject build for other packages, install for my packages). If not updating the pip project,, it would be good to update documentation/FAQ to identify some methods of using pyproject.toml as the base for compiling and installing requirements based on minimum requirements, and why you may not want to do that and handle them with other methods. python -m pip install --build -r pyproject could generate a transitory requirements.txt based on pyproject.toml? pip-tools and poetry and other tools have this option, it's up to the developer to combine and implement them. https://python-poetry.org/docs/1.4/faq/#why-are-unbound-version-constraints-a-bad-idea Does it make more sense to maintain a requirements.in rather than requirements.txt? |
Thank you for linking the related issues. In my use case I do not want to install my project as a python package at all. a) Switching from pip to hatch, poetry etc. might be an option for me. However, those tools are not included by default and would need to be extra installed. See for example => I would prefer to use the standard pip tool... supporting pyproject.toml as alternative to requirements.txt. (Furthermore, poetry is not portable but stores an absolute path to python.exe. ) b) The referenced links seem to suggest special options, e. g. My suggestion here is to use
Currently that command gives the answer
When using Similarly, I would expect |
Just found out, that as a workaround I could use
for what I want. In addition to the dependencies, It requires a name and a version to be specified in pyproject.toml:
|
@stefaneidelloth if editables work for you, I think that is the best solution at this point in time. I'm going to close this issue, as it is amply discussed in #11440. |
Is there a way to disable the creation of the egg file inside my src folder or automatically delete it when using
? |
The egg directory is created by the build backend you use (probably setuptools, most backends I know of don’t do that), and you’d want to talk to them about this instead. |
Thank you. The default build backend that is used if I don't specify one, seems to be setuptools. And setuptools creates the unwanted egg file. I would prefer if a "none" backend is used by default, only installing dependencies. I switched to [build-system] |
The statement |
What's the problem this feature will solve?
I would prefer to put requirements in
pyproject.toml
instead of using an extra configuration filerequirements.txt
.=> Central configuration file
Are there plans to support this in future versions of pip? If not, what speaks against it?
Describe the solution you'd like
Support a command
pip install
(would parallel syntax ofnpm install
)that looks up requirements from
pyproject.toml
and installs them.If possible. the syntax for dependencies inside pyproject.toml should be compatible to the one used by hatch (and or poetry):
https://hatch.pypa.io/latest/config/dependency/
https://peps.python.org/pep-0631/
https://python-poetry.org/docs/pyproject#dependencies-and-dependency-groups
Alternative Solutions
pip install -r pyproject.toml
pip install -e .[dev]
Additional context
https://stackoverflow.com/questions/74508024/is-requirements-txt-still-needed-when-using-pyproject-toml
https://hatch.pypa.io/latest/config/dependency/
https://python-poetry.org/docs/pyproject#dependencies-and-dependency-groups
Code of Conduct
The text was updated successfully, but these errors were encountered: