From fbb1146c1bb2ad8981186f8d2403c124312a93f1 Mon Sep 17 00:00:00 2001 From: "Reza (Shahin) Khanipour" Date: Mon, 22 Jul 2024 12:19:41 +0200 Subject: [PATCH] feat(python): run pytest command at `devenv test`. --- devenv.nix | 1 + pdm.lock | 49 +------------------ .../.test.sh | 4 ++ 3 files changed, 6 insertions(+), 48 deletions(-) create mode 100755 template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.test.sh diff --git a/devenv.nix b/devenv.nix index 49132b6..f0d0644 100644 --- a/devenv.nix +++ b/devenv.nix @@ -48,6 +48,7 @@ enterShell = '' pdm install --no-self ''; + # Make diffs fantastic difftastic.enable = true; diff --git a/pdm.lock b/pdm.lock index cf94fa0..8a665c3 100644 --- a/pdm.lock +++ b/pdm.lock @@ -4,21 +4,15 @@ [metadata] groups = ["default", "dev"] strategy = ["inherit_metadata"] -lock_version = "4.5.0" +lock_version = "4.4.2" content_hash = "sha256:15c0f3cfaacf64be5a3ff24a5bf64fddc5e1da4398c0ba45964eb620caae0012" -[[metadata.targets]] -requires_python = ">=3.11.0" - [[package]] name = "annotated-types" version = "0.7.0" requires_python = ">=3.8" summary = "Reusable constraint types to use with typing.Annotated" groups = ["default"] -dependencies = [ - "typing-extensions>=4.0.0; python_version < \"3.9\"", -] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -41,9 +35,6 @@ version = "23.2.0" requires_python = ">=3.7" summary = "Classes Without Boilerplate" groups = ["dev"] -dependencies = [ - "importlib-metadata; python_version < \"3.8\"", -] files = [ {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, @@ -112,14 +103,12 @@ dependencies = [ "charset-normalizer<4,>=2.1.0", "colorama<0.5.0,>=0.4.1", "decli<0.7.0,>=0.6.0", - "importlib-metadata<9,>=8.0.0; python_version < \"3.10\"", "jinja2>=2.10.3", "packaging>=19", "pyyaml>=3.08", "questionary<3.0,>=2.0", "termcolor<3,>=1.1", "tomlkit<1.0.0,>=0.5.3", - "typing-extensions<5.0.0,>=4.0.1; python_version < \"3.8\"", ] files = [ {file = "commitizen-3.28.0-py3-none-any.whl", hash = "sha256:372dba10bb082be0e571cfa9ac0946f4333c3f4b2e242fbe32ae2f2afea143e4"}, @@ -135,7 +124,6 @@ groups = ["default"] dependencies = [ "colorama>=0.4.6", "dunamai>=1.7.0", - "eval-type-backport<0.3.0,>=0.1.3; python_version < \"3.10\"", "funcy>=1.17", "jinja2-ansible-filters>=1.3.1", "jinja2>=3.1.4", @@ -146,7 +134,6 @@ dependencies = [ "pygments>=2.7.1", "pyyaml>=5.3.1", "questionary>=1.8.1", - "typing-extensions<5.0.0,>=3.7.4; python_version < \"3.9\"", ] files = [ {file = "copier-9.3.1-py3-none-any.whl", hash = "sha256:20d60383a3fb99054ea4d24a8f71c6f9219b40ac50db1d97d412583d739bce99"}, @@ -171,7 +158,6 @@ requires_python = ">=3.5" summary = "Dynamic version generation" groups = ["default"] dependencies = [ - "importlib-metadata>=1.6.0; python_version < \"3.8\"", "packaging>=20.9", ] files = [ @@ -185,7 +171,6 @@ version = "0.9.1" summary = "colorful TAB completion for Python prompt" groups = ["dev"] dependencies = [ - "pyreadline; platform_system == \"Windows\"", "pyrepl>=0.8.2", ] files = [ @@ -304,9 +289,6 @@ version = "1.8.3" requires_python = ">=3.6" summary = "Plumbum: shell combinators library" groups = ["default"] -dependencies = [ - "pywin32; platform_system == \"Windows\" and platform_python_implementation != \"PyPy\"", -] files = [ {file = "plumbum-1.8.3-py3-none-any.whl", hash = "sha256:8595d36dae2472587d6f59789c8d7b26250f45f6f6ed75ccb378de59ee7b9cf9"}, {file = "plumbum-1.8.3.tar.gz", hash = "sha256:6092c85ab970b7a7a9d5d85c75200bc93be82b33c9bdf640ffa87d2d7c8709f0"}, @@ -335,7 +317,6 @@ groups = ["default"] dependencies = [ "annotated-types>=0.4.0", "pydantic-core==2.20.1", - "typing-extensions>=4.12.2; python_version >= \"3.13\"", "typing-extensions>=4.6.1; python_version < \"3.13\"", ] files = [ @@ -403,16 +384,6 @@ files = [ {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, ] -[[package]] -name = "pyreadline" -version = "2.1" -summary = "A python implmementation of GNU readline." -groups = ["dev"] -marker = "platform_system == \"Windows\"" -files = [ - {file = "pyreadline-2.1.zip", hash = "sha256:4530592fc2e85b25b1a9f79664433da09237c1a270e4d78ea5aa3a2c7229e2d1"}, -] - [[package]] name = "pyrepl" version = "0.9.0" @@ -422,21 +393,6 @@ files = [ {file = "pyrepl-0.9.0.tar.gz", hash = "sha256:292570f34b5502e871bbb966d639474f2b57fbfcd3373c2d6a2f3d56e681a775"}, ] -[[package]] -name = "pywin32" -version = "306" -summary = "Python for Window Extensions" -groups = ["default"] -marker = "platform_system == \"Windows\" and platform_python_implementation != \"PyPy\"" -files = [ - {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, - {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, - {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, - {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, - {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, - {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, -] - [[package]] name = "pyyaml" version = "6.0.1" @@ -514,9 +470,6 @@ name = "wcwidth" version = "0.2.13" summary = "Measures the displayed width of unicode strings in a terminal" groups = ["default", "dev"] -dependencies = [ - "backports-functools-lru-cache>=1.2.1; python_version < \"3.2\"", -] files = [ {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"}, diff --git a/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.test.sh b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.test.sh new file mode 100755 index 0000000..f1a36b2 --- /dev/null +++ b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.test.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +pytest -vv