Skip to content

feat: Add Python 3.13/3.14 support and bump deps#117

Merged
hsluoyz merged 3 commits into
casdoor:masterfrom
dshilovprpl:feat/bump-deps-versions
Mar 30, 2026
Merged

feat: Add Python 3.13/3.14 support and bump deps#117
hsluoyz merged 3 commits into
casdoor:masterfrom
dshilovprpl:feat/bump-deps-versions

Conversation

@dshilovprpl
Copy link
Copy Markdown
Contributor

@dshilovprpl dshilovprpl commented Mar 29, 2026

Add classifiers for Python 3.13 and 3.14 (also ensure 3.12 listed) in pyproject.toml and setup.cfg, and extend Black target versions to include py312–py314. Also bump dependency versions in requirements.txt: aiohttp -> 3.13.4, cryptography -> 46.0.6, PyJWT -> 2.12.1, requests -> 2.33.0, setuptools -> >=82.0.0, yarl -> 1.23.0. These changes enable compatibility with newer Python releases and update third-party packages to newer versions.

Fixed tests.

Add classifiers for Python 3.13 and 3.14 (also ensure 3.12 listed) in pyproject.toml and setup.cfg, and extend Black target versions to include py312–py314. Also bump dependency versions in requirements.txt: aiohttp -> 3.13.4, cryptography -> 46.0.6, PyJWT -> 2.12.1, requests -> 2.33.0, setuptools -> >=82.0.0, yarl -> 1.23.0. These changes enable compatibility with newer Python releases and update third-party packages to newer versions.
Use timezone-aware UTC datetimes for entity creation and subscription times (add timezone import and apply datetime.timezone.utc). Update numerous tests to generate created_time in UTC. Adjust OAuth/enforcer tests: change permission_id namespace to "casbin/permission-built-in", relax the online/offline/all_count assertion, and modify user update flows to fetch the server-assigned user (id) before updating. Also set default fields in some test fixtures (e.g. plan.currency, product.currency, subscription.state) and fix permission.model to "casbin/user-model-built-in". These changes stabilize time handling and make tests align with server-assigned identifiers and updated resource naming.
Update CI workflow to use Python 3.14 in .github/workflows/build.yml. Reformat test code in src/tests/test_group.py and src/tests/test_webhook.py to use multi-line argument lists for Group.new and Webhook.new calls for improved readability/PEP8 compliance. No functional changes to logic or behavior.
@dshilovprpl
Copy link
Copy Markdown
Contributor Author

@hsluoyz Could you please review? I can't add you as rewiver to this PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the package metadata and tooling configuration to advertise/support newer Python versions (3.12–3.14), bumps runtime dependencies, and adjusts the test suite to be compatible with updated server expectations and timezone-aware timestamps.

Changes:

  • Add Python 3.12–3.14 classifiers and extend Black target versions through py314.
  • Bump dependency versions in requirements.txt.
  • Fix/adjust unit tests (UTC timestamps, updated IDs/fields, and user-update flow).

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/tests/test_webhook.py Use timezone-aware UTC created_time in webhook tests.
src/tests/test_user.py Use UTC created_time for user creation.
src/tests/test_syncer.py Use UTC created_time for syncer creation.
src/tests/test_subscription.py Use UTC created_time and set subscription state.
src/tests/test_session.py Use UTC created_time for session creation.
src/tests/test_role.py Use UTC created_time for role creation.
src/tests/test_provider.py Use UTC created_time for provider creation.
src/tests/test_product.py Use UTC created_time and set product currency.
src/tests/test_pricing.py Use UTC created_time for pricing creation.
src/tests/test_plan.py Use UTC created_time and set plan currency.
src/tests/test_permission.py Use UTC created_time and update model id to include owner prefix.
src/tests/test_payment.py Use UTC created_time for payment creation.
src/tests/test_organization.py Use UTC created_time for organization creation.
src/tests/test_oauth.py Update permission ids, relax user-count assertion, and re-fetch user before update.
src/tests/test_model.py Use UTC created_time for model creation.
src/tests/test_group.py Use UTC created_time and reformat group creation for readability.
src/tests/test_enforcer.py Use UTC created_time for enforcer creation.
src/tests/test_cert.py Use UTC created_time for cert creation.
src/tests/test_async_oauth.py Update permission ids, relax user-count assertion, and re-fetch user before update (async).
src/tests/test_application.py Use UTC created_time for application creation.
src/tests/test_adapter.py Use UTC created_time for adapter creation.
src/casdoor/subscription.py Make startTime/endTime defaults timezone-aware (UTC).
setup.cfg Add trove classifiers for Python 3.12–3.14.
requirements.txt Bump aiohttp/cryptography/PyJWT/requests/setuptools/yarl versions.
pyproject.toml Add classifiers for 3.13/3.14 and extend Black target versions to py312–py314.
.github/workflows/build.yml Update CI Python version from 3.12 to 3.14.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml
Comment thread src/tests/test_oauth.py
Comment thread src/tests/test_async_oauth.py
@hsluoyz hsluoyz merged commit 18a3b86 into casdoor:master Mar 30, 2026
7 checks passed
@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented Mar 30, 2026

@dshilovprpl thanks for the contribution! Looking forward to the next PR!

github-actions Bot pushed a commit that referenced this pull request Mar 30, 2026
# [1.41.0](v1.40.0...v1.41.0) (2026-03-30)

### Features

* Add Python 3.13/3.14 support and bump deps ([#117](#117)) ([18a3b86](18a3b86))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.41.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants