ancient-vegetable-10556
08/02/2022, 9:32 PMpkgutil.get_data
internally, because it’s not supported by PEP 304-style pluggable importers (PyOx…r uses one). The problem is that the replacement, importlib.resources
, cannot currently load resources from namespace packages, and the very first thing that Pants does on startup is load the VERSION
file from the pants
namespace package using get_data
.
There’s a backport library that fixes this issue, but that would require users install an external requirement into their python environment. One option is to vendor the code in (it looks relatively small).
Easier would be if I could move the VERSION
file into a non-namespace package. It appears, though, that our installer script depends on the location of the VERSION
file. I could leave the current version of the file as a symlink (or the importable version, for that matter).
Do we have a preference here?ancient-vegetable-10556
08/02/2022, 9:33 PMpants
must remain a namespace package; putting an __init__.py
into pants
was the first thing I tried)ancient-vegetable-10556
08/02/2022, 9:37 PMimportlib-resources
project
Solution B: create pants.version
, move src/python/pants/VERSION
into that package, and replace src/python/pants/VERSION
with a symlink
Solution C: create pants.version
, containing a symlink of src/python/pants/VERSION
bitter-ability-32190
08/02/2022, 9:38 PMancient-vegetable-10556
08/02/2022, 9:39 PMVERSION
file’s location hardcodedbitter-ability-32190
08/02/2022, 9:40 PMancient-vegetable-10556
08/02/2022, 9:41 PMbitter-ability-32190
08/02/2022, 9:42 PMbitter-ability-32190
08/02/2022, 9:43 PMhundreds-father-404
08/02/2022, 9:44 PM./pants
script block this work, particularly because this is for an advanced use case w/ PANTS_SHA
I suspect we will need to rework this script anyways for PyOxyidzer
Note that we required everyone to change their script when Pants switched from Py2 to Py3. Obviously we want to keep disruptions minimal, but it is valid to change the script when necessarybitter-ability-32190
08/02/2022, 9:46 PMhundreds-father-404
08/02/2022, 9:47 PMthe fact that the bootstrapper is in SCCSCC?
bitter-ability-32190
08/02/2022, 9:47 PMancient-vegetable-10556
08/02/2022, 9:47 PMancient-vegetable-10556
08/02/2022, 9:47 PMancient-vegetable-10556
08/02/2022, 9:49 PM