Skip to content
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

make virtual-environment does not work with new version of poetry #63

Closed
Ida-droid opened this issue Jan 15, 2025 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@Ida-droid
Copy link

The problem

@aethr aethr self-assigned this Jan 15, 2025
@aethr
Copy link
Contributor

aethr commented Jan 15, 2025

Thanks for the bug report @Ida-droid.

I've verified that make virtual-environment works on poetry v1.8.3 but not on poetry v2.x:

$ poetry --version
Poetry (version 1.8.3)

$ make virtual-environment
poetry lock --no-update
The currently activated Python version 3.12.3 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version.
Using python3.11 (3.11.11)
Creating virtualenv openmethane-prior in /home/linds/TSI/test/openmethane-prior/.venv
Resolving dependencies... (0.2s)
# Put virtual environments in the project
poetry config virtualenvs.in-project true
poetry install --all-extras
Installing dependencies from lock file

Package operations: 51 installs, 0 updates, 0 removals

  - Installing certifi (2024.8.30)
... lines elided ...
  - Installing towncrier (24.8.0)

Installing the current project: openmethane_prior (0.3.1a0)
# TODO: Add last line back in when pre-commit is set up
# poetry run pre-commit install

$ pipx upgrade poetry

$ poetry --version
Poetry (version 2.0.1)

$ make virtual-environment
poetry lock --no-update
The currently activated Python version 3.12.3 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version.
Using python3.11 (3.11.11)
Creating virtualenv openmethane-prior in /home/linds/TSI/test/openmethane-prior/.venv

The option "--no-update" does not exist
make: *** [Makefile:7: virtual-environment] Error 1

@aethr
Copy link
Contributor

aethr commented Jan 15, 2025

It appears as though there are a number of changes from poetry v1 to v2, including changing poetry lock command to use the --no-update behaviour as the default.

Unfortunately, since poetry is installed globally, it's tricky for us to update openmethane-prior to be compatible with v2 without updating all of our other projects at the same time. Furthermore, there appears to be a severe (exponential) performance regression in dependency resolution in poetry v2: python-poetry/poetry#9956

Once the performance issue is fixed, we can re-evaluate if it's ready to migrate to. When it is, I'll open issues in the other repos and coordinate with @prayner to get our projects updated to poetry v2.

In the meantime, I'd advise downgrading your poetry version using pip: pipx install poetry~=1.0 --force

@aethr aethr added enhancement New feature or request and removed triage labels Jan 15, 2025
@Ida-droid
Copy link
Author

Ok,

thank you very much for your detailed comment.

I suggest adding this information in README under the topic
Installation
To get started, you will need to make sure that poetry version v1 is installed
(to force this use the command: pipx install poetry~=10 --force). The Open Methane prior can be installed from source into a virtual environment with: ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants