Skip to content

bump EOL python dependencies across services#4266

Open
panish16 wants to merge 14 commits intobcgov:mainfrom
panish16:new-python
Open

bump EOL python dependencies across services#4266
panish16 wants to merge 14 commits intobcgov:mainfrom
panish16:new-python

Conversation

@panish16
Copy link
Copy Markdown
Contributor

Issue #: /bcgov/entity###

Description of changes:

  • Upgrade Flask 1.x/2.x → 3.1.0 across colin-api, data-tool, sftp-gazette, sftp-icbc-report, sftp-nuans-report, and business-registry-model
  • Upgrade SQLAlchemy 1.4.44 → 2.0.40 in colin-api, business-registry-model, and sql-versioning
  • Upgrade pydantic 1.10.2 → >=2.7.0,<3.0.0 in business-registry-model
  • Upgrade protobuf 3.x → >=5.28.0,<6.0.0 in business-bn and business-emailer
  • Update companion packages (Werkzeug, Jinja2, MarkupSafe, itsdangerous, alembic, flask-restx, Flask-Migrate, Flask-SQLAlchemy,
    Flask-Pydantic) to versions compatible with the above upgrades

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

@panish16 panish16 force-pushed the new-python branch 5 times, most recently from c5764bd to 15f2b3f Compare April 16, 2026 17:56
  - Replace libaio1 with libaio1t64 in Dockerfile (Debian trixie rename)
  - Add known_first_party/known_third_party to isort config so flake8-isort
    and pylint agree on import order (third-party before first-party)
  - Fix import ordering across 38 source/test files accordingly
  - Default JWT_OIDC_ALGORITHMS to 'RS256' to fix test AttributeError
    when env var is unset (flask-jwt-oidc no longer provides class default)
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.76%. Comparing base (d995156) to head (28127e5).
⚠️ Report is 298 commits behind head on main.

Files with missing lines Patch % Lines
colin-api/src/colin_api/resources/db.py 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4266      +/-   ##
==========================================
+ Coverage   29.66%   29.76%   +0.10%     
==========================================
  Files          39       39              
  Lines        3486     3554      +68     
==========================================
+ Hits         1034     1058      +24     
- Misses       2452     2496      +44     
Flag Coverage Δ
colinapi 29.76% <80.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
colin-api/src/colin_api/config.py 95.52% <100.00%> (ø)
colin-api/src/colin_api/models/filing.py 13.28% <100.00%> (+0.05%) ⬆️
colin-api/src/colin_api/services/flags.py 51.66% <100.00%> (+12.68%) ⬆️
colin-api/src/colin_api/resources/db.py 68.00% <62.50%> (+0.14%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… the Flask bump — so it won't break when the PR merges
Comment thread data-tool/requirements.txt
Comment thread python/common/business-registry-model/requirements.txt Outdated
- Pin gcp-queue and structured-logging to e82cd710 instead of
  2a3d5a2; e82cd710 is the latest main commit and explicitly fixes
  Cloud SQL connector compatibility with Python 3.9
- Revert data-tool/requirements.txt — not deployed, maintained
  locally by the data migration team
- Revert business-registry-model/requirements.txt — pyproject.toml
  is the source of truth here; requirements.txt is legacy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread python/common/sql-versioning/pyproject.toml
panish16 and others added 3 commits April 22, 2026 12:55
The package uses pyproject.toml as its source of truth. The
requirements.txt was a legacy file, not referenced by any Dockerfile
or CI workflow, and caused the EOL scanner to flag stale versions
that are already updated in pyproject.toml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update flask 1.1.2 → 3.0.3, SQLAlchemy 1.4.44 → 2.0.40, and
pydantic 1.10.2 → 2.10.6 to match the versions already used in
pyproject.toml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove requirements.txt and dev.txt from business-registry-model — these
are pre-poetry artefacts not consumed by the poetry build; pyproject.toml
is the authoritative dependency source.

Revert sql-versioning SQLAlchemy bump to 1.4.44 per reviewer guidance:
a shared-library major-version bump requires its own PR with a version
increment and updated poetry.lock before consumers can be updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isort 4.x requires distutils which was removed in Python 3.12+, and the
flake8-isort/isort 4.x combination does not correctly apply known_first_party
from setup.cfg. Updating to isort>=5.0.0 fixes the import-order CI failures.
Import ordering in source files was already corrected in a prior commit and
validates clean against isort 5.x.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kialj876
Copy link
Copy Markdown
Collaborator

@panish16 were you able to test all the services you updated locally? Not only the pytests because the coverage is not good everywhere, but actually run them connected to a db and run the postman collections or see the jobs working as expected?

…ill handle the full Python version upgrade separately

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	legal-api/poetry.lock
#	legal-api/pyproject.toml
#	queue_services/business-bn/poetry.lock
#	queue_services/business-emailer/poetry.lock
#	queue_services/business-emailer/pyproject.toml
pkgutil-resolve-name = "1.3.10"
protobuf = "==3.20.*"
protobuf = ">=5.28.0,<6.0.0"
psycopg2-binary = "2.9.10"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you need to resync your fork and rebase the branch, since pscycopg2 has been removed from main

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 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.

6 participants