Closed hauntsaninja closed 5 months ago
Plz use pathlib everywhere instead of low-level os calls.
Sure, was just matching style to preexisting code
Just to be explicit: atugushev suggested I don't work on this PR until https://github.com/jazzband/pip-tools/pull/1681 is merged. This makes sense to me, since the two conflict.
Hey @hauntsaninja, that PR was merged about a month ago. So it seems like this one can be considered unblocked.
Thanks for the nudge, I've rebased the changes on top of main
Ah, I was just cleaning up the old notification emails and noticed this..
Since this looks up the [build-system]
section, I think @apljungquist should be invited to review too.
Could you also include more information regarding the motivation, use case, possible side effects, usage examples etc. into the PR description? Make sure all of those are also present as tests.
Oh, and it looks like the contributor checklist might've been overlooked, could you verify?
Thanks for the initial review! I pushed a bunch of changes; this should now be much closer to shippable
@webknjaz Could you review again? This is a larger change, so I wouldn't like to merge this on my own.
Thank you for the reviews!
Thanks, I was about to suggest the same! Could you rebase properly?
fixed the test and ungoofed the git!
Great, thank you for the contribution!
Just as a heads up, since we struggle with a similar thing in uv, I think this will error on Hatch projects that use Hatch's context formatting. Here's an example: https://github.com/astral-sh/uv/blob/ae35a215c67a161e759769b832b99740f4ecad69/scripts/packages/root_editable/pyproject.toml.
If I run from main
, I get:
❯ pip-compile ../uv/scripts/packages/root_editable/pyproject.toml
Traceback (most recent call last):
File "/Users/crmarsh/workspace/pip-tools/.venv/bin/pip-compile", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/piptools/scripts/compile.py", line 365, in cli
metadata = build_project_metadata(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/piptools/build.py", line 155, in build_project_metadata
project_metadata = maybe_statically_parse_project_metadata(src_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/piptools/build.py", line 92, in maybe_statically_parse_project_metadata
InstallRequirement(Requirement(req), comes_from)
^^^^^^^^^^^^^^^^
File "/Users/crmarsh/workspace/pip-tools/.venv/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py", line 117, in __init__
raise InvalidRequirement(f"Invalid URL: {req.url}")
pip._vendor.packaging.requirements.InvalidRequirement: Invalid URL: {root:uri}/../black_editable
Hmm that's a violation of standards. It should probably declare dependencies as dynamic
, or not use PEP 621
Yeah, there's a discussion on it here if you'd like to chime in: https://github.com/pypa/hatch/issues/1331
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.