Skip to content

Commit

Permalink
Merge pull request #373 from py-cov-action/py3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim authored Feb 28, 2024
2 parents 6716737 + dbd8dbd commit 21522e9
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 194 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install Poetry
# https://github.com/pypa/pipx/issues/1195
run: |
pipx install poetry --python="$(command -v python3.11)"
pipx install poetry --python="$(command -v python3.12)"
- name: Poetry caches
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-external-phase-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install Poetry
# https://github.com/pypa/pipx/issues/1195
run: |
pipx install poetry --python="$(command -v python3.11)"
pipx install poetry --python="$(command -v python3.12)"
- name: Poetry caches
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: docker/build-push-action@v5
with:
# See Dockerfile.build for instructions on bumping this.
tags: ewjoachim/python-coverage-comment-action-base:v5
tags: ewjoachim/python-coverage-comment-action-base:v6
push: true
file: Dockerfile.build

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.11
python: python3.12

ci:
# Renovate updates the file. We can't disable pre-commit CI's autoupdate entirely
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You're welcome to contribute, though I can't promise the experience will be as s

### Things to know:

- Python3.11
- Python3.12
- Use [Poetry](https://python-poetry.org/)
- Launch tests with `pytest`, config is in setup.cfg
- `ruff` runs through `pre-commit`, so you can install hooks with `pre-commit install`.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See Dockerfile.build for instructions on bumping this.
FROM ewjoachim/python-coverage-comment-action-base:v5
FROM ewjoachim/python-coverage-comment-action-base:v6

COPY coverage_comment ./coverage_comment
RUN md5sum -c pyproject.toml.md5 || pip install -e .
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# - Dockerfile
# - .github/workflows/release.yml

FROM python:3.11-slim
FROM python:3.12-slim

RUN set -eux; \
apt-get update; \
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ include = ["coverage_comment/default.md.j2"]
coverage_comment = 'coverage_comment.main:main'

[project]
requires-python = ">=3.11"
requires-python = ">=3.12"

[tool.poetry.dependencies]
python = "^3.11"
python = "^3.12"
coverage = { version = "*", extras = ["toml"] }
httpx = { version = "*", extras = ["http2"] }
Jinja2 = "*"
Expand Down Expand Up @@ -59,6 +59,9 @@ show_contexts = true
[tool.mypy]
no_implicit_optional = true

[tool.ruff]
target-version = "py312"

[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
Expand Down
10 changes: 3 additions & 7 deletions tests/end_to_end/repo/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"
python-version: "3.12"

- run: poetry install
- run: pip install -e .
working-directory: __ACTION_COVERAGE_PATH__

- run: poetry run pytest
- run: pytest
working-directory: __ACTION_COVERAGE_PATH__

- name: Coverage comment
Expand Down
156 changes: 0 additions & 156 deletions tests/end_to_end/repo/poetry.lock

This file was deleted.

25 changes: 11 additions & 14 deletions tests/end_to_end/repo/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
[tool.poetry]
name = "end_to_end_tests_repo"
version = "0.1.0"
description = ""
authors = ["Joachim Jablon <ewjoachim@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.poetry.dev-dependencies]
pytest = "*"
pytest-cov = "*"
[project]
name = "end-to-end-tests"
version = "0.0.0"
dependencies = [
"pytest",
"pytest-cov",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.setuptools.packages.find]
7 changes: 4 additions & 3 deletions tests/unit/test_log_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@


def test_level_mapping__all_supported():
# TODO Python 3.11: replace logging._levelToName with
# logging.getLevelNamesMapping()
ignored = {
logging.getLevelName("NOTSET"),
logging.getLevelName("TRACE"),
}
assert set(log_utils.LEVEL_MAPPING) == set(logging._levelToName) - ignored
assert (
set(log_utils.LEVEL_MAPPING)
== set(logging.getLevelNamesMapping().values()) - ignored
)


def test__github_formatter():
Expand Down

0 comments on commit 21522e9

Please sign in to comment.