Skip to content

Support Python 3.14#1725

Merged
hmpf merged 4 commits into
mainfrom
python-314
Apr 29, 2026
Merged

Support Python 3.14#1725
hmpf merged 4 commits into
mainfrom
python-314

Conversation

@hmpf

@hmpf hmpf commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Scope and purpose

Fixes #1786

Blocked by pydantic depending on some rust stuff depending on cargo depending on lock-file formats.

Test and run on Python 3.14.

Depends on #1724

This pull request

  • adds/changes/removes a dependency

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Argus can be found in the
Development docs.

  • Added a changelog fragment for towncrier
  • [ ] Added/amended tests for new/changed code
  • Added/changed documentation, including updates to the user manual if feature flow or UI is considerably changed
  • [ ] Linted/formatted the code with ruff and djLint, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See our how-to
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • [ ] If this results in changes in the UI: Added screenshots of the before and after
  • [ ] If this results in changes to the database model: Updated the ER diagram

@hmpf hmpf added the dependencies Run `tox -r` before testing locally, dependencies have changed label Jan 14, 2026
@hmpf hmpf moved this from 📋 Backlog to 🏗 In progress in Argus development, public Jan 14, 2026
@github-actions

github-actions Bot commented Jan 14, 2026

Copy link
Copy Markdown

Test results

    8 files  1 584 suites   2m 43s ⏱️
  866 tests   865 ✅ 1 💤 0 ❌
6 928 runs  6 920 ✅ 8 💤 0 ❌

Results for commit 75a04b5.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jan 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.56%. Comparing base (61d2790) to head (9e42515).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1725   +/-   ##
=======================================
  Coverage   88.55%   88.56%           
=======================================
  Files         145      145           
  Lines        7061     7064    +3     
=======================================
+ Hits         6253     6256    +3     
  Misses        808      808           

☔ 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.

@hmpf hmpf self-assigned this Jan 14, 2026
@hmpf

hmpf commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

This fails on:

Traceback (most recent call last):
  File "CENSORED/Argus/tests/dev/test_utils.py", line 11, in setUp
    self.stresstester = StressTester("http://localhost.com", "token", 10, 1)
                        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "CENSORED/Argus/src/argus/dev/utils.py", line 36, in __init__
    self._loop = asyncio.get_event_loop()
                 ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/asyncio/events.py", line 715, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.

Your code, @stveit. I looked for solutions and found this:

@hmpf hmpf added the blocked Another thing/issue has to be resolved before tackling this label Jan 15, 2026
@hmpf

hmpf commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

Finishing this is blocked because:

There's problems with the direct dependency pydantic on python 3.14. pydantic needs rpds which is a rust crate:

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      error: failed to parse lock file at: /tmp/pip-install-nl5ky0_r/rpds-py_0d5a219ec1dd4f848c74cefed920a494/Cargo.lock
      
      Caused by:
        lock file version `4` was found, but this version of Cargo does not understand this lock file, perhaps Cargo needs to be updated?
      💥 maturin failed
        Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
        Caused by: `cargo metadata` exited with an error:
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-j0t4zoi_', '--interpreter', 'CENSORED/Argus/.tox/py314-django52/bin/python']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-j0t4zoi_ --interpreter CENSORED/Argus/.tox/py314-django52/bin/python`
      [end of output]

It seems only argus depends on pydantic so worst case we could try switching to cattrs.

@hmpf hmpf requested a review from a team January 19, 2026 09:36
@hmpf hmpf moved this from 📋 Backlog to 🏗 In progress in Argus development, public Jan 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@johannaengland johannaengland added blocked Another thing/issue has to be resolved before tackling this and removed blocked Another thing/issue has to be resolved before tackling this labels Feb 17, 2026
@hmpf hmpf added the rc-next Prioritized candidate for next release label Mar 5, 2026
@hmpf hmpf moved this from 🏗 In progress to ❓ Ready for review in Argus development, public Apr 28, 2026
@hmpf hmpf removed the blocked Another thing/issue has to be resolved before tackling this label Apr 28, 2026

@lunkwill42 lunkwill42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks green to me 👍

@github-project-automation github-project-automation Bot moved this from ❓ Ready for review to 👍 Reviewer approved in Argus development, public Apr 28, 2026
@lunkwill42

Copy link
Copy Markdown
Member

Blocked by pydantic depending on some rust stuff depending on cargo depending on lock-file formats.

Yes, pydantic is partially built in rust for speed. The problem was likely pip-compile's conservative nature, trying to preserve existing pins from the lockfile. This caused it to keep running on an older version of pydantic-core which had no published binary wheels for Python 3.14. Upgrading the library to a newer version gave us access to the pre-built wheels and voila, no rust compiler needed.

@hmpf hmpf force-pushed the python-314 branch 2 times, most recently from b1f64b7 to 03ca9df Compare April 29, 2026 07:31
lunkwill42 and others added 3 commits April 29, 2026 09:32
This is a "surgical" update of pydantic using:
```
tox run -e upgrade-deps -- -P pydantic -P pydantic-core -P rpds-py -P typing-extensions -P typing-inspection
```
@sonarqubecloud

Copy link
Copy Markdown

@hmpf hmpf merged commit 4a55153 into main Apr 29, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from 👍 Reviewer approved to ✅ Done in Argus development, public Apr 29, 2026
@hmpf hmpf deleted the python-314 branch April 29, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Run `tox -r` before testing locally, dependencies have changed rc-next Prioritized candidate for next release

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Cannot run on Python 3.14 because cargo is oudated!?

3 participants