mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
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
1 changed files with 7 additions and 8 deletions
|
@ -374,14 +374,13 @@ class Poetry(Suite):
|
|||
pyproject = tomli.load(fp)
|
||||
|
||||
# Add the dependencies to the pyproject.toml.
|
||||
pyproject["tool"]["poetry"]["dependencies"].update(
|
||||
{
|
||||
str(requirement.name): str(requirement.specifier)
|
||||
if requirement.specifier
|
||||
else "*"
|
||||
for requirement in requirements
|
||||
}
|
||||
)
|
||||
for requirement in requirements:
|
||||
version = str(requirement.specifier) if requirement.specifier else "*"
|
||||
if requirement.extras:
|
||||
entry = {"version": version, "extras": sorted(requirement.extras)}
|
||||
else:
|
||||
entry = version
|
||||
pyproject["tool"]["poetry"]["dependencies"][requirement.name] = entry
|
||||
|
||||
with open(os.path.join(cwd, "pyproject.toml"), "wb") as fp:
|
||||
tomli_w.dump(pyproject, fp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue