Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Jan 24, 2024
1 parent 552c69c commit 17c2dad
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
}
"editor.defaultFormatter": "charliermarsh.ruff",
},
}
4 changes: 1 addition & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ click==8.1.7
colorama==0.4.6
copier==9.1.1
decorator==5.1.1
deprecated==1.2.14
distlib==0.3.8
docutils==0.20.1
dunamai==1.19.0
Expand Down Expand Up @@ -52,11 +51,11 @@ pydata-sphinx-theme==0.15.2
pygments==2.17.2
pyproject-hooks==1.0.0
pytest==7.4.4
pytest-copie==0.1.5
pyyaml==6.0.1
pyyaml-include==1.3.2
questionary==2.0.1
requests==2.31.0
ruff==0.1.14
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.5
Expand All @@ -80,7 +79,6 @@ urllib3==2.1.0
virtualenv==20.25.0
wcwidth==0.2.13
wheel==0.42.0
wrapt==1.16.0

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
20 changes: 15 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dev = [
"pre-commit",
"pydata-sphinx-theme>=0.12",
"pytest",
"ruff",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-design",
Expand All @@ -32,23 +33,32 @@ legacy_tox_ini = """
[tox]
skipsdist=True
[testenv:{pre-commit,test,docs}]
[testenv:{pre-commit,pytest,docs}]
# Don't create a virtualenv for the command, requires tox-direct plugin
direct = True
passenv = *
allowlist_externals =
pre-commit
rm
ctt
git
pytest
sphinx-build
sphinx-autobuild
commands =
pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
test: ctt \n git -C python-copier-template-example add -N . \n git -C python-copier-template-example diff
pytest: pytest {posargs}
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
"""

[tool.ruff]
src = ["src", "tests"]
line-length = 88
select = [
"C4", # flake8-comprehensions - https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4
"E", # pycodestyle errors - https://beta.ruff.rs/docs/rules/#error-e
"F", # pyflakes rules - https://beta.ruff.rs/docs/rules/#pyflakes-f
"W", # pycodestyle warnings - https://beta.ruff.rs/docs/rules/#warning-w
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
]

[tool.pip-tools]
src-files = ["pyproject.toml"]
extras = ["dev"]
Expand Down
5 changes: 3 additions & 2 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from copier import run_copy
import shutil
from pathlib import Path

import treecomp
import yaml
import shutil
from copier import run_copy

TOP = Path(__file__).absolute().parent.parent
INPUT = TOP / "python-copier-template-example"
Expand Down

0 comments on commit 17c2dad

Please sign in to comment.