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

chore!: Drop support for Python 3.8 #156

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

jmgate
Copy link
Collaborator

@jmgate jmgate commented Dec 2, 2024

Type: Task

Description

  • Use type-hinting provided out of the box in 3.9.
  • Use new dictionary update syntax.
  • Update the docs and CI accordingly.

Related Issues/PRs

Motivation

The Python community no longer supports 3.8.

Summary by Sourcery

Drop support for Python 3.8 and update the codebase to utilize Python 3.9 features, including new type hinting syntax and dictionary update syntax. Update documentation and CI configuration to reflect these changes.

Enhancements:

  • Update type hints to use Python 3.9 syntax, replacing List, Set, and Dict with list, set, and dict.

Build:

  • Remove Python 3.8 from the list of supported versions in the pyproject.toml file.

CI:

  • Update the CI configuration to remove Python 3.8 from the testing matrix.

Documentation:

  • Update the README to reflect the removal of Python 3.8 support.

@jmgate jmgate self-assigned this Dec 2, 2024
Copy link

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This PR removes Python 3.8 support from the project by updating type hints to use native syntax available in Python 3.9+ and modernizing dictionary operations. The changes primarily involve updating type annotations throughout the codebase and modifying dictionary merge operations to use the union operator.

Updated class diagram for StagedScript class

classDiagram
    class StagedScript {
        -Namespace args
        -list~str~ commands_executed
        -Console console
        -str current_stage
        -bool dry_run
        -list~StageDuration~ durations
        -bool print_commands
        -str script_name
        -str script_stem
        -bool script_success
        -datetime stage_start_time
        -set~str~ stages
        -set~str~ stages_to_run
        -datetime start_time
        +__init__(stages: set~str~, console_force_terminal: Optional~bool~ = None, console_log_path: bool = True, print_commands: bool = False)
        +parse_args(argv: list~str~) : None
        +print_script_execution_summary(extra_sections: Optional~dict~str, str~~ = None) : None
        +_current_arg_is_long_flag(args: list~str~) : bool
        +_next_arg_is_flag(args: list~str~) : bool
    }
Loading

File-Level Changes

Change Details Files
Update type hint syntax to use native Python 3.9+ notation
  • Replace typing.List with built-in list type annotation
  • Replace typing.Dict with built-in dict type annotation
  • Replace typing.Set with built-in set type annotation
staged_script/staged_script.py
example/ex_7_customizing_the_summary.py
example/ex_6_creating_retryable_stages.py
example/ex_3_adding_arguments.py
example/ex_4_customizing_stage_behavior.py
example/ex_5_customizing_individual_stages.py
example/test_examples.py
test/test_staged_script.py
test/test_staged_script_advanced_subclass.py
test/test_staged_script_basic_subclass.py
Update dictionary merge operations to use the union operator
  • Replace dict.update() calls with the
operator
Update project metadata and CI configuration
  • Remove Python 3.8 from CI workflow matrix
  • Update Python version badge in README
  • Remove Python 3.8 from project classifiers
.github/workflows/continuous-integration.yml
README.md
pyproject.toml
doc/source/index.rst

Assessment against linked issues

Issue Objective Addressed Explanation
#155 Update configuration files (pyproject.toml, README.md, doc/source/index.rst, CI) to remove Python 3.8 support
#155 Use Python 3.9+ type-hinting syntax (removing typing imports where possible)
#155 Utilize Python 3.9+ features in the codebase

Possibly linked issues


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 @jmgate - 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.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2b7c72b) to head (a9c8005).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #156   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          180       180           
  Branches        15        15           
=========================================
  Hits           180       180           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Use type-hinting provided out of the box in 3.9.
* Use new dictionary update syntax.
* Update the docs and CI accordingly.
@jmgate jmgate force-pushed the 155-drop-support-for-python-3.8 branch from dc7f57a to a9c8005 Compare December 2, 2024 17:59
@jmgate
Copy link
Collaborator Author

jmgate commented Dec 2, 2024

@william76, @GhostofGoes, @jcox10, anyone care to review and approve?

@jcox10 jcox10 self-requested a review December 3, 2024 18:50
@jcox10
Copy link
Collaborator

jcox10 commented Dec 3, 2024

LGTM

@jmgate jmgate merged commit 053d0cd into master Dec 3, 2024
13 checks passed
@jmgate jmgate deleted the 155-drop-support-for-python-3.8 branch December 3, 2024 19:17
@GhostofGoes
Copy link
Collaborator

LGTM

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.

Drop support for Python 3.8
3 participants