Skip to content

Commit

Permalink
Merge pull request #6 from i-dot-ai/EN-627/3_12_upgrade
Browse files Browse the repository at this point in the history
Upgrade to python 3.12
  • Loading branch information
RyanWhite25 authored Oct 15, 2024
2 parents 8a48661 + 66928bb commit 405e615
Show file tree
Hide file tree
Showing 11 changed files with 1,311 additions and 813 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.12"
cache: "poetry"

- name: Install dependencies
run: |
poetry env use "3.7"
poetry env use "3.12"
poetry install
- name: Bump version number
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest"]
python-version: ["3.11"]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
Expand All @@ -30,7 +30,3 @@ jobs:
- name: Run Checks
run: |
bash scripts/test.sh --ci
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
uses: codecov/codecov-action@v2
1 change: 1 addition & 0 deletions cruft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Allows you to maintain all the necessary cruft for packaging and building projects separate from
the code you intentionally write. Built on-top of, and fully compatible with, CookieCutter.
"""

from cruft._commands import check, create, diff, link, update
from cruft._version import __version__

Expand Down
1 change: 1 addition & 0 deletions cruft/_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines CLI interactions when using `cruft`."""

import json
from pathlib import Path
from typing import List, Optional
Expand Down
1 change: 1 addition & 0 deletions cruft/_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the core logic behind all cruft commands."""

from .check import check
from .create import create
from .diff import diff
Expand Down
1 change: 1 addition & 0 deletions cruft/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains all custom exceptions raised by cruft."""

from pathlib import Path
from typing import Union

Expand Down
2,088 changes: 1,292 additions & 796 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ readme = "README.md"
packages = [{ include = "cruft" }]

[tool.poetry.dependencies]
python = ">=3.7"
python = ">=3.12"
cookiecutter = ">=1.7"
gitpython = ">=3.0"
toml = { version = ">=0.10", optional = true, python = "<3.11" }
typer = ">=0.4.0"
click = ">= 7.1.2"
#examples = {version = ">=1.0.2", optional = true}
importlib-metadata = {version = ">=2.0.0,<5.0.0", python = "<3.8"}
flake8 = "^7.1.1"

[tool.poetry.extras]
pyproject = ["toml"]
Expand All @@ -27,7 +28,7 @@ black = ">=22.12.0"
examples = { version = ">=1.0.2", python = ">=3.7.0,<4.0"}
safety = ">=1.8"
isort = ">=5.11.0"
flake8 = "<5.0.0,>=4.0.0"
flake8 = "<8.0.0,>=7.0.0"
flake8-bugbear = ">=19.8"
mypy = ">=0.971"
types-toml = ">=0.10"
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
max-line-length = 100
extend-ignore =
E203 # https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices
B008
# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices
E203,
B008,
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def test_diff_has_diff(
@@ -1 +1 @@
-new content 0
+content0
"""
""" # noqa: E501
expected_output_regex = re.escape(expected_output)
expected_output_regex = expected_output_regex.replace(r"\{tmpdir\}", r"([^\n]*)")
expected_output_regex = rf"^{expected_output_regex}$"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_remove_paths_with_glob_pattern_and_string(tmp_path: Path):
(repo0 / "tests" / "test0.py").touch()
(repo0 / "tests" / "test1.py").touch()

with pytest.warns(None) as warn_record:
with pytest.warns() as warn_record:
utils.generate._remove_paths(repo0, {5}) # type: ignore
assert len(warn_record) != 0, "a warning should have been called as typing was off"
assert (repo0 / "tests" / "test0.py").exists()
Expand Down

0 comments on commit 405e615

Please sign in to comment.