Skip to content

Cope with Namespace annotations in Python 3.14 #3132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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 <[email protected]>
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