proud-dentist-22844
04/06/2023, 7:35 PMexport <addresses>) that will stay as is; this will only apply when using export --resolve=).
So, here’s my question:
Should we have a new export option to enable/disable editable installs? If so, should it default to enabled or disabled (disabled is the backwards compatible option)?
Or should we always do editable install of dists when exporting a resolve that includes dists?proud-dentist-22844
04/06/2023, 7:38 PMcurved-television-6568
04/06/2023, 7:41 PMproud-dentist-22844
04/06/2023, 7:46 PMpython_distribution does not have a resolve field. So figuring out which resolve a python_distribution belongs to is expensive: calculating the owned deps of all distributions, and for each distribution, look through those deps until one of them has a resolve field, and use that for that dist’s resolve.
Plus there’s the cost of building the PEP-660 wheels - if the configured PEP-517 build backend doesn’t support the PEP-660 methods, then it falls back to a method that is, sadly, optional in PEP-517. If that method isn’t there, then it falls back to telling that backend to build the whole wheel, and then it extracts just the dist-info directory from it and discards the rest.
So, installing these editable wheels isn’t free. It’ll slow down the export, though I’m not sure by how much.curved-television-6568
04/06/2023, 7:50 PMdisabled based on the relatively few times we’ve seen this feature requested..?proud-dentist-22844
04/06/2023, 7:51 PMproud-dentist-22844
04/06/2023, 7:54 PM--include-editable-local-dists
• --include-editable-dists
• --editable
• --include-pep660-local-dists
• --include-pep660-dists
• --pep660
• something else?proud-dentist-22844
04/06/2023, 8:26 PMproud-dentist-22844
04/06/2023, 8:33 PMresolve_to options? I’m thinking yes. hmm. that’s more complex.happy-kitchen-89482
04/06/2023, 8:48 PMproud-dentist-22844
04/06/2023, 8:52 PMpython_distribution to control inclusion.proud-dentist-22844
04/06/2023, 8:53 PMpython_distribution targets could opt out of such inclusion.happy-kitchen-89482
04/06/2023, 8:59 PMhappy-kitchen-89482
04/06/2023, 9:00 PMhappy-kitchen-89482
04/06/2023, 9:00 PMproud-dentist-22844
04/06/2023, 9:00 PMdist-info directory with the PEP-517 backend, so we need the provides=python_artifact() details.proud-dentist-22844
04/06/2023, 9:01 PMdist-info directory and a .pth file that injects the source directory into the PYTHONPATH (or more accurately, into sys.path).happy-kitchen-89482
04/06/2023, 9:19 PMproud-dentist-22844
04/06/2023, 9:20 PM.pth file that just adds all of the source roots (that contain code in the exported resolve). But people can set PYTHONPATH for that as well. The major value of editable installs is to get the dist-info details.proud-dentist-22844
04/07/2023, 4:20 AMproud-dentist-22844
04/07/2023, 4:28 AMpants.backend.python.util_rules.setup_py should probably go in a separate PR. If it does, then it could be backported to 2.16 as a behavior-less refactor. Doing that means that I can copy a lot of the code in the PR into a plugin for use in the st2 repo while I wait for 2.17 to stabilize enough to upgrade.proud-dentist-22844
04/07/2023, 4:29 AMproud-dentist-22844
04/08/2023, 1:48 AM