question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outdated metadata after version bump for local package

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Ubuntu 18.04.1

  • Poetry version: 1.1.4

  • Python version: I tested this in the following python environments:

    • 3.7.5 (using importlib_metadata)
    • 3.8.0
    • 3.8.6
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

When I build and install my package, bump the version, then build and install again, the metadata of the package is not always showing the right version, but an older version number. It works for the first version bump, but fails for further.

I am not sure whether this is doe to the way poetry installs the package, or whether this is a bug in importlib.

Step 1: Bump the version

$ poetry version patch
Bumping version from 0.1.1 to 0.1.2

Step 2: Build and install the package

$ poetry install -vvv --no-dev
...
Installing the current project: pi (0.1.2)
  - Building package pi in editable mode
  - Adding pi.pth to /tmp/test/folder/env/lib/python3.8/site-packages for /tmp/test/folder
  - Adding the pi-0.1.2.dist-info directory to /tmp/test/folder/env/lib/python3.8/site-packages

Step 3: Check the metadata

$ python -c "from importlib.metadata import version; print(version('pi'))"
0.1.1

This should be 0.1.2, not 0.1.1.

To reproduce this, please have a look at the gist.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
peldszuscommented, Apr 13, 2021

Looks like #3900 will fix this.

1reaction
sinoroccommented, Oct 27, 2020

@peldszus Looks to me like this piece of code would delete a pre-existing dist-info for the exact same version number. It does not seem to be looking for dist-info with different version numbers (lower or higher).

Read more comments on GitHub >

github_iconTop Results From Across the Web

7. Releasing and versioning - Python Packages
While we'll discuss the full workflow for releasing a new version of your package in Section 7.3, we first want to dicuss version...
Read more >
Standard way to embed version into Python package?
It provides the standard metadata version. Therefore it will be detected by pkg_resources or other tools that parse the package metadata (EGG-INFO and/or ......
Read more >
Should You Use Upper Bound Version Constraints?
Basically, a “perfect” SemVer library would pretty much always bump the major version, since you almost always could possibly break a user ...
Read more >
How to manage application dependencies with Bundler
To check Bundler version simply run bundle -v . ... Gemfile.lock; Executing Commands - bundle exec; Updating Gems - bundle outdated and bundle...
Read more >
Commands | Documentation | Poetry - Python dependency ...
--dependency : Package to require with a version constraint. ... If there is no poetry.lock file, Poetry will create one after dependency resolution....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found