Skip to content
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

Cope with Namespace annotations in Python 3.14 #3084

Merged
merged 2 commits into from
Mar 22, 2025

Conversation

nphilipp
Copy link
Contributor

@nphilipp nphilipp commented Mar 20, 2025

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 nphilipp force-pushed the main--py314-annotations branch from 4fa546d to 9e6b882 Compare March 21, 2025 00:03
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]>
@nphilipp nphilipp force-pushed the main--py314-annotations branch from 9e6b882 to 75535c7 Compare March 21, 2025 00:14
@coveralls
Copy link

Coverage Status

coverage: 90.335% (+0.001%) from 90.334%
when pulling 75535c7 on nphilipp:main--py314-annotations
into cfd4222 on RDFLib:main.

@nicholascar nicholascar merged commit 62685d8 into RDFLib:main Mar 22, 2025
21 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.

3 participants