witty-crayon-22786
08/05/2021, 10:11 PMThat’s unnecessary invalidation and scanning of the repo, done every time you use Flake8 because of the upcoming lockfile invalidationthis goes back to the actual ticket, and so i can comment there. but isn’t it only necessary to invalidate if your IC is not a member of the lockfile? it’s not relevant for that run whether some other IC is missing from the lockfile.
hundreds-father-404
08/05/2021, 10:18 PMawait Get
to get the PythonLockfileRequest
, access its invalidation_digest
, and compare to what is written on disk in the lockfile (https://github.com/pantsbuild/pants/pull/12448)
We could instead store what the ICs are directly in the lockfile. Then the only thing we are missing afaict is being able to statically determine if two IC ranges are compatible are not
which gets to the comment I punted on above. Every time I have attempted to do clever things w/ ICs—like simplifying ['==3.7,==2.7', '==2.7']
to be ['==2.7']
b/c the first is impossible to satisfy—I have not been able to figure it out. All our interpreter_constraints.py
code r/n that checks for "validitity" works by iterating over every anticipated version in our Python "universe". It feels like it shouldn't be hard: as a human, I can very quickly deduce it's unsatisfiable. But I haven't been able to figure out how to automate the static analysishundreds-father-404
08/05/2021, 11:02 PMhundreds-father-404
08/06/2021, 5:34 PMhundreds-father-404
08/06/2021, 5:35 PMtyping-extensions
dep
Poetry handles this, and specifically based on what you set the python
value to. If you set it to ==3.9
, the lockfile only works w/ 3.9. If you set to >=3.7,<3.10
, it works with all those intepreters, even tho you only run it w/ one interpreter! Amazinghundreds-father-404
08/06/2021, 5:36 PMipython
depends on appnode
, but only on macOS. Regardless of if you generate lockfile on macOS vs Linux, it handles that! Amazingbusy-vase-39202
08/06/2021, 5:36 PMbusy-vase-39202
08/06/2021, 5:36 PMhundreds-father-404
08/06/2021, 5:37 PMhundreds-father-404
08/06/2021, 5:38 PMAdding Poetry support was a really good decision.Agreed! To clarify, this is a bit different. Liam's project was so that Pants can consume your
pyproject.toml
, where the user says their direct deps they care about
Here, we're talking about switching the backend that generates lockfiles for you. We were using pip-compile, and now would be using Poetry. That should be relatively agnostic to the userhundreds-father-404
08/06/2021, 5:39 PMnot sharing the caches between Pex/PoetryThis is a bummer, but also possibly something we could optimize? It seems theoretically possible for pex to learn how to consume the PyPI artifacts Poetry downloads
hundreds-father-404
08/06/2021, 5:40 PMincluding pushing back lockfile project's timeline >1 month.If we switch to Poetry, I think it becomes feasible for Pants 2.7 to finish the lockfile project this month! At least for tool lockfiles and a single user lockfile
happy-kitchen-89482
08/06/2021, 5:41 PMwitty-crayon-22786
08/06/2021, 8:48 PMinterpreter_constraints
on targets as defining an actual list, and replaced it with a reference to a name/slug defined globally:
$ cat BUILD
python_library(
interpreters='default',
)
python_library(
interpreters='unusual',
)
$ cat pants.toml
..
[python-setup]
interpreters = """{
'default': '[">=3.7,<3.10"]',
'unusual': '["==2.7.*", "==3.5.*"]',
}"""
…because then you’d have a closed universe of interpreterswitty-crayon-22786
08/06/2021, 8:48 PMhundreds-father-404
08/06/2021, 8:51 PMinterpreter_constraints
opt-in: imo, it's too easy for every day developers to accidentally use a feature they shouldn't be
(To be clear, I do still want it to be easy to use when you know that's what you want, i.e. the migration discussion yesterday. Only make it something more intentional, but still ergonomic)hundreds-father-404
08/06/2021, 9:02 PMinterpreter_constraints
using a list to OR constraints, like ['==2.7.*', '>3.6']
. Poetry needs a single constraint, and I don't know of a way to programmatically convert the list into a single valuewitty-crayon-22786
08/07/2021, 5:10 PMexperimental
backends on the docsite?hundreds-father-404
08/09/2021, 7:00 PMfast-nail-55400
08/09/2021, 8:40 PMwitty-crayon-22786
08/09/2021, 9:56 PM--jobs=1
.worried-salesclerk-37834
08/09/2021, 11:42 PMhappy-kitchen-89482
08/10/2021, 3:12 PMOptionable
class is no more. Everything has been folded into Subsystem
, and greatly simplified.witty-crayon-22786
08/10/2021, 5:50 PMancient-vegetable-10556
08/10/2021, 7:23 PMfs_test.py
(see https://github.com/pantsbuild/pants/pull/12448/checks?check_run_id=3292684957). Has anyone seen this before? (ping @witty-crayon-22786)witty-crayon-22786
08/10/2021, 8:54 PMlocal_only=True
lockfile resolve, and binaries use a local_only=False
lockfile resolve.hundreds-father-404
08/10/2021, 10:17 PMproud-dentist-22844
08/10/2021, 10:19 PMproud-dentist-22844
08/10/2021, 10:22 PMansible
(prob ansible-core
at this point, I ran into this years ago). If someone relies on ansible
, they need to record ansible
's dependencies as well as ansible
itself.proud-dentist-22844
08/10/2021, 10:25 PM