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

Update syntax to Python 3.9 #452

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Update syntax to Python 3.9 #452

merged 3 commits into from
Oct 31, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Oct 31, 2024

Updates syntax to Python >=3.9 by removing the typing module.

Summary by Sourcery

Enhancements:

  • Update type hint syntax to Python 3.9 standards by replacing the use of the 'typing' module with built-in generic types.

Copy link

sourcery-ai bot commented Oct 31, 2024

Reviewer's Guide by Sourcery

This pull request updates the codebase to use Python 3.9's new type annotation syntax by replacing the typing module imports with native type annotations. The changes primarily involve simplifying type hints by using the new union operator (|) and built-in collection type annotations.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Replace typing.Union with the new union operator ( )
  • Replace typing.Union[X, Y] with `X
Replace typing collection types with their built-in equivalents
  • Replace typing.List with list
  • Replace typing.Dict with dict
  • Replace typing.Sequence with Sequence
  • Replace typing.Tuple with tuple
  • Replace typing.Set with set
audb/core/dependencies.py
audb/core/info.py
audb/core/repository.py
audb/core/utils.py
tests/test_info.py
tests/test_stream.py
tests/test_publish_table.py
Update type hints for class methods and function signatures
  • Replace typing.Type with type
  • Update return type annotations to use the new syntax
  • Update parameter type annotations to use the new syntax
audb/core/lock.py
audb/core/flavor.py
audb/core/repository.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @hagenw - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

audb/core/load.py Show resolved Hide resolved
audb/core/publish.py Show resolved Hide resolved
@hagenw hagenw merged commit e86059a into main Oct 31, 2024
8 checks passed
@hagenw hagenw deleted the update-syntax branch October 31, 2024 10:02
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