From 80510753a6b5f51f989b78c8bc45f925e67b682a Mon Sep 17 00:00:00 2001 From: Joe Ziminski <55797454+JoeZiminski@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:34:50 +0100 Subject: [PATCH] Port tox.ini to pyproject.toml (#66) * Port tox.ini to pyproject.toml * Update tests. --- tests/test_cookiecutter.py | 3 ++- {{cookiecutter.package_name}}/pyproject.toml | 19 +++++++++++++++++++ {{cookiecutter.package_name}}/tox.ini | 15 --------------- 3 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 {{cookiecutter.package_name}}/tox.ini diff --git a/tests/test_cookiecutter.py b/tests/test_cookiecutter.py index d29b265..2587e65 100644 --- a/tests/test_cookiecutter.py +++ b/tests/test_cookiecutter.py @@ -144,7 +144,6 @@ def test_directory_names(package_path_config_dict): "MANIFEST.in", "pyproject.toml", "README.md", - "tox.ini", Path("test_cookiecutter_module") / "__init__.py", # Directories "test_cookiecutter_module", @@ -298,6 +297,8 @@ def test_pyproject_toml(package_path_config_dict): ) assert project_toml["tool"]["black"] + assert "legacy_tox_ini" in project_toml["tool"]["tox"] + def test_pip_install(pip_install): config_dict = pip_install diff --git a/{{cookiecutter.package_name}}/pyproject.toml b/{{cookiecutter.package_name}}/pyproject.toml index 9d64fcd..3b70c40 100644 --- a/{{cookiecutter.package_name}}/pyproject.toml +++ b/{{cookiecutter.package_name}}/pyproject.toml @@ -130,3 +130,22 @@ build = "cp38-* cp39-* cp310-*" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py{38,39,310} +isolated_build = True + +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + +[testenv] +extras = + dev +commands = + pytest -v --color=yes --cov={{cookiecutter.module_name}} --cov-report=xml +""" diff --git a/{{cookiecutter.package_name}}/tox.ini b/{{cookiecutter.package_name}}/tox.ini deleted file mode 100644 index 33e0adf..0000000 --- a/{{cookiecutter.package_name}}/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -[tox] -envlist = py{38,39,310} -isolated_build = True - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - -[testenv] -extras = - dev -commands = - pytest -v --color=yes --cov={{cookiecutter.module_name}} --cov-report=xml