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

Created on 20 Sep 2018  路  7Comments  路  Source: python-poetry/poetry

  • [x] 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.

Feature

Most helpful comment

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

All 7 comments

Of these two options, I prefer the latter (poetry.lock) as it mirrors package.json => yarn.lock.

Are there are any PEPs working on a standardized locking format for dependencies?

@jacebrowning No there is no PEP at the moment. That was briefly discussed on Twitter but for now there is no standard specified.

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.

Why not have both files with the poetry name: poetry.toml poetry.lock? Feels a bit cleaner.

@Mokubyow pyproject.toml comes from PEP 518: https://www.python.org/dev/peps/pep-0518/

@jacebrowning Got it, thanks for sharing!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AWegnerGitHub picture AWegnerGitHub  路  3Comments

jhrmnn picture jhrmnn  路  3Comments

thejohnfreeman picture thejohnfreeman  路  3Comments

nikaro picture nikaro  路  3Comments

sobolevn picture sobolevn  路  3Comments