Skip to content

Commit

Permalink
PWSH -> nox
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Nov 24, 2024
1 parent 70ee6c1 commit 5a59c1d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 126 deletions.
5 changes: 0 additions & 5 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"features": {
"ghcr.io/devcontainers/features/powershell:1": {
"version": "1.3.5",
"resolved": "ghcr.io/devcontainers/features/powershell@sha256:0dd4e0352cc77ef586f7cca2414d3e8a7c506ad6df9ecd2221d078a961425bd6",
"integrity": "sha256:0dd4e0352cc77ef586f7cca2414d3e8a7c506ad6df9ecd2221d078a961425bd6"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "1.6.1",
"resolved": "ghcr.io/devcontainers/features/python@sha256:d449aea663ea23ac4a7968719d5920dd57128f0429cd8e216849d5afe67651fb",
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"installTools": false
},
"ghcr.io/devcontainers/features/powershell:1": {}
}
}
}
119 changes: 0 additions & 119 deletions make.ps1

This file was deleted.

52 changes: 52 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Noxfile."""

import shutil
from pathlib import Path

import nox

nox.options.default_venv_backend = "none"
nox.options.sessions = ["lints"]


CLEANABLE_TARGETS = [
"./dist",
"./build",
"./.nox",
"./.coverage",
"./.coverage.*",
"./coverage.json",
"./**/.mypy_cache",
"./**/.pytest_cache",
"./**/__pycache__",
"./**/*.pyc",
"./**/*.pyo",
]


@nox.session
def tests(session: nox.Session) -> None:
"""Run tests."""
session.run("pytest")


@nox.session
def lints(session: nox.Session) -> None:
"""Run lints."""
session.run("pre-commit", "run", "--all-files")
session.run("ruff", "format", ".")
session.run("ruff", "check", "--fix", ".")
session.run("mypy", "--strict", "src/")


@nox.session
def clean(_: nox.Session) -> None:
"""Clean cache, .pyc, .pyo, and test/build artifact files from project."""
count = 0
for searchpath in CLEANABLE_TARGETS:
for filepath in Path().glob(searchpath):
if filepath.is_dir():
shutil.rmtree(filepath)
else:
filepath.unlink()
count += 1
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ documentation = "https://docs.letsbuilda.dev/letsbuilda-pypi/"
[project.optional-dependencies]
dev = [
"pre-commit",
"nox",
"ruff",
"mypy",
"types-xmltodict",
Expand Down

0 comments on commit 5a59c1d

Please sign in to comment.