Remove the deprecated app import shim in 3.0.0

Open
#62 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, fastapi, python

Research direction

Start with server/app/__init__.py, server/tests/test_app_shim.py, and the referenced packaging and Debian setup files. Read the current shim behavior and the migrate-static tests, then run the server tests and Debian 13 bats suite. Done when the 2.x warning names 3.0.0 and the 3.0.0 removal, packaging, upgrade path, and breaking CHANGELOG entry meet the listed acceptance criteria.

Written by the indexing model from the issue text.

Description

enhancement P3 server

Problem

The server package was renamed from app to orcaster_server. A compatibility shim keeps import app.<module> working for plugins written before the rename (server/app/__init__.py:1). The deprecation warning only says "will be removed in a future release" (server/app/__init__.py:30), and the test asserts that text (server/tests/test_app_shim.py:23). No removal version is announced, so plugin authors have no date to plan for.

The shim is still packaged in the wheel and in the sdist (server/pyproject.toml:62 and server/pyproject.toml:66). The current version is 2.0.1.

Proposed change

Remove the shim in the next major release, 3.0.0, because removing it breaks external code that still imports app.

  1. Now: change the warning to "will be removed in 3.0.0". Update the module docstring and the assertion in server/tests/test_app_shim.py to match.
  2. In 3.0.0:
    • Delete server/app/__init__.py and server/tests/test_app_shim.py.
    • Remove app from the wheel packages list and the sdist only-include list in server/pyproject.toml.
    • Add a CHANGELOG entry marked BREAKING: import app no longer works, and plugins must import orcaster_server.
    • In setup-scripts/debian13/03-app-install.sh, stop passing --shim-source to server-layout.sh migrate-static (setup-scripts/debian13/03-app-install.sh:107) and drop the shim comment above it (:101-103).
    • In setup-scripts/debian13/server-layout.sh, remove the shim exception: the header text (server-layout.sh:23-28), the --shim-source option (server-layout.sh:35-36, server-layout.sh:54, server-layout.sh:246), is_shim (server-layout.sh:86-91), its two uses in migrate-static (server-layout.sh:172-176, server-layout.sh:185-188) and the __init__.py exclusion in the final emptiness check (server-layout.sh:219-221). Keep align-unit and restore-unit as they are, so a rollback to an older release still rewrites the unit.
    • Rewrite the shim tests in setup-scripts/debian13/tests/test_server_layout.bats:338-532. They copy server/app/__init__.py from the repo, so they fail once the file is gone.
    • Add a bats test for the upgrade path: the host has the old shim in server/app/__init__.py and a host-only static file in server/app/static/, the source tree has no server/app/. The rsync of 03 plus migrate-static succeed, the shim is gone and the static file is in orcaster_server/static/.

A host upgraded from 2.x still has the shim in its install tree. The rsync --delete of 03 removes it, because the source tree no longer has it. The systemd unit already runs orcaster_server.main:app (setup-scripts/debian13/05-systemd.sh:41), so the service does not need the shim.

The docstring says the shim goes away "together with the other rename shims" (server/alembic.ini, server/scripts/*.py). Decide separately whether those stay or go in 3.0.0, and state the decision in the CHANGELOG. They are out of scope for the steps above.

Acceptance criteria

  • Before 3.0.0, import app emits a DeprecationWarning that names 3.0.0, and the shim test asserts that text.
  • CHANGELOG entry under Unreleased announces the removal in 3.0.0.
  • In 3.0.0, import app raises ModuleNotFoundError.
  • In 3.0.0, the built wheel and sdist contain no top-level app package.
  • Plugins and deployments that already import orcaster_server keep working without configuration changes.
  • An existing install with the 2.x shim upgrades to 3.0.0 with the setup scripts and no manual steps, and the service starts.
  • setup-scripts/debian13/server-layout.sh and 03-app-install.sh no longer mention the shim, and the bats suite passes.
  • The CHANGELOG lists the removal as a breaking change and tells plugin authors to import orcaster_server.
Dominant language
Python
Stars
0
Forks
0
Avg merge
1d 1h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AInvirion/orcaster

All issues in AInvirion/orcaster

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.