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.

Rename the lock file from pyproject.lock to poetry.lock

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

Issue

As mentionned in #347, pyproject.lock is a generic name derived from pyproject.toml which is a file that can hold information from various other projects and, as such, is not specific to Poetry.

So, there is two options here:

  • Replicate the pyproject.toml file structure and use a tool.poetry section in pyproject.lock.
  • Use an exclusive lock file: poetry.lock.

I think the second option is the best one: it makes it much clearer where the lock file is coming and avoids potential confusion.

The implementation should make sure to fallback on pyproject.lock if it can’t find poetry.lock. This way it will help the migration without end user intervention.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
prokhercommented, Oct 24, 2018

It seems to be done in Poetry 0.12.4, am I right? If so then why is this issue still open?

3reactions
jacebrowningcommented, Sep 20, 2018

I guess there sort of is a standard: requirements.txt 😬


Allow me to propose a (really bad) 3rd option. What if Poetry’s lock file was requirements.txt with the top lines valid input to pip and the rest a large comment block of Poetry metadata to be parsed as TOML by poetry:

appdirs==1.4.3
appnope==0.0.1

##########
# Poetry #
##########
# [[package]]
# category = "dev"
# description = "A small Python module for determining appropriate platform-specific # dirs, e.g. a \"user data dir\"."
# name = "appdirs"
# optional = false
# platform = "*"
# python-versions = "*"
# version = "1.4.3"
# 
# [[package]]
# category = "dev"
# name = "appnope"
# ...
#
# [package.dependencies]
# lazy-object-proxy = "*"
# six = "*"
# wrapt = "*"
#
# [metadata]
# content-hash = "49be6e1dd642a48daad490edc2cd80bd02dd095b8e861432b87aa9330f97af06"
# platform = "*"
# python-versions = "^3.7"
# ...

The main benefit here is that it will work with countless platforms that install from requirements.txt by default and it’s not really a “new” format.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic usage | Documentation | Poetry - Python dependency ...
As mentioned above, the poetry.lock file prevents you from automatically getting the latest versions of your dependencies. To update to the latest versions,...
Read more >
python - How to update Poetry's lock file without upgrading ...
There is a specific option for the lock command: poetry lock --no-update. This makes it possible to remove a dependency from pyproject.toml ...
Read more >
poetry-lock-package - PyPI
Poetry lock package generator. Simple script that will take a pyproject.toml and a poetry.lock and generate a new poetry project where all the...
Read more >
Multiple lockfiles in Python repos - Pantsbuild Blog
A lockfile pins every dependency your project installs, including both your direct dependencies and their own dependencies, ...
Read more >
Poetry - The Blue Book
lock : If there is already a poetry.lock file as well as a pyproject.toml , poetry resolves and installs all dependencies that you...
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