I also wonder about moving the scripts/generate_co...
# general
p
I also wonder about moving the scripts/generate_constraints.sh logic into a pants plugin so that ./pants is the entry point for all development tasks.
h
This should be addressed by the upcoming per-tool lockfile and multiple lockfile work, where Pants will autogenerate the lockfile for you The status quo is subpar
1
e
... and note that the status quo is incorrect if your repo has interpreter constraints that span a range. For example, even in the Pants repo, our lockfile (constraints file) is wrong unless its generated with python3.7 since only 3.7 depends on zipp and ... I forget the other and not 3.8 and 3.9 which we also support.
👍 1
Currently our checked in lockfile is wrong this way.
p
hmm. can lock files have "; python_version = " constraints similar to requirements.txt?
e
I think constraints files can have environment markers even under latest Pip IIUC.
h
The proposed lockfile format we'll use is a requirements.txt format. constraints.txt is super limited like not supporting VCS requirements properly. So, the new format will indeed support interpreter markers like that Then we'll use a Pex setting to avoid resolving transitive dependencies, i.e. ensure the lockfile is comprehensive
I think constraints files
I don't think so iirc, but either way, constraints.txt have too many other limitations to be used
e
... for the feature. I'm pretty darn sure the question is about fixing the bug I pointed out with our rec. solution today.
1
Yeah, I just added an env marker by hand and it works fine:
Copy code
$ git diff
diff --git a/3rdparty/python/constraints.txt b/3rdparty/python/constraints.txt
index dd3cc22e7..e746bfe3c 100644
--- a/3rdparty/python/constraints.txt
+++ b/3rdparty/python/constraints.txt
@@ -34,4 +34,4 @@ six==1.15.0
 toml==0.10.2
 typed-ast==1.4.3
 typing-extensions==3.7.4.3
-urllib3==1.26.4
+urllib3==1.26.4; python_version >= "3.7"
So you can hand edit a constraints.txt file created by our recipe today to deal with multiple interpreter versions.
👍 2
But @proud-dentist-22844 you don't need to add environment markers today since the file is a constraint.txt file which is only used to constrain deps and not pick them. So if you just add (zipp) in this example) to the constraints file, that won't cause a python3.8 interpreter to erroneously pick it. Again - today. Eric was speaking about a future world.
👍 1
p
Understood. Two overlapping but related conversations 🙂 future and now