aloof-airline-74337
04/17/2024, 6:51 PMwide-midnight-78598
04/17/2024, 6:55 PMwide-midnight-78598
04/17/2024, 6:56 PMaloof-airline-74337
04/17/2024, 6:56 PMaloof-airline-74337
04/17/2024, 6:56 PMYou're running nose as an in-repo plugin?Yep
wide-midnight-78598
04/17/2024, 6:57 PMpython-default as py3.10, right?aloof-airline-74337
04/17/2024, 6:59 PMaloof-airline-74337
04/17/2024, 7:00 PMaloof-airline-74337
04/17/2024, 7:00 PMwide-midnight-78598
04/17/2024, 7:01 PMwide-midnight-78598
04/17/2024, 7:01 PMaloof-airline-74337
04/17/2024, 7:02 PMaloof-airline-74337
04/17/2024, 7:02 PMwide-midnight-78598
04/17/2024, 7:03 PMaloof-airline-74337
04/17/2024, 7:04 PMwide-midnight-78598
04/17/2024, 7:04 PMaloof-airline-74337
04/17/2024, 7:04 PMwide-midnight-78598
04/17/2024, 7:05 PMaloof-airline-74337
04/17/2024, 7:05 PMwide-midnight-78598
04/17/2024, 7:05 PMaloof-airline-74337
04/17/2024, 7:07 PMpyupgrade-ed it (or something equivalent)wide-midnight-78598
04/17/2024, 7:07 PMmatch I think is 3.10 - I can try thataloof-airline-74337
04/17/2024, 7:07 PMwide-midnight-78598
04/17/2024, 7:12 PM[python]
enable_resolves = true
interpreter_constraints = [">=3.9"]
tailor_pex_binary_targets = false
[python.resolves]
pants-plugins = "build-support/pants-plugins/lock.txt"
python-default = "build-support/python/default_lock.txt"
[python.resolves_to_interpreter_constraints]
pants-plugins = [">=3.9,<3.10"]
pex_binary(
name="helloworld-pex",
entry_point="helloworld.main",
dependencies=[":libhelloworld"],
interpreter_constraints=[">=3.10"]
)
scie_binary(
name="helloworld-scie",
dependencies=[":helloworld-pex"],
#platforms=["linux-x86_64", "macos-aarch64"]
lift="lift.toml"
)aloof-airline-74337
04/17/2024, 7:12 PMgenerate-lockfiles it was on test at runtimewide-midnight-78598
04/17/2024, 7:12 PMwide-midnight-78598
04/17/2024, 7:13 PMwide-midnight-78598
04/17/2024, 7:14 PMaloof-airline-74337
04/17/2024, 7:14 PMwide-midnight-78598
04/17/2024, 7:21 PMaloof-airline-74337
04/17/2024, 7:24 PMwide-midnight-78598
04/17/2024, 7:25 PMaloof-airline-74337
04/17/2024, 7:27 PMwide-midnight-78598
04/17/2024, 7:29 PMwide-midnight-78598
04/17/2024, 7:45 PMaloof-airline-74337
04/17/2024, 8:03 PMwide-midnight-78598
04/17/2024, 8:05 PMTraceback (most recent call last):
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/failure.py", line 38, in runTest
raise self.exc_class(self.exc_val)
OSError: No such file examples/python/helloworld/helloworld/__init__.py
======================================================================
ERROR: Failure: ImportError (No module named 'main_test')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/failure.py", line 35, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/loader.py", line 335, in loadTestsFromName
module = self.importer.importFromPath(
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/importer.py", line 157, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/importer.py", line 181, in importFromDir
fh, filename, desc = find_module(part, path)
File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/s/d4823f06/venv/lib/python3.9/site-packages/nose/importer.py", line 90, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'main_test'wide-midnight-78598
04/17/2024, 8:06 PMwide-midnight-78598
04/17/2024, 8:19 PMwide-midnight-78598
04/17/2024, 8:19 PMwide-midnight-78598
04/17/2024, 8:26 PMnosetests instead of the entrypoint, as I haven't used nose in many years and don't recall how to use it other than the command line runner.
⢠Using a VenvPexProcess directly, instead of a few composable items along the way
⢠Created a pynose specific lockfile (CPython10)
⢠Only the pants-plugins code (e.g. the rules and target stuff) runs using 3.9, everything else can run using whatever interpreter
I removed the MultiGets, but you can put those back in, as it's a bit more efficientaloof-airline-74337
04/17/2024, 8:28 PMpants_requirements and added the resolve to export so that I'd get the venv for LSP šaloof-airline-74337
04/17/2024, 8:28 PMaloof-airline-74337
04/17/2024, 8:29 PMwide-midnight-78598
04/17/2024, 8:42 PMaloof-airline-74337
04/17/2024, 9:01 PMwide-midnight-78598
04/17/2024, 9:07 PMgenerate_builtin_lockfiles.py which does it.
outside, I kinda just hacked it:
I created a nosetool resolve which pointed at the lockfile location, then created a python_requirement(requirements=["pynose==1.5.1"], resolve="nosetool"] and then did a regular generate-lockfiles pointing at the nosetool resolvealoof-airline-74337
04/17/2024, 10:01 PMPythonToolBase declaration would take care of that....wide-midnight-78598
04/17/2024, 11:52 PM