Skip to content

Upgrade Python version and some of its packages#549

Merged
camilamaia merged 15 commits intoscanapi:mainfrom
mazulo:main
Jun 1, 2022
Merged

Upgrade Python version and some of its packages#549
camilamaia merged 15 commits intoscanapi:mainfrom
mazulo:main

Conversation

@mazulo
Copy link
Contributor

@mazulo mazulo commented Jun 1, 2022

Description

Upgrades the minimal Python version required for the project as well as upgrades PyYAML and Jinja2, which should close #546.

Motivation behind this PR?

The current dependencies were locked to older versions of some packages (e.g. PYYAML (6.0) and jinja2 (3.1.x)) as well as the Python 3.6 version, which reached its end of life in December last year, what makes it not receive any other security upgrade.

What type of change is this?

  • Minimal version of Python now is >=3.7.13
  • PyYAML = "~6.0"
  • Jinja2 = "~3.1.0"
  • click = "8.0.3"

In dev

  • black = "22.3.0" (after this change, it was needed to run make format in the codebase)
  • pre-commit = "2.9.2"
  • mypy = "^0.960"
  • types-PyYAML = "~6.0.0"
  • gitlint = "0.17.0"

Also, we're upgrading the Poetry version in the GitHub workflow files as well as the Python version.

Checklist

  • I have added a changelog entry / my PR does not need a new changelog entry. Instructions.
  • I have added/updated unit tests. Instructions.
  • New and existing unit tests pass locally with my changes. Instructions
  • I have self-documented code my changes by adding docstring(s) and comment(s). Instructions
  • Current PR does not significantly decrease the code coverage and docstring coverage.
  • My code follows the style guidelines of this project.
  • I have run ScanAPI locally and manually tested my changes. Instructions.
  • I have squashed my commits. Instructions.

Issue

Closes #546

It's my first contribution so I might have done something wrong. If that's the case I'm sorry for the trouble and I'm totally open for feedback! 😄

@mazulo mazulo requested review from a team as code owners June 1, 2022 12:00
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for supporting ScanAPI, and congratulations on your first contribution! A project committer will shortly review your contribution.

In the mean time, if you haven't had a chance please skim over the First Pull Request Guide which all pull requests must adhere to.

We hope to see you around!

@github-actions github-actions bot added the First Contribution First contribution to the project. label Jun 1, 2022
@mazulo
Copy link
Contributor Author

mazulo commented Jun 1, 2022

Also, I'm not sure if I added the changelog entries correctly. Please correct me if I'm wrong

mazulo added 6 commits June 1, 2022 09:37
For some reason after making the change to the yaml.serialize to
include the encoding keyword explicitly, black started failing with
the message ImportError: cannot import name '_unicodefun' from 'click'.
Found this solution in SO: https://stackoverflow.com/a/71674345/3716354
which involved upgrading black. However, in order to upgrade it I would
need to upgrade click, which would need to upgrade gitlint. After upgrading
black, it required pre-commit to be upgraded as well. So that's
why we have more package upgrades in the following order:

gitlint > click > black > pre-commit
@mazulo
Copy link
Contributor Author

mazulo commented Jun 1, 2022

This last commit that upgrades Poetry to version 1.1.4 references here about what was fixed: https://python-poetry.org/history/#fixed-12

Co-authored-by: Camila Maia <[email protected]>
@mazulo mazulo requested a review from camilamaia June 1, 2022 14:41
Copy link
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

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

Hey @mazulo thank you very much for the PR!! 🙇‍♀️🙇‍♀️ It contains really important changes that we were needing ASAP. Thank you again!

@camilamaia camilamaia merged commit f618be2 into scanapi:main Jun 1, 2022
@camilamaia
Copy link
Member

Congrats on your first merged PR! 🌟 Thank you very much!

I am going to send you an invite to join the ScanAPI org on GitHub 🚀 We invite everyone that has contributed with a merged PR in any of our repositories. Here you can check our Contributing Guidelines so you can understand better how it works.

Check your email/GitHub notifications to find the invite. If you accept it, you will also be able to clone directly our repositories, without needing to fork them.

Welcome on board and once again, thank you! 🙇‍♀️

camilamaia added a commit that referenced this pull request Jun 1, 2022
* BREAKING CHANGE: Upgrade the minimal Python version in pyproject.toml

The end of life for the Python 3.6 was in december 2021, so I think
it's the right time to drop support for this version

* feat: Upgrade PyYAML and types-PyYAML packages

* feat: Upgrade Jinja to the latest version

* chore: Updates changelog with the appropriate changes

* fix: Upgrade Python version in github workflows

* feat: Upgrade black, click and gitlint versions (more info below)

For some reason after making the change to the yaml.serialize to
include the encoding keyword explicitly, black started failing with
the message ImportError: cannot import name '_unicodefun' from 'click'.
Found this solution in SO: https://stackoverflow.com/a/71674345/3716354
which involved upgrading black. However, in order to upgrade it I would
need to upgrade click, which would need to upgrade gitlint. After upgrading
black, it required pre-commit to be upgraded as well. So that's
why we have more package upgrades in the following order:

gitlint > click > black > pre-commit

* Update black rev in .pre-commit-config.yaml

* fix: pass encoding keyword explicitly in yaml.serialize function

* fix: Upgrade Poetry version to 1.1.3 to fix maximum recursion error

* fix: Upgrade Poetry version to fix recursion error

* fix: Upgrade Poetry version in GitHub action files (now for good)

* chore: Run black to reformat some files

* chore: Upgrade mypy to the latest version

* fix: Remove encoding from yaml.serialize call

* chore: Update CHANGELOG.md

Co-authored-by: Camila Maia <[email protected]>

Co-authored-by: Camila Maia <[email protected]>
@camilamaia camilamaia mentioned this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First Contribution First contribution to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update dependencies to current versions

2 participants