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:
pyproject.toml file structure and use a tool.poetry section in pyproject.lock.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.
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?
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?