Skip to content

Declare runtime dependencies in setup.py (lxml, bs4, xmltodict, sqlparse, astropy) - #31

Merged
bjfultn merged 1 commit into
developfrom
fix/declare-runtime-deps
Oct 6, 2026
Merged

bjfultn merged 1 commit into
developfrom
fix/declare-runtime-deps

Conversation

@bjfultn

@bjfultn bjfultn commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

setup.py declares only ADQL, spatial_index and configobj. The package also needs sqlparse, astropy, beautifulsoup4, lxml and xmltodict at run time. Those are listed only in requirements-test.txt, and CI installs nexsciTAP with --no-deps, so CI stays green while a real pip install gives a service that partly works.

It showed up on the NEID test server, freshly built from develop. VOSI and every sync query worked. Every async job failed: PHASE=RUN returned a 500 ("Internal server error during startup"), and every job sub-resource returned "Couldn't find a tree builder with the features you requested: lxml". tap.py asks BeautifulSoup for the lxml parser by name, so nothing fails at import time. The failure appears only when the async path runs.

Change

  • setup.py: adds the five packages to install_requires. They're unpinned, like the existing three, so current deployments aren't pushed to upgrade anything. Database drivers (cx_Oracle, psycopg2, mysql-connector) stay undeclared, because each deployment installs the one for its DBMS.
  • tests/test_install_requires.py: fails when any module in TAP/ imports a third-party package that setup.py doesn't declare. The DB drivers are exempt, and lxml is always required. It needs Python 3.10+ (sys.stdlib_module_names), so it skips on 3.9.
  • requirements-test.txt: comment updated to say the runtime list now mirrors install_requires.

Verification

  • The new test failed before the change, listing exactly astropy, beautifulsoup4, lxml, sqlparse, xmltodict. It passes after.
  • Full suite: 109 passed, 2 skipped. ruff clean.

For existing deployments

Nothing changes until the next pip install / upgrade, which will now pull these in. Deployments that already have them (via the venv or PYTHONPATH) are unaffected.

🤖 Generated with Claude Code

sqlparse, astropy, beautifulsoup4, lxml and xmltodict are needed at run
time but were listed only in requirements-test.txt, so CI (which installs
with --no-deps) passed while a real pip install produced a service whose
async jobs all failed: BeautifulSoup asks for the lxml parser by name.
Database drivers stay undeclared; each deployment installs its own.

tests/test_install_requires.py fails when TAP imports a package that
setup.py does not declare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bjfultn
bjfultn merged commit 86fcfeb into develop Oct 6, 2026
6 checks passed
@bjfultn
bjfultn deleted the fix/declare-runtime-deps branch October 6, 2026 19:41
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.

1 participant