aboutsummaryrefslogtreecommitdiff
path: root/challenge-286/ppentchev/python/tox.ini
diff options
context:
space:
mode:
authorPeter Pentchev <roam@ringlet.net>2024-09-10 23:49:05 +0300
committerPeter Pentchev <roam@ringlet.net>2024-09-11 21:32:24 +0300
commit7b0cce752eca91696664c2bb0de3c5e0395f3fda (patch)
tree9f9c62c53aecdc669cec6ff05d19a478b0895bf7 /challenge-286/ppentchev/python/tox.ini
parentcbf28e6e924b7cd24d1614a5ad28d801f0e85dea (diff)
downloadperlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.tar.gz
perlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.tar.bz2
perlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.zip
Add Peter Pentchev's Python solutions to 286
Also fix a couple of things in the other files: - make the TAP test functions accept an arrayref for the command to run instead of a single string, since we want to run the Python solution using `python3 -B -u /path/to/the/program` - fix the use of Test::More::skip() in the Self Spammer test function - fix a shadowed variable in the Order Game test function - correct the indentation in the documentation's "Implementation details" section - make the README file a copy of docs/index.md instead of a wrong copy of a completely different project's README file - point blog.txt to the Ringlet copy of this challenge's documentation
Diffstat (limited to 'challenge-286/ppentchev/python/tox.ini')
-rw-r--r--challenge-286/ppentchev/python/tox.ini71
1 files changed, 71 insertions, 0 deletions
diff --git a/challenge-286/ppentchev/python/tox.ini b/challenge-286/ppentchev/python/tox.ini
new file mode 100644
index 0000000000..5d113b5fd0
--- /dev/null
+++ b/challenge-286/ppentchev/python/tox.ini
@@ -0,0 +1,71 @@
+# SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
+# SPDX-License-Identifier: BSD-2-Clause
+
+[tox]
+minversion = 4.1
+envlist =
+ ruff
+ format
+ mypy
+isolated_build = True
+
+[defs]
+pyfiles =
+ scripts/ch-1.py \
+ scripts/ch-2.py
+
+[testenv:ruff]
+skip_install = True
+tags =
+ check
+ ruff
+ quick
+deps =
+ -r requirements/ruff.txt
+commands =
+ ruff check -- {[defs]pyfiles}
+
+[testenv:format]
+skip_install = True
+tags =
+ check
+ quick
+deps =
+ -r requirements/ruff.txt
+commands =
+ ruff check --config ruff-base.toml --select=D,I --diff -- {[defs]pyfiles}
+ ruff format --config ruff-base.toml --check --diff -- {[defs]pyfiles}
+
+[testenv:reformat]
+skip_install = True
+tags =
+ format
+ manual
+deps =
+ -r requirements/ruff.txt
+commands =
+ ruff check --config ruff-base.toml --select=D,I --fix -- {[defs]pyfiles}
+ ruff format --config ruff-base.toml -- {[defs]pyfiles}
+
+[testenv:mypy]
+skip_install = True
+tags =
+ check
+deps =
+ mypy >= 1, < 2
+setenv =
+ MYPYPATH = {toxinidir}/stubs
+commands =
+ mypy {[defs]pyfiles}
+
+[testenv:pyupgrade]
+skip_install = True
+tags =
+ check
+ manual
+deps =
+ pyupgrade >= 3, < 4
+allowlist_externals =
+ sh
+commands =
+ sh -c 'pyupgrade --py311-plus scripts/*.py'