-
Notifications
You must be signed in to change notification settings - Fork 899
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
bug: Overriding self as workspace (to remove constraints on self from dependencies) prevents uv from installing dev-deps #10121
Comments
I honestly don't know if what you're doing here should work. I don't know if a package should be able to override itself. |
I think I have some idea of what's going wrong here though. |
I don't know either! But I mean... why not? We have this escape hatch for dependencies, so when the project itself is a dependency of a dependency, we should be able to override it too 🤷 I override self because that's the only thing I can do here, but this could be called differently, and done differently by uv, something like --if-the-only-conflict-is-on-my-project-install-it-anyway 😂 |
I think there is a bug here, which we'll fix, I'm just not sure I want to call this officially supported :D |
Understood 😄 🤞 |
I'm actually surprised I'm the only one reporting this. Must be the combo self-cyclic-dep + dynamic-version + no-tags 😅 |
I think it's specifically about overriding a workspace member that has dependency groups. |
I think it's just super uncommon to use an override with a workspace member? |
Probably. That's just the only way I get to fix this issue 😕 The ideal solution would require of level of communication between the frontend and the backend that is not currently possible:
|
I could definitely just document in my CONTRIBUTING files that contributors must pull tags, but that's equally weird IMO, I've never seen any such requirement 😅 Not hard per-se, just unusual for contributors. git clone ...; cd ...
git remote add upstream https://...
git pull upstream --tags Heh, maybe I could put these into my |
Honestly, feel free to close and reconsider if more people chime in. I've bothered you enough with this 🙇 |
Hey Charlie, I found my brain and crafted a pdm-backend solution instead: [tool.pdm.version]
source = "call"
getter = "scripts.get_version:get_version" # scripts/get_version.py
import re
from pathlib import Path
from pdm.backend.hooks.version import Version, SCMVersion, get_version_from_scm, default_version_formatter
_root = Path(__file__).parent.parent
_changelog = _root / "CHANGELOG.md"
_changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
_default_scm_version = SCMVersion(Version("0.0.0"), None, False, None, None)
def get_version():
scm_version = get_version_from_scm(_root) or _default_scm_version
if scm_version.version <= Version("0.1"): # Missing Git tags?
if _changelog.exists():
with _changelog.open() as file:
for line in file:
if match := _changelog_version_re.match(line):
scm_version = scm_version._replace(version=Version(match.group(1)))
break
return default_version_formatter(scm_version) Basically, it's dynamic versioning based on SCM + falling back onto grepping the CHANGELOG.md file. I will let you close this since you mentioned you found an issue, but consider this resolved on my end 🙂 Thank you so much for your patience, your kind responses, and your help 💟 |
Follow-up of #8148.
When I tested the solution to #8148 by installing uv from sources, running
uv sync
in https://github.com/pawamoy-forks/repro-uv-8148-a was correctly installing the development dependencies, i.e.repro-uv-8148-b
.I just upgraded from my version installed from sources (0.5.4+) to uv 0.5.11, and dev-deps aren't installed anymore.
To reproduce:
Observe that the development dependency
repro-uv-8148-b
was not installed in.venv
.Logs:
This behavior started in 0.5.7.
Related:
Possibly related:
The text was updated successfully, but these errors were encountered: