Skip to content

Cope with Namespace annotations in Python 3.14#3132

Merged
nicholascar merged 4 commits intoRDFLib:mainfrom
nphilipp:main--py314-annotations
Jun 1, 2025
Merged

Cope with Namespace annotations in Python 3.14#3132
nicholascar merged 4 commits intoRDFLib:mainfrom
nphilipp:main--py314-annotations

Conversation

@nphilipp
Copy link
Contributor

@nphilipp nphilipp commented May 5, 2025

I submitted this already in #3084 which got merged, but the change is missing from the main branch. So here we go again:


The annotations member can be incomplete, use the get_annotations() helper from annotationlib (Python >= 3.14) or inspect (Python >= 3.10) if available.

Related: #3083

Summary of changes

This fixes accessing Namespace annotations on Python 3.14, which makes import rdflib fail on this Python version. This should be backwards-compatible.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes. ⇒ Other tests (sparql) fail on Python 3.14, see Failures with Python 3.14 #3083
  • If the change adds new features or changes the RDFLib public API: n/a
  • If the change has a potential impact on users of this project: n/a (covered by existing tests)
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

nphilipp and others added 4 commits May 5, 2025 10:53
The __annotations__ member can be incomplete, use the get_annotations()
helper from annotationlib (Python >= 3.14) or inspect (Python >= 3.10)
if available.

Related: RDFLib#3083

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
@nicholascar nicholascar merged commit a683d19 into RDFLib:main Jun 1, 2025
18 of 22 checks passed
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.

2 participants