-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Recursive extra dependencies don't work for a private package #1685
Comments
It seems pip-tools compile does not source the dependencies from the current |
Please add the |
The above pyproject.toml file was used to get the error message (=no build-system set). In my project I use the following:
|
Wait, is your project an actual Python package? Like do you install it with Because 100% of my work projects don't exist on PyPI, but they must be proper packages if you want to use packaging-based tools. |
Yes, I do install it and it works. That is what I meant by:
Since pip does install my package I figured pip-tools could be able compile the dependencies. Then I just trimmed the pyproject.toml to cut the parts not related with the issue while still getting the same error message while compiling. The result might no longer be installable by pip, I haven't checked that. |
Self-dependencies are not supported by pip-tools for now. Fun fact: the feature was unintentionally added in
|
I think it would be a really nice feature to add for packages (ie.not apps) that want to pin their dependencies for CI stability but don't want to use poetry. Are there technical hurdles or is it a matter of someone finding time to do it? |
Yeah, the latter one. |
In pip it works because pip can detect that '.[dev]' contains a path, so it makes InstallRequirement with Link, and then the backtracking resolver makes from this InstallRequirement a LinkCandidate.... package_name = metadata.get_all('Name')[0]
comes_from = f"{metadata.get_all('Name')[0]} ({src_file})"
def _f(req):
if package_name in req:
req = req.replace(package_name, ".")
return install_req_from_line(req, comes_from)
constraints.extend(
[
_f(req)
for req in metadata.get_all("Requires-Dist") or []
]
) and it will produce this output
@atugushev what do you think? |
@q0w looks good to me. |
+1 on this issue! I want to switch from |
Awesome thank you! |
Thank you! |
Installing private package (=package not published on pypi) is possible with pip using
pip install -e .[dev]
. It respects extra dependencies and the extra dependencies can even reference themselves (see the example bellow). However compiling such a project to getrequirements.txt
fails.Environment Versions
$ python -V
: Python 3.8.0$ pip --version
: pip 22.2.2$ pip-compile --version
: version 6.8.0Steps to replicate
Minimal pyproject.toml:
pyproject.toml
python -m piptools compile --extra dev pyproject.toml
Expected result
The
requirements.txt
is generated containingtomli
andpep517
.Actual result
The text was updated successfully, but these errors were encountered: