Skip to content

Rewrite editable install paths in more build backends' hook modules - #2158

Merged
edmorley merged 1 commit into
mainfrom
edmorley/rewrite-more-editable-hook-modules
Oct 9, 2026
Merged

edmorley merged 1 commit into
mainfrom
edmorley/rewrite-more-editable-hook-modules

Conversation

@edmorley

@edmorley edmorley commented Oct 9, 2026

Copy link
Copy Markdown
Member

Heroku builds occur at a different path to the one the app runs at, so the absolute paths in the files that build backends create for editable installs have to be rewritten for them to work after relocation (see the code comment in bin/compile for more details).

This worked for the most common build backends and configurations, which create *.pth or __editable___*_finder.py files. However, some less common build backends and configurations (hatchling's dev-mode-exact mode, pdm-backend's editables mode and scikit-build-core) also create a hook module (imported by an import line in a .pth file), whose paths weren't rewritten, so those editable installs broke at runtime.

The find now matches *.pth and *editable*.py, which covers all of the hook module names. *.egg-link has been dropped, since no supported package manager creates them any more.

The dev-mode-exact fixture and spec workarounds have been removed.

GUS-W-24469383.

@edmorley edmorley self-assigned this Oct 9, 2026
@edmorley
edmorley force-pushed the edmorley/rewrite-more-editable-hook-modules branch from 676c1b0 to 3987abb Compare October 9, 2026 14:38
Heroku builds occur at a different path to the one the app runs at, so
the absolute paths in the files that build backends create for editable
installs have to be rewritten for them to work after relocation (see
the code comment in `bin/compile` for more details).

This worked for the most common build backends and configurations,
which create `*.pth` or `__editable___*_finder.py` files. However, some
less common build backends and configurations (hatchling's
`dev-mode-exact` mode, pdm-backend's `editables` mode and
scikit-build-core) also create a hook module (imported by an `import`
line in a `.pth` file), whose paths weren't rewritten, so those
editable installs broke at runtime.

The `find` now matches `*.pth` and `*editable*.py`, which covers all of
the hook module names. `*.egg-link` has been dropped, since no supported
package manager creates them any more.

The `dev-mode-exact` fixture and spec workarounds have been removed.

GUS-W-24469383.
@edmorley
edmorley force-pushed the edmorley/rewrite-more-editable-hook-modules branch from 3987abb to a21c412 Compare October 9, 2026 14:39
@edmorley
edmorley marked this pull request as ready for review October 9, 2026 14:44
@edmorley
edmorley requested a review from a team as a code owner October 9, 2026 14:44
@edmorley
edmorley enabled auto-merge (squash) October 9, 2026 14:44
@edmorley
edmorley merged commit e6cce98 into main Oct 9, 2026
10 checks passed
@edmorley
edmorley deleted the edmorley/rewrite-more-editable-hook-modules branch October 9, 2026 14:54
@heroku-linguist heroku-linguist Bot mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants