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

Support Python 3.12 #236

Merged
merged 8 commits into from
Oct 31, 2024
Merged

Support Python 3.12 #236

merged 8 commits into from
Oct 31, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Oct 30, 2024

Add support for Python 3.12 by disabling the Artifactory backend for Python 3.12, as it does not support Python 3.12 at the moment. All other Python versions are not affected by this change. Disabling is managed inside pyproject.toml by not installing dohq-artifactory for Python 3.12 or higher.

By disabling Artifactory for Python 3.12, import audbackend will no longer fail for Python 3.12 as reported in audeering/audb#432.

I updated the installation docs to mention, that Artifactory is not available at the moment.

image

Summary by Sourcery

Add support for Python 3.12 by updating the CI configuration and refactoring tests to exclude the Artifactory backend, which is not compatible with Python 3.12.

New Features:

  • Add support for Python 3.12 by updating the CI configuration to include testing on Python 3.12.

Enhancements:

  • Refactor test cases to handle the absence of the Artifactory backend when running on Python 3.12.

CI:

  • Update the CI workflow to include a separate test job for Python 3.12, excluding the Artifactory backend.

Copy link
Contributor

sourcery-ai bot commented Oct 30, 2024

Reviewer's Guide by Sourcery

The changes implement Python 3.12 support by conditionally disabling the Artifactory backend, which is incompatible with Python 3.12. The implementation involves modifying test files to skip Artifactory-related tests when running on Python 3.12 and updating the CI configuration to handle Python 3.12 builds differently.

Updated class diagram for test_api function

classDiagram
    class test_api {
        +test_api(hosts, name, host, repository, expected_class)
    }
    note for test_api "Refactored to use expected_class instead of cls and handle Python 3.12 compatibility"
Loading

File-Level Changes

Change Details Files
Modified test assertions to handle backend class checks more flexibly
  • Changed direct class comparison to string-based class name checks
  • Renamed 'cls' parameter to 'expected_class' for better clarity
  • Updated test parameters to use string representations of class names
tests/test_api.py
Added conditional handling of Artifactory backend in test files
  • Added conditional check for Artifactory backend availability
  • Skip Artifactory tests when Python version is > 3.11
  • Made Artifactory backend initialization conditional
tests/test_interface_unversioned.py
tests/test_legacy_import.py
Updated CI workflow to support Python 3.12
  • Added Python 3.12 test matrix configuration
  • Created separate test execution paths for Python 3.12 and older versions
  • Excluded Artifactory-related files from Python 3.12 test coverage
  • Modified coverage upload conditions to exclude Python 3.12
.github/workflows/test.yml

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

@hagenw hagenw marked this pull request as draft October 30, 2024 15:50
Copy link
Contributor

@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: 1 issue found
  • 🟢 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.

tests/test_interface_unversioned.py Show resolved Hide resolved
tests/test_legacy_import.py Show resolved Hide resolved
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.1%. Comparing base (1d65670) to head (da9c653).

❗ There is a different number of reports uploaded between BASE (1d65670) and HEAD (da9c653). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (1d65670) HEAD (da9c653)
4 1
Additional details and impacted files

see 2 files with indirect coverage changes

@hagenw hagenw marked this pull request as ready for review October 30, 2024 18:50
Copy link
Contributor

@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: 2 issues found
  • 🟢 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.

tests/test_interface_unversioned.py Show resolved Hide resolved
tests/test_legacy_import.py Show resolved Hide resolved
tests/test_legacy_import.py Show resolved Hide resolved
@hagenw hagenw merged commit 416ec0f into main Oct 31, 2024
2 checks passed
@hagenw hagenw deleted the python-3.12 branch October 31, 2024 07:20
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