Code Monkey home page Code Monkey logo

Comments (4)

mtkennerly avatar mtkennerly commented on June 10, 2024 1

for some of the packages I'm using in a real project can add 20-30 seconds to even full-poetry-cache-hit builds

Ah, that's true, the extra time is unfortunate.

I can't think of a good solution to this offhand, but if you do investigate further, I'd be interested to hear what you come up with!

from poetry-dynamic-versioning.

mtkennerly avatar mtkennerly commented on June 10, 2024

Hi! Thanks for the kind words :)

I think this is just a cosmetic issue in poetry install, presumably because it reports the static version in pyproject.toml first before running the build code that updates the version. The right version will still be present in the venv managed by Poetry:

$ poetry install
Creating virtualenv fake-project in C:\tmp\issue154\.venv
Updating dependencies
Resolving dependencies... (1.2s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing dummy-python-project (0.0.999 d3a036f)

$ . .venv/Scripts/activate

$ pip list | grep dummy
dummy-python-project 0.1.0.post8.dev0+d3a036f

from poetry-dynamic-versioning.

rusnyder avatar rusnyder commented on June 10, 2024

@mtkennerly Holy cow what a fast reply!

I think this is just a cosmetic issue in poetry install, presumably because it reports the static version in pyproject.toml first before running the build code that updates the version. The right version will still be present in the venv managed by Poetry

You're absolutely correct in that ultimately the right version is exposed both by pip (from your example) and programmatically:

$ poetry run python -c 'import pkg_resources; print(pkg_resources.get_distribution("dummy-python-project").version)'
0.1.0.post8.dev0+d3a036f

The issue is that subsequent poetry install calls think it's a version change, and will "downgrade" (i.e. - reinstall) the package (which isn't the end of the world, but for some of the packages I'm using in a real project can add 20-30 seconds to even full-poetry-cache-hit builds):

$ poetry install -vvv
Using virtualenv: /Users/rusnyder/Library/Caches/pypoetry-arm64/virtualenvs/fake-project-GaTXRtqa-py3.8
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 0 installs, 1 update, 0 removals

  • Downgrading dummy-python-project (0.1.0.post8.dev0+d3a036f d3a036f -> 0.0.999 d3a036f): Pending...
  • Downgrading dummy-python-project (0.1.0.post8.dev0+d3a036f d3a036f -> 0.0.999 d3a036f): Installing...
  • Downgrading dummy-python-project (0.1.0.post8.dev0+d3a036f d3a036f -> 0.0.999 d3a036f)

Ideally subsequent poetry install calls would recognize the dynamic version of the installed package and not reinstall it.

I don't imagine this is an issue with this plugin, rather with poetry itself, so if you don't have any intuition around what might be happening I can do a little digging, just figured I'd check here first!

from poetry-dynamic-versioning.

rusnyder avatar rusnyder commented on June 10, 2024

Sounds good! I'll go ahead and close this for now, and circle back with either an "AHA!" or "Bummer..." when I get back around to digging in.

Thanks for taking a look!

from poetry-dynamic-versioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.