Skip to content

Install palace-manager editable in the container (PP-4076)#3245

Merged
jonathangreen merged 1 commit intomainfrom
bugfix/restore-editable-install-in-container
Apr 15, 2026
Merged

Install palace-manager editable in the container (PP-4076)#3245
jonathangreen merged 1 commit intomainfrom
bugfix/restore-editable-install-in-container

Conversation

@jonathangreen
Copy link
Copy Markdown
Member

Description

Drop --no-editable from the final uv sync in docker/Dockerfile so palace-manager is installed editably in the container — same behavior we had under Poetry.

Motivation and Context

Found while checking the uv changes that rolled out to Minotaur last night. The Poetry → uv migration in #3221 switched the in-container install from editable (Poetry's default) to non-editable (uv sync --no-editable). That change quietly broke palace.manager.scripts.startup's discovery of the startup_tasks/ directory:

Startup tasks directory /var/www/circulation/env/lib/python3.12/startup_tasks does not exist; skipping.

The script resolves STARTUP_TASKS_DIR via Path(__file__).parents[4], which assumes startup.py is at ${root}/src/palace/manager/scripts/startup.py (editable install). Under --no-editable, startup.py lives inside site-packages and parents[4] resolves to env/lib/python3.12/ instead of the project root, so startup_tasks/ is never found.

Restoring the editable install fixes the immediate breakage and matches the previous behavior. It also has the minor side benefit of making in-container debugging easier — you can edit files in place without rebuilding the image.

Future work

Eventually we'd like to build palace-manager as a proper non-editable package that can be published the same way palace-util and palace-opds will be. Several path-resolution issues need to be sorted out first (alembic migrations, startup scripts, and similar file-layout assumptions) before that's feasible. For now, editable install is the simpler and safer choice.

How Has This Been Tested?

  • Built the image locally and confirmed startup.py now resolves STARTUP_TASKS_DIR to /var/www/circulation/startup_tasks.
  • Existing startup task (2026_02_17_force_re_harvest_all_opds_for_distributors.py) is picked up.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

The Poetry to uv migration in #3221 switched the container install from
editable (Poetry's default) to non-editable (uv sync --no-editable).
That change broke palace.manager.scripts.startup's discovery of the
startup_tasks/ directory — the script resolves STARTUP_TASKS_DIR via
Path(__file__).parents[4], which assumes startup.py is at
${root}/src/palace/manager/scripts/startup.py (editable install).
Under --no-editable, startup.py lives inside site-packages and
parents[4] resolves to env/lib/python3.12/ instead of the project root,
so startup_tasks/ is never found.

Drop --no-editable to restore the working layout.
@jonathangreen jonathangreen added the bug Something isn't working label Apr 15, 2026
@jonathangreen jonathangreen requested a review from a team April 15, 2026 13:17
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.31%. Comparing base (11171c1) to head (cc02e24).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3245   +/-   ##
=======================================
  Coverage   93.30%   93.31%           
=======================================
  Files         498      498           
  Lines       46147    46147           
  Branches     6318     6318           
=======================================
+ Hits        43059    43060    +1     
  Misses       2003     2003           
+ Partials     1085     1084    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪛

@jonathangreen jonathangreen merged commit 36f2900 into main Apr 15, 2026
20 checks passed
@jonathangreen jonathangreen deleted the bugfix/restore-editable-install-in-container branch April 15, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants