I put `pants_requirement(name="pants", dist="pants...
# plugins
p
I put
pants_requirement(name="pants", dist="pantsbuild.pants")
in
pylint-plugins/BUILD
as recommended in the docs. But now, I'm getting an ugly error when I try to regen constraints:
Copy code
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.5.0rc2 (from versions: 0.0.17, 0.0.18, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50, 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74, 0.0.75, 0.0.76, 0.0.77, 0.0.79, 0.0.80, 0.0.81, 0.0.82, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0, 1.25.0, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.30.1, 1.30.2, 1.30.3, 1.30.4rc0, 1.30.4, 1.30.5rc0, 2.0.0a0, 2.0.0a1, 2.0.0a2, 2.0.0a3, 2.0.0b0, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.0.0, 2.0.1rc0, 2.0.1rc1, 2.0.1rc2, 2.0.1rc3, 2.0.1rc4, 2.0.1, 2.0.2rc0, 2.0.2, 2.1.0.dev0, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0rc3, 2.1.0, 2.1.1rc0, 2.1.1rc1, 2.1.1rc2, 2.1.1, 2.1.2rc0, 2.1.2)
ERROR: No matching distribution found for pantsbuild.pants==2.5.0rc2
Any ideas on what to do for that?
👀 1
h
I suspect the
python
being used in
generate_constraints.txt
is not Py37 - Py39. The release does exist with the correct files there https://pypi.org/project/pantsbuild.pants/2.5.0rc2/#files, but you have to use the correct interpreter If true, you'd change that
python
value to be something more precise like
python3.7
p
doh. I have it constrained to 3.6.
✔️ 1
I'll have to look at a different constraint just for the pants-plugins. hmm
h
how come? Also note that this is only relevant to run Pants on your plugin itself, like run tests and linters on it. It's not required for your plugin to work
p
Because st2 code is 3.6 only (a few others are working on adding 3.8 support). So, i have
interpreter_constraints=["CPython==3.6.*]
hmm. that didn't affect generate_constraints.sh - it still fails. I'll just drop the pants_requirement thing until st2 code supports >3.6
h
Ah, got it. Yeah, this is a good example of the need for multiple lockfiles.. sg, I fear dropping the pants_requirement is yeah the best thing for now. Good to know this is a rough spot of plugin API
👍 1
e
Wait - the only problem here is
pants_requirement(...)
right? If instead you used a regular requirement string with an environment marker for pantsbuild.pants, and different interpreter constraints for your plugin target(s), you'd be fine.
h
Oh, ttrue
e
All
pants_requirement
really does is ensure your pants versions match. You could just add a comment saying KEEP SYNCED.
h
it also sets
module_mapping={"pantsbuild.pants": ["pants"]}
, which I'm realizing we could simply set in the DEFAULT_MODULE_MAPPING now that that exists
e
Yeah, that'd be good.