Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA authored Jan 21, 2025
2 parents 0ae3dd4 + ff1c4d7 commit ea277eb
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_local_ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
os: ["ubuntu-latest", "windows-latest"]

steps:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
fail-fast: false
matrix:
# Use lowest and highest supported (stable) Python version
python-version: ["3.7", "3.12"]
python-version: ["3.8", "3.12"]
os: ["ubuntu-latest", "windows-latest"]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ jobs:
steps:
- name: Validate inputs
run: |
if [[ ! "${{ inputs.python_version_build }}" =~ ^3\.([7-9]|1[0-4])(\..*)?$ ]]; then
if [[ ! "${{ inputs.python_version_build }}" =~ ^3\.([8-9]|1[0-4])(\..*)?$ ]]; then
echo "Python version '${{ inputs.python_version_build }}' is not supported."
echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
echo "Supported versions are: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_cd_updated_default_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ jobs:
exit 1
fi
if [[ ! "${{ inputs.python_version }}" =~ ^3\.([7-9]|1[0-4])(\..*)?$ ]]; then
if [[ ! "${{ inputs.python_version }}" =~ ^3\.([8-9]|1[0-4])(\..*)?$ ]]; then
echo "Python version '${{ inputs.python_version }}' is not supported."
echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
echo "Supported versions are: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_check_pyproject_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ jobs:
- name: Validate inputs
id: validate_inputs
run: |
if [[ ! "${{ inputs.python_version }}" =~ ^3\.([7-9]|1[0-4])(\..*)?$ ]]; then
if [[ ! "${{ inputs.python_version }}" =~ ^3\.([8-9]|1[0-4])(\..*)?$ ]]; then
echo "Python version '${{ inputs.python_version }}' is not supported."
echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
echo "Supported versions are: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ jobs:
- name: Validate inputs
run: |
if [[ "${{ steps.determine_framework.outputs.framework }}" == "mkdocs" && ! "${{ inputs.python_version_docs }}" =~ ^3\.([7-9]|1[0-4])(\..*)?$ ]]; then
if [[ "${{ steps.determine_framework.outputs.framework }}" == "mkdocs" && ! "${{ inputs.python_version_docs }}" =~ ^3\.([8-9]|1[0-4])(\..*)?$ ]]; then
echo "Python version '${{ inputs.python_version_docs }}' is not supported."
echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
echo "Supported versions are: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14."
exit 1
fi
Expand Down
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# To install the git pre-commit hook run:
# pre-commit install
default_language_version:
python: python3.9

Expand All @@ -23,12 +21,11 @@ repos:
# the language
# It works on files in-place
- repo: https://github.com/asottile/pyupgrade
# Latest version for Python 3.7: 3.3.2
# Latest version for Python 3.8: 3.8.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]

# Black is a code style and formatter
# It works on files in-place
Expand Down
4 changes: 2 additions & 2 deletions docs/workflows/ci_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
uses: SINTEF/ci-cd/.github/workflows/[email protected]
with:
python_version_pylint_safety: "3.8"
python_version_docs: "3.7"
python_version_docs: "3.9"
install_extras: "[dev,docs]"
skip_pre-commit_hooks: pylint
pylint_options: --rcfile=pyproject.toml
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
uses: SINTEF/ci-cd/.github/workflows/[email protected]
with:
python_version_pylint_safety: "3.8"
python_version_docs: "3.7"
python_version_docs: "3.9"
install_extras: "[dev,docs]"
skip_pre-commit_hooks: pylint
pylint_runs: |
Expand Down
29 changes: 12 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers = [
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -29,34 +28,30 @@ classifiers = [
"Private :: Do Not Upload",
]
keywords = ["ci", "cd", "pre-commit"]
requires-python = "~=3.7"
requires-python = "~=3.8"
dynamic = ["version", "description"]

dependencies = [
"invoke ~=2.2",
"packaging ~=24.0",
"tomlkit ~=0.12.5",
"typing-extensions ~=4.7; python_version < '3.8'",
"typing-extensions ~=4.12; python_version >= '3.8'",
"packaging ~=24.2",
"tomlkit ~=0.13.2",
"typing-extensions ~=4.12",
]

[project.optional-dependencies]
docs = [
"mike ~=2.1",
"mkdocs ~=1.5",
"mkdocs ~=1.6",
"mkdocs-awesome-pages-plugin ~=2.9",
"mkdocs-material ~=9.2; python_version < '3.8'",
"mkdocs-material ~=9.5; python_version >= '3.8'",
"mkdocstrings[python-legacy] ~=0.22.0; python_version < '3.8'",
"mkdocstrings[python-legacy] ~=0.26.1; python_version >= '3.8'",
"mkdocs-material ~=9.5",
"mkdocstrings[python-legacy] ~=0.26.1",
]
testing = [
"pytest ~=7.4",
"pytest-cov ~=4.1",
"pytest ~=8.3",
"pytest-cov ~=5.0",
]
dev = [
"pre-commit ~=2.21; python_version < '3.8'",
"pre-commit ~=3.5; python_version >= '3.8'",
"pre-commit ~=3.5",
"ci-cd[docs,testing]",
]

Expand All @@ -71,7 +66,7 @@ Changelog = "https://SINTEF.github.io/ci-cd/latest/CHANGELOG"
"ci-cd" = "ci_cd.main:program.run"

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
ignore_missing_imports = true
scripts_are_modules = true
warn_unused_configs = true
Expand All @@ -80,7 +75,7 @@ allow_redefinition = true
check_untyped_defs = true

[tool.pytest.ini_options]
minversion = "7.4"
minversion = "8.3"
addopts = ["-rs", "--cov=ci_cd", "--cov-report=term-missing:skip-covered"]
filterwarnings = ["error"]

Expand Down
10 changes: 5 additions & 5 deletions tests/tasks/test_update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_update_deps(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
data=f"""
[project]
name = "test"
requires-python = "~=3.7"
requires-python = "~=3.8"
dependencies = [
"invoke ~={original_dependencies['invoke']}",
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_update_deps(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
expected_updated_pyproject_file = f"""
[project]
name = "test"
requires-python = "~=3.7"
requires-python = "~=3.8"
dependencies = [
"invoke ~={original_dependencies['invoke']}",
Expand Down Expand Up @@ -353,7 +353,7 @@ def test_ignore_rules_logic(
data="""
[project]
name = "test"
requires-python = "~=3.7"
requires-python = "~=3.8"
dependencies = [
"invoke ~=1.7",
Expand Down Expand Up @@ -641,7 +641,7 @@ def test_non_parseable_pyproject_toml(tmp_path: Path) -> None:

@pytest.mark.parametrize(
"requires_python",
["", 'requires-python = "invalid"', 'requires-python = "3.7"'],
["", 'requires-python = "invalid"', 'requires-python = "3.8"'],
ids=["missing", "invalid", "missing operator"],
)
def test_no_requires_python_in_pyproject_toml(
Expand Down Expand Up @@ -681,7 +681,7 @@ def test_missing_project_package_name(tmp_path: Path) -> None:
pyproject_file.write_text(
data="""
[project]
requires-python = "~=3.7"
requires-python = "~=3.8"
""",
encoding="utf8",
)
Expand Down

0 comments on commit ea277eb

Please sign in to comment.