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

[Development Issue] Poetry Lock File Compatibility Between Versions 1.8.x and 2.0.x #7315

Open
snickerjp opened this issue Feb 9, 2025 · 0 comments

Comments

@snickerjp
Copy link
Member

snickerjp commented Feb 9, 2025

Technical details:

  • OS: Debian 12
    cat /etc/issue
    Debian GNU/Linux 12 \n \l
  • Python: 3.10.16
    python --version
    Python 3.10.16
  • Poetry: 2.0.1
    poetry --version
    Poetry (version 2.0.1)

Issue

Following the local development setup guide, running poetry install in the development environment results in an error:

$ poetry install --only main,all_ds,dev

The Poetry configuration is invalid:
  - project must contain ['name'] properties

Cause

Starting from Poetry 2.0, the name field is now required in pyproject.toml (related PR).
Since Redash's pyproject.toml does not include a name, poetry install fails.

Steps to Reproduce

  1. Add name to pyproject.toml
    [project]
    + name = "redash"
    requires-python = ">=3.8"
  2. Run poetry install again
    $ poetry install --only main,all_ds,dev
    Installing dependencies from lock file
    
    pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock` to fix the lock file.
    
    $ poetry lock
    Resolving dependencies... (2.5s)
    
    Writing lock file
    
    $ poetry install --only main,all_ds,dev
    Installing dependencies from lock file
    
    Package operations: 0 installs, 1 update, 0 removals
    
      - Downgrading packaging (24.2 -> 23.2)
    
    Installing the current project: redash (25.02.0-dev)
  3. Downgrade Poetry to version 1.8.5
    $ poetry --version
    Poetry (version 1.8.5)
    
    $ poetry install --only main,all_ds,dev
    Installing dependencies from lock file
    The lock file might not be compatible with the current version of Poetry.
    Upgrade Poetry to ensure the lock file is read properly or, alternatively, regenerate the lock file with the `poetry lock` command.
    
    pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file.
  4. After running poetry lock --no-update, poetry install works again.

Problem

  • poetry.lock is not compatible between Poetry 1.8.x and 2.0.x in a development environment.
  • If team members use different versions, they must frequently run poetry lock --no-update or similar commands to resolve issues.

Expected Behavior

  • We would like to know if there is a way to maintain compatibility between Poetry 1.8.x and 2.0.x lock files.
  • Alternatively, clearer guidance on which Poetry version should be used would be helpful.

Additional Information

We are looking for advice on whether to continue using Poetry 1.8.5 or migrate fully to Poetry 2.0.1.

Reference

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

No branches or pull requests

1 participant