-
Notifications
You must be signed in to change notification settings - Fork 183
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
MAINT: Work around for pyproject / poetry / pip #1261
Conversation
elif has_file('poetry.lock'): | ||
cmd = [ | ||
"python -mpip install poetry", | ||
"poetry install", | ||
"poetry build --format wheel --output {build_cache_dir}" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as the build-backend
is specified in pyproject.toml
, then pip install
should use poetry
or pdm
or whatever other backend, right? Or does that not respect .lock
files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that poetry
and pdm
are usually installed system-wide (at the user level with their own install scripts) and not always part of the requirements.txt
. This is problematic because some projects use pdm
or poetry
for dependencies / development / tool management but still have setuptools
as the build backend, which leads to errors, since asv
doesn't pick up pdm
or poetry
from system-wide installs.
One way around this is to add logic in asv
to look for pdm
and poetry
but this seemed less invasive.
Let's go with this now, and as the ecosystem matures we may be able to improve upon it in the future. |
Thanks @HaoZeke |
cmd = [ | ||
"python -mpip install poetry", | ||
"poetry install", | ||
"poetry build --format wheel --output {build_cache_dir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting an error when running with poetry and python 3.10, The option "--output" does not exist
, when either setting the build command in asv.conf.json or running this branch directly without a build command specified in the config. I don't see the --output
option specified anywhere in poetry's (or pdm's) docs for the build command. Where does that option come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to be passed build
transparently at some point, however currently pending python-poetry/poetry#7208 this needs to be reworked. Great catch!
Seems restrictive to force users to have a
setup.py
by default. Closes #1241. Probably also closes #903.