mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Fix installation of packages in Poetry which requires "==*" to not auto-pin
This commit is contained in:
parent
8fbb96dbff
commit
2c471cfbe7
2 changed files with 11 additions and 5 deletions
|
@ -189,9 +189,15 @@ for scenario in data["scenarios"]:
|
|||
for scenario in data["scenarios"]:
|
||||
requires_packages = scenario["root"]["requires_packages"] = []
|
||||
for requirement in scenario["root"]["requires"]:
|
||||
package = packaging.requirements.Requirement(requirement).name
|
||||
parsed = packaging.requirements.Requirement(requirement)
|
||||
requires_packages.append(
|
||||
{"package": package, "package_module": package.replace("-", "_")}
|
||||
{
|
||||
"package": parsed.name,
|
||||
"package_module": parsed.name.replace("-", "_"),
|
||||
"specifier": (
|
||||
str(parsed.specifier) if len(parsed.specifier) > 0 else "==*"
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -133,9 +133,9 @@ echo "" >> "$SCENARIO_OUTPUT"
|
|||
echo '```' >> "$SCENARIO_OUTPUT"
|
||||
VIRTUAL_ENV=$VENV \
|
||||
run poetry --directory="$PROJECT" add \
|
||||
{{#root.requires}}
|
||||
"{{prefix}}-{{.}}" \
|
||||
{{/root.requires}}
|
||||
{{#root.requires_packages}}
|
||||
"{{prefix}}-{{package}}{{specifier}}" \
|
||||
{{/root.requires_packages}}
|
||||
{{#environment.prereleases}}
|
||||
--allow-prereleases
|
||||
{{/environment.prereleases}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue