PEP 751: lock files (again)

Assuming that you’re tying in platform details for e.g., “dev server” and “production”, then that makes sense. At that point you’re just expanding what an “environment” is, and thus why you made your “resolved environments” terminology suggestion.

That would be one way of doing it.

That’s what I’m trying to propose with PEP 751: lock files (again) - #81 by brettcannon.

I’m a little concerned of the impact on auditing as you now have to reference another file to get a complete view of what would be installed (and even assuming the installation would work).

I would not be opposed to a “SHOULD” line about where to put the files to help guide users towards common directory locations outside of the root of the project.

All file-locks.wheel-tags does is say, “you need the environment you’re installing into to have equivalent support of these tags”. It doesn’t require you use those tags in some way. But I assume it would be used to list the wheel tags used. But it could be the wheel tags used in your locked build requirements for your sdists, for instance.

Potentially. The trick is if you’re thinking of having a separate list of files/hashes to condense the details of the environment then you have to come up with a way to reference things like sdists w/ locked build requirements, VCS checkouts, etc. You can probably do it with an array of tables with critical keys specifying file, vcs, etc. and then the package version being referenced.

Or you say only wheel files are supported for file locking and if you want sdists you have to use package locking. :grin: (From a security standpoint that would the best approach, but considering what happened to me with PEP 665, I’m a little scared to propose that).

That’s the miracle I’m hoping for. :sweat_smile:

PEP 751: lock files (again) - #81 by brettcannon was trying to do that.

I actually have not gotten that impression.

I’m starting to end up in that line of thinking if sticking with file locking is the way to go, then it either needs to be its own thing or stem from package locking in a nice way instead of the other way around (which is how these topics evolved).

I can’t because I don’t have a solution yet. :sweat_smile: I have some thoughts, but they haven’t solidified enough to show yet, especially if the format might fluctuate more heavily into file locking or package locking specifically.

The tricky bit with the whole extras thing is when the resolve varies w/ or w/o a certain extra being present (and this is even considering it being different per platform). This instantly shows me the appeal of what you’ve suggested you’re doing with uv.lock and doing edges from package to package and there’s a consistent package version for all scenarios; not having to care about which package version to pull in is a very nice simplification. But Paul pointed out how he didn’t expect that behaviour and would want different package versions if called for if the extras influenced things that way. Toss in different versions for different platforms or varying requirements per file and it isn’t so simple to write down in a readable, compact form.

But I have an idea around package locking that takes what you seem to be asking for based on uv.lock where package locking is the overall format, and adds in stuff @steve.dower and @ncoghlan suggested that acts like extra bookkeeping on top of that instead of an entirely separate format in the same file (and thus would make @DanCardin happy :wink:). But since I just came up with this idea while writing this reply I will have to mull it over on the weekend to see if it solidifies into something worth mentioning here.

2 Likes