proud-dentist-22844
03/27/2023, 4:13 PMsetup.py
for wheels (python_distribution
).
In an exported venv, ./pants export ...
, I would like to use editable mode installations of all the exported resolve's code (Ie the code that will end up in that resolve's `python_distribution`s).
So, is there a way to get the pants-generated setup.py
and do something like setup.py develop
.? Or perhaps a PEP 660 install?
One constraint to the solution: Setuptools gained support for PEP 660 in v64, but that is python 3.7+, and I need python 3.6 for the StackStorm project (for now - I need to figure out editable install to unblock some other things before we can work on finally dropping 3.6).enough-analyst-54434
03/27/2023, 4:15 PMproud-dentist-22844
03/27/2023, 4:16 PMcurved-television-6568
03/27/2023, 4:17 PMproud-dentist-22844
03/27/2023, 4:18 PMenough-analyst-54434
03/27/2023, 4:22 PMpants run
and pants repl
- is it a 3rd case, or just because those 2 cases are too slow?proud-dentist-22844
03/27/2023, 4:27 PM--help
options in pex
and pex-tools
(and subcommands) to see what flexibility pex has. I'm not sure where editable anything might be shoehorned into pex unless maybe pex could be a PEX 660 frontend and install the PEX 660 wheels? Though I guess it would use pip for that. Sorry for the train of thought.enough-analyst-54434
03/27/2023, 4:30 PMpants export
hack for IDE hacky support?proud-dentist-22844
03/27/2023, 4:31 PMsetup.py develop
for each of the wheels.
I want to replace that venv with one generated somehow via pants so that the current Makefile can still be used to run tests while transitioning over to pytest + pants. And that means that I need editable installs.
Also, our code relies heavily on setuptools metadata (esp entrypoints that are managed by openstack/stevedore), so PYTHONPATH alone is insufficient for testing our code.enough-analyst-54434
03/27/2023, 4:32 PMproud-dentist-22844
03/27/2023, 4:32 PMenough-analyst-54434
03/27/2023, 4:33 PM--venv
mode, but it still doesn't really apply. The whole point of a PEX is to pack it up and ship it; so where it lands will almost never have the local project checked out in the same relative location for symlinking.proud-dentist-22844
03/27/2023, 4:35 PMenough-analyst-54434
03/27/2023, 4:35 PMproud-dentist-22844
03/27/2023, 4:40 PMvenv + PYTHONPATH=subproj1:subproj2 nets the same thing - is that right?Nope. not quite. We need the
dist-info
directories to expose the setuptools entry points.enough-analyst-54434
03/27/2023, 4:40 PMproud-dentist-22844
03/27/2023, 4:41 PMenough-analyst-54434
03/27/2023, 4:41 PMproud-dentist-22844
03/27/2023, 4:43 PMexport
somewhere to inject the entry_points.txt
files... I already have the logic to generate that:
https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/framework/stevedore/rules.py#L43-L45entry_points.txt
files, then venv + PYTHONPATH would be sufficient.enough-analyst-54434
03/27/2023, 4:44 PMproud-dentist-22844
03/27/2023, 4:44 PMI just check in my dist-info and treat it as a resource.Fascinating idea. I'll cogitate on it.
enough-analyst-54434
03/27/2023, 4:45 PMproud-dentist-22844
03/27/2023, 4:46 PMcurved-television-6568
03/27/2023, 4:50 PMproud-dentist-22844
03/27/2023, 4:51 PM