Skip to content

Commit

Permalink
Update copier template (#11)
Browse files Browse the repository at this point in the history
* Update copier template

* Upgrade ruff to latest version
  • Loading branch information
SRv6d authored Nov 8, 2023
1 parent aad08e3 commit 1e10c64
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.9.0
_commit: v0.10.1
_src_path: gh:srv6d/python-copier
author_email: [email protected]
author_name: Marvin Vogt
Expand All @@ -15,5 +15,6 @@ project_slug: anycastd
python_versions:
- '3.10'
- '3.11'
- '3.12'
repository_namespace: gecio

1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"charliermarsh.ruff",
"EditorConfig.EditorConfig"
]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python_version: ["3.10", "3.11"]
python_version: ["3.10", "3.11", "3.12"]
nox_session:
- ruff
- black
- mypy
- lockfile
- pytest
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="ruff">
</a>
<a>
<img src="https://img.shields.io/badge/black-black?style=flat&color=black&label=Style" alt="style">
</a>
<a href="https://github.com/python/mypy">
<img src="https://img.shields.io/badge/Types-Mypy-blue.svg" alt="typecheck">
</a>
Expand Down
16 changes: 8 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import nox

CI = bool(os.getenv("CI"))
PYTHON = ["3.10", "3.11"] if not CI else None
SESSIONS = "ruff", "mypy", "black", "lockfile", "pytest"
PYTHON = ["3.10", "3.11", "3.12"] if not CI else None
SESSIONS = "ruff", "mypy", "lockfile", "pytest"

nox.options.sessions = SESSIONS
os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"})
Expand Down Expand Up @@ -50,16 +50,16 @@ def pdm_check_lockfile(session: nox.Session) -> None:

@nox.session(python=PYTHON)
def ruff(session: nox.Session) -> None:
"""Code Style linting using ruff."""
"""Lint code and ensure formatting using ruff."""
pdm_sync(session, groups=["lint"])
session.run("ruff", "src", "tests")
session.run("ruff", "check", "src", "tests")
session.run("ruff", "format", "--check", "src", "tests")


@nox.session(python=PYTHON)
def black(session: nox.Session) -> None:
"""Check if style adheres to black."""
pdm_sync(session, groups=["lint"])
session.run("black", "--check", "src", "tests")
ruff(session)


@nox.session(python=PYTHON)
Expand Down Expand Up @@ -92,7 +92,7 @@ def pytest_fast(session: nox.Session) -> None:
to execute and might require external dependencies.
It is intended to be run multiple times during development.
"""
pdm_sync(session, self=True, default=True, groups=["test", "cli"])
pdm_sync(session, self=True, default=True, groups=["test"])
session.warn(
"Skipping e2e tests for faster execution. "
"To include them, run `nox -s pytest_full`."
Expand All @@ -109,7 +109,7 @@ def pytest_full(session: nox.Session) -> None:
This session includes all tests and is intended to be
run in CI or before a commit.
"""
pdm_sync(session, self=True, default=True, groups=["test", "cli"])
pdm_sync(session, self=True, default=True, groups=["test"])
args = session.posargs if not CI else ["--cov"]
session.run(
"pytest",
Expand Down
94 changes: 21 additions & 73 deletions pdm.lock

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

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
Expand All @@ -40,8 +41,7 @@ source = "scm"

[tool.pdm.dev-dependencies]
lint = [
"black",
"ruff",
"ruff>=0.1.4",
]
typecheck = [
"mypy",
Expand All @@ -64,7 +64,7 @@ jupyter = [
]

[tool.black]
target-version = ["py310", "py311"]
target-version = ["py310", "py311", "py312"]
include = '\.pyi?$'

[tool.ruff]
Expand Down

0 comments on commit 1e10c64

Please sign in to comment.