Skip to content

Commit

Permalink
Upgrade dependencies Aug'24 (#274)
Browse files Browse the repository at this point in the history
* ⬆️ chore(deps): Upgrade Python to ^3.11 and Update deps in 'main' group

	Update a dependency constraints in 'pyproject.toml'
	  click (8.0.4 -> 8.1.7)
	  requests (2.31.0 -> 2.32.3)
	  beautifulsoup4 (4.9.3 -> 4.12.3)

	Also upgrade dependencies:
	  lxml (4.9.4 -> 5.3.0)
	  loguru (0.6.0 -> 0.7.2)
	  single-source (0.2.0 -> 0.4.0)

* 🔧 chore(nox): Update Python version to 3.11 for Nox sessions

* 🔧 chore(nox): Ignore dispute CVE ID=70612 (in jinja2) in 'safety' session

CVE-2019-8341 marked as **DISPUTE**
https://data.safetycli.com/v/70612/97c/
	  why: The maintainer and multiple third parties believe that this vulnerability isn't valid because users shouldn't use untrusted templates without sandboxing.

* ⬆️ chore(deps): Update deps in 'format' group

	black (22.12.0 -> 24.8.0)
	yapf (0.31.0 -> 0.40.2)
	reorder-python-imports (2.8.0 -> 3.13.0)
	rope (0.20.1 -> 1.13.0)

	Update constraints:
	pre-commit (3.3.2 -> 3.8.0 )
	pre-commit-hooks (4.4.0 -> 4.6.0)

* ⬆️ chore(deps): Update deps in 'lint' group

	flake8 (4.0.1 -> 7.1.1)
	flake8-bandit (3.0.0 -> 4.1.1)
	flake8-bugbear (21.11.29 -> 24.4.26)
	flake8-rst-docstrings (0.2.7 -> 0.3.0)
	mypy (0.910 -> 1.11.1)
	pep8-naming (0.12.1 -> 0.14.1)

	Update constraints:
	flake8-docstrings (1.6.0 -> 1.7.0)
	flake8-black (0.3.3 -> 0.3.6)
	flake8-import-order (0.18.1 -> 0.18.2)

* ⬆️ chore(deps): Update deps in 'test' group

	pytest (7.4.4 -> 8.3.2)
	safety (2.4.0b2 -> 3.2.5)
	coverage[toml] (6.5.0 -> 7.6.1)
	xdoctest (0.15.10 -> 1.1.6)

	Update constraints:
	pytest-mock (3.6.1 -> 3.14.0)
	requests-mock (1.9.3 -> 1.12.1)

* ⬆️ chore(deps): Update deps in 'docs' group

	sphinx (7.4.7 -> 8.0.2)
	sphinx-click (4.4.0 -> 6.0.0)

	Update constraints:
	sphinx-autobuild (2021.3.14 -> 2024.4.16)
	Pygments (2.15.1 -> 2.18.0)
	furo (2023.5.20 -> 2024.8.6)

* 🔧 chore(nox): Replace 'reorder-python-imports' with 'isort' pre-commit hook

Reason:
psf/black#4175 (comment)
  Black 24+ and reorder-python-imports have incompatible opinions on whether there should be a blank line after a docstring.

Enable 'mypy' session back

* 🚨 style: Add new line after module's docstring (with new 'black' v24+)

Update 'poetry.lock' (it was not consistent with pyproject.toml)

* ✏️ refactor(parser): Correct spelling of 'beginning'

* 🔧 chore(ci): Update action version for 'setup-python' (to v5)
  • Loading branch information
hotenov authored Aug 11, 2024
1 parent 56895c8 commit fd74c0c
Show file tree
Hide file tree
Showing 16 changed files with 1,600 additions and 903 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ repos:
# language: system
# types: [python]
# args: [--application-directories=src]
- id: isort
name: Organize Python imports (via isort)
entry: isort
language: system
types: [python]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration."""

from datetime import datetime


Expand Down
27 changes: 18 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Nox sessions."""

import shutil
import sys
from pathlib import Path
from textwrap import dedent

import nox


try:
from nox_poetry import Session
from nox_poetry import session
Expand All @@ -20,12 +22,12 @@


package = "lep_downloader"
python_versions = ["3.10", "3.9", "3.8"]
python_versions = ["3.11", "3.12"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
# "pre-commit",
# "safety",
# "mypy",
"pre-commit",
"safety",
"mypy",
"tests",
"typeguard",
"xdoctest",
Expand Down Expand Up @@ -83,7 +85,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
hook.write_text("\n".join(lines))


@session(name="pre-commit", python="3.10")
@session(name="pre-commit", python="3.11")
def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
Expand All @@ -98,19 +100,26 @@ def precommit(session: Session) -> None:
"pep8-naming",
"pre-commit",
"pre-commit-hooks",
"isort",
# "reorder-python-imports",
)
session.run("pre-commit", *args)
if args and args[0] == "install":
activate_virtualenv_in_precommit_hooks(session)


@session(python="3.10")
@session(python="3.11")
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
session.install("safety")
session.run("safety", "check", "--full-report", f"--file={requirements}")
session.run(
"safety",
"check",
"--full-report",
f"--file={requirements}",
"--ignore=70612",
)


@session(python=python_versions)
Expand Down Expand Up @@ -174,7 +183,7 @@ def xdoctest(session: Session) -> None:
session.run("python", "-m", "xdoctest", package, *args)


@session(name="docs-build", python="3.10")
@session(name="docs-build", python="3.11")
def docs_build(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]
Expand All @@ -188,7 +197,7 @@ def docs_build(session: Session) -> None:
session.run("sphinx-build", *args)


@session(python="3.10")
@session(python="3.11")
def docs(session: Session) -> None:
"""Build and serve the documentation with live reloading on file changes."""
args = session.posargs or ["--open-browser", "docs", "docs/_build"]
Expand Down
Loading

0 comments on commit fd74c0c

Please sign in to comment.