Skip to content

Commit

Permalink
passed local pytest, pylint, coverage using tox for template (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxochicale committed Aug 23, 2023
1 parent bf61ec1 commit 14f50c7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 49 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ How to use

conda create -n ssptVE pip -c conda-forge
conda activate ssptVE
pip install cookiecutter tox>=4
python -m pip install -e ".[dev]"


2. Test template using `tox` and `pytest`
Expand All @@ -133,7 +133,7 @@ See "List of parameters for cookiecutter" below.

cd MyNewProject
git init
pip install -r requirements-dev.txt
python -m pip install -e ".[dev]"
git add .
git commit -m "Initial commit of My New Project"

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python",
]
dependencies = [
]
optional-dependencies = {dev = [
"cookiecutter",
"tox>=4",
]}

[project.urls]
homepage = "https://https://github.com/SciKit-Surgery/PythonTemplate"
Expand Down
17 changes: 17 additions & 0 deletions {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ classifiers=[
dependencies = [
"numpy",
]
optional-dependencies = {dev = [
"twine",
"coverage",
"mock",
"pyfakefs",
"parameterized",
"pylint",
"pytest",
"pyinstaller",
"tox>=4",
"tox-conda",
"build",
"six",
"docutils",
"sphinx",
"sphinx_rtd_theme",
]}
dynamic = [
"version",
]
Expand Down
20 changes: 0 additions & 20 deletions {{cookiecutter.project_slug}}/requirements-dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions {{cookiecutter.project_slug}}/requirements-docs.txt

This file was deleted.

5 changes: 0 additions & 5 deletions {{cookiecutter.project_slug}}/requirements.txt

This file was deleted.

27 changes: 10 additions & 17 deletions {{cookiecutter.project_slug}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
[tox]
envlist = py38,lint,docs
envlist = py3{8,9,10,11,12},lint,docs
skipsdist = True
requires = tox-conda

[testenv]
deps=-rrequirements-dev.txt
deps =
coverage
pytest
; commands_pre=ipython kernel install --user --name={{ cookiecutter.pkg_name }}
# See .coveragerc for list of omitted files
commands = coverage erase
coverage run -a --source {{ cookiecutter.pkg_name }} -m pytest -v -s tests/
coverage report -m

[testenv:lint]
deps=pylint
{[testenv]deps}
deps=
pylint
{[testenv]deps}
commands=pylint --rcfile=tests/pylintrc {{ cookiecutter.pkg_name }}

[testenv:docs]
changedir = docs
deps=-rrequirements-docs.txt
deps=
sphinx
sphinx_rtd_theme
commands = sphinx-build -M html . build

; [testenv:installer]
; basepython=python3.8
; commands=pyinstaller --onefile {{ cookiecutter.pkg_name }}.py --noconfirm --windowed
;
; [testenv:pip3]
; basepython=python3.8
; changedir=pip_test
; skip_install=True
; commands = pip install {posargs}
; {{ cookiecutter.pkg_name }} --help

0 comments on commit 14f50c7

Please sign in to comment.