# PEP 751: lock files (again)

**URL:** <https://discuss.python.org/t/pep-751-lock-files-again/59173>\
**Category:** Standards\
**Created:** [July 25, 2024, 6:51pm UTC](https://discuss.python.org/t/pep-751-lock-files-again/59173 "2024-07-25T18:51:17Z")\
**Posts on this page:** 1\
**Showing post:** 33

<div class="post-metadata">

**Author:** ![DanCardin](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dancardin/32/16441_2.png) [@DanCardin](https://discuss.python.org/u/DanCardin)\
**Post date:** [July 27, 2024, 12:25am UTC](https://discuss.python.org/t/pep-751-lock-files-again/59173/33 "2024-07-27T00:25:17Z")

</div>

> [@brettcannon](#):
>
> But baked in _how_? I think you’re assuming `pyproject.toml` is always the input and thus you have a singular concept of what the potential extras are because they are coming from `project.optional-dependencies`. But the PEP is written such that the input could be anything as not every Python project has a `pyproject.toml` file, nor uses a `[project]` table.

(obviously whatever poetry/pdm/uv are already doing is going to be more well thought out than my example solution, but for example…)

I dont see why this would imply a pyproject.toml necessarily, so long as the information about the set of groups/extras is included in the lockfile. Record the groups at the top level of the file (generalizing across dependency groups and extras, which should be the same as far as installation goes), and then record a `groups: ["foo", "bar"]` per dependency that belongs to those groups (if that dependency is not already required outside groups).

An installer with no concept of this feature, like you mention, is simply the same as a no-extras scenario, i.e. install only dependencies with no groups. An installer with the ability to select for extras/groups, given some set of groups (maybe check that the groups are valid and…) would install a dependency if at least one dependency’s `groups` matches the groups provided.

It doesn’t seem obvious to me how this concept is any different than any of the static environmental markers. Some `python_version==3.9` in the lockfile is really just the same thing as if someone supplied a `python39` extra, as far as the comparative installation behavior goes…beyond the fact that `python_version` involves math and applies to transitive dependencies, whereas extras/groups do neither.

If nothing else, I feel like it should be explicit in the PEP about how/why extras/groups are not important, or how they can be punted and backwards compatibly standardized later

---

_[View the full topic](https://discuss.python.org/t/pep-751-lock-files-again/59173)._
