From 0851efc399e69a33937e45110c75ad030ea84392 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 22 May 2026 20:27:31 +0200 Subject: [PATCH] Add devcontainer and validation hatch support Signed-off-by: Pierre R. Mai --- .devcontainer/devcontainer-lock.json | 9 +++++++++ .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ pyproject.toml | 18 +++++++++++------- 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..495e683 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,9 @@ +{ + "features": { + "ghcr.io/devcontainers-extra/features/hatch:2": { + "version": "2.0.18", + "resolved": "ghcr.io/devcontainers-extra/features/hatch@sha256:79fc7fb2935a76732e6a72f81d674b7e6416570bba8b27c3c359bd28e9d03cd3", + "integrity": "sha256:79fc7fb2935a76732e6a72f81d674b7e6416570bba8b27c3c359bd28e9d03cd3" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..9d1f0b0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie", + "features": { + "ghcr.io/devcontainers-extra/features/hatch:2": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/pyproject.toml b/pyproject.toml index 2f14494..70280e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dev = [ "types-lxml>=2024.0", ] validation = [ - "osc-validation @ git+https://github.com/PMSFIT/osc-validation.git", + "osc-validation @ git+https://github.com/PMSFIT/osc-validation.git@feature/reorganize-pytest-setup", "pytest-html>=4.2", ] @@ -42,12 +42,8 @@ packages = ["src/osc_simulator"] allow-direct-references = true [tool.hatch.envs.default] -dependencies = [ - "pytest>=7.0", - "pytest-cov>=4.0", - "ruff>=0.4", - "mypy>=1.0", - "types-lxml>=2024.0", +features = [ + "dev", ] [tool.hatch.envs.default.scripts] @@ -72,3 +68,11 @@ select = ["E", "F", "I", "UP", "N", "B", "SIM"] python_version = "3.10" strict = true ignore_missing_imports = true + +[tool.hatch.envs.validation] +features = [ + "validation", +] + +[tool.hatch.envs.validation.scripts] +validate = "osc-validate --tool OscSimulator --toolpath $(which osc-simulator) {args}"