mirror of https://github.com/astral-sh/uv
Benchmarks: Add extras to poetry (#6247)
Previously, we had dropped extras from the requirements when converting to poetry, skewing the results towards poetry for the `apache-airflow[all]` benchmark.
This commit is contained in:
parent
6dc05a3598
commit
422730d516
|
|
@ -374,14 +374,13 @@ class Poetry(Suite):
|
||||||
pyproject = tomli.load(fp)
|
pyproject = tomli.load(fp)
|
||||||
|
|
||||||
# Add the dependencies to the pyproject.toml.
|
# Add the dependencies to the pyproject.toml.
|
||||||
pyproject["tool"]["poetry"]["dependencies"].update(
|
for requirement in requirements:
|
||||||
{
|
version = str(requirement.specifier) if requirement.specifier else "*"
|
||||||
str(requirement.name): str(requirement.specifier)
|
if requirement.extras:
|
||||||
if requirement.specifier
|
entry = {"version": version, "extras": sorted(requirement.extras)}
|
||||||
else "*"
|
else:
|
||||||
for requirement in requirements
|
entry = version
|
||||||
}
|
pyproject["tool"]["poetry"]["dependencies"][requirement.name] = entry
|
||||||
)
|
|
||||||
|
|
||||||
with open(os.path.join(cwd, "pyproject.toml"), "wb") as fp:
|
with open(os.path.join(cwd, "pyproject.toml"), "wb") as fp:
|
||||||
tomli_w.dump(pyproject, fp)
|
tomli_w.dump(pyproject, fp)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue