From 353322bae6bb5327316d0a4201e27d28a0b76399 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 8 Nov 2024 13:47:22 -0800 Subject: [PATCH 1/4] For spin test, add src/tests layout handling - When `./tests` is present, try to test that instead of packagename - If src layout is used, there's no need to switch away from the source directory when testing - No longer use import-mode=importlib, which meant that packages could not do relative imports in tests --- spin/cmds/meson.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/spin/cmds/meson.py b/spin/cmds/meson.py index b5a2fe9..cd9c43d 100644 --- a/spin/cmds/meson.py +++ b/spin/cmds/meson.py @@ -499,12 +499,16 @@ def test( raise SystemExit(1) # User did not specify what to test, so we test - # the full package + # the full package, or the tests directory if that is present if not (pytest_args or tests): - pytest_args = ("--pyargs", package) + if os.path.isdir("./tests"): + # tests dir exists, presuming you are not shipping tests + # with your package, and prefer to run those instead + pytest_args = (os.path.abspath("./tests"),) + else: + pytest_args = ("--pyargs", package) elif tests: if (os.path.sep in tests) or ("/" in tests): - # Tests specified as file path pytest_args = pytest_args + (tests,) else: # Otherwise tests given as modules @@ -549,9 +553,6 @@ def test( if (n_jobs != "1") and ("-n" not in pytest_args): pytest_args = ("-n", str(n_jobs)) + pytest_args - if not any("--import-mode" in arg for arg in pytest_args): - pytest_args = ("--import-mode=importlib",) + pytest_args - if verbose: pytest_args = ("-v",) + pytest_args @@ -577,8 +578,11 @@ def test( if not os.path.exists(install_dir): os.mkdir(install_dir) + # Unless we have a src layout, we need to switch away from the current directory into build install to avoid importing ./package instead of the built package. + test_path = site_path if not os.path.isdir("./src") else None + cwd = os.getcwd() - pytest_p = _run(cmd + list(pytest_args), cwd=site_path) + pytest_p = _run(cmd + list(pytest_args), cwd=test_path) os.chdir(cwd) if gcov: From e1de6ae422f225d50addcc430efd338704b93846 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 8 Nov 2024 14:13:46 -0800 Subject: [PATCH 2/4] Add src layout test package --- example_pkg_src/.gitattributes | 2 + example_pkg_src/.gitignore | 5 ++ example_pkg_src/.spin/cmds.py | 35 ++++++++++ example_pkg_src/meson.build | 20 ++++++ example_pkg_src/pyproject.toml | 64 +++++++++++++++++++ example_pkg_src/src/__init__.py | 4 ++ example_pkg_src/src/conftest.py | 0 example_pkg_src/src/coremodule.c | 44 +++++++++++++ example_pkg_src/src/meson.build | 18 ++++++ example_pkg_src/src/submodule/__init__.py | 0 .../tests/submodule/test_submodule.py | 2 + example_pkg_src/tests/test_core.py | 6 ++ spin/tests/conftest.py | 17 +++-- spin/tests/test_build_cmds.py | 30 ++++----- spin/tests/test_cli.py | 4 +- spin/tests/test_editable.py | 4 +- spin/tests/test_test.py | 44 +++++++++---- 17 files changed, 265 insertions(+), 34 deletions(-) create mode 100644 example_pkg_src/.gitattributes create mode 100644 example_pkg_src/.gitignore create mode 100644 example_pkg_src/.spin/cmds.py create mode 100644 example_pkg_src/meson.build create mode 100644 example_pkg_src/pyproject.toml create mode 100644 example_pkg_src/src/__init__.py create mode 100644 example_pkg_src/src/conftest.py create mode 100644 example_pkg_src/src/coremodule.c create mode 100644 example_pkg_src/src/meson.build create mode 100644 example_pkg_src/src/submodule/__init__.py create mode 100644 example_pkg_src/tests/submodule/test_submodule.py create mode 100644 example_pkg_src/tests/test_core.py diff --git a/example_pkg_src/.gitattributes b/example_pkg_src/.gitattributes new file mode 100644 index 0000000..1a13b26 --- /dev/null +++ b/example_pkg_src/.gitattributes @@ -0,0 +1,2 @@ +.* export-ignore +.spin -export-ignore diff --git a/example_pkg_src/.gitignore b/example_pkg_src/.gitignore new file mode 100644 index 0000000..d69b16e --- /dev/null +++ b/example_pkg_src/.gitignore @@ -0,0 +1,5 @@ +build +build-install +.mesonpy-native-file.ini +dist/ +doc/_build diff --git a/example_pkg_src/.spin/cmds.py b/example_pkg_src/.spin/cmds.py new file mode 100644 index 0000000..5e3dfe5 --- /dev/null +++ b/example_pkg_src/.spin/cmds.py @@ -0,0 +1,35 @@ +import json + +import click + +from spin import util + + +@click.command() +@click.option("-f", "--flag") +@click.option("-t", "--test", default="not set") +def example(flag, test, default_kwd=None): + """🧪 Example custom command. + + Accepts arbitrary flags, and shows how to access `pyproject.toml` + config. + """ + click.secho("Running example custom command", bold=True, fg="bright_blue") + print() + config = util.get_config() + commands = util.get_commands() + click.secho("Flag provided with --flag is: ", fg="yellow", nl=False) + print(flag or None) + + click.secho("Flag provided with --test is: ", fg="yellow", nl=False) + print(test or None) + + click.secho(f"Default kwd is: {default_kwd}") + + click.secho("\nDefined commands:", fg="yellow") + for section in commands: + print(f" {section}: ", end="") + print(", ".join(cmd.name for cmd in commands[section])) + + click.secho("\nTool config is:", fg="yellow") + print(json.dumps(config["tool.spin"], indent=2)) diff --git a/example_pkg_src/meson.build b/example_pkg_src/meson.build new file mode 100644 index 0000000..6ad6ce2 --- /dev/null +++ b/example_pkg_src/meson.build @@ -0,0 +1,20 @@ +project( + 'spin-example-pkg', + 'c', + version: '0.0.dev0', + license: 'BSD-3', + meson_version: '>= 0.64', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=c99', + 'cpp_std=c++14', + ], +) + +cc = meson.get_compiler('c') + +py_mod = import('python') +py = py_mod.find_installation(pure: false) +py_dep = py.dependency() + +subdir('src') diff --git a/example_pkg_src/pyproject.toml b/example_pkg_src/pyproject.toml new file mode 100644 index 0000000..1188a08 --- /dev/null +++ b/example_pkg_src/pyproject.toml @@ -0,0 +1,64 @@ +[project] +name = "example_pkg" +version = "0.0dev0" +requires-python = ">=3.7" +description = "spin Example Package" + +[build-system] +build-backend = "mesonpy" +requires = [ + "meson-python>=0.13.0rc0", +] + +[tool.spin] +package = 'example_pkg' + +[tool.spin.commands] +# If you don't need sections, you can also provide a list of commands under [tool.spin]: +# +# commands = [ +# "spin.cmds.meson.build", +# "spin.cmds.meson.test", +# "spin.cmds.meson.shell", +# "spin.cmds.meson.ipython", +# "spin.cmds.meson.python", +# ".spin/cmds.py:example" +# ] + +"Build" = [ + "spin.cmds.meson.build", + "spin.cmds.meson.test", + "spin.cmds.build.sdist", +] +"Documentation" = [ + "spin.cmds.meson.docs" +] +"Environments" = [ + "spin.cmds.meson.shell", + "spin.cmds.meson.ipython", + "spin.cmds.meson.python", + "spin.cmds.meson.run" +] +"Debug" = [ + "spin.cmds.meson.gdb", + "spin.cmds.meson.lldb" +] +"Extensions" = [".spin/cmds.py:example"] +"Pip" = [ + "spin.cmds.pip.install" +] +"Meta" = [ + "spin.cmds.meta.introspect" +] + +[tool.spin.kwargs] +".spin/cmds.py:example" = {"test" = "default override", "default_kwd" = 3} + +# [tool.pytest.ini_options] +# pythonpath = ["src"] +# addopts = [ +# "--import-mode=importlib", +# ] +# testpaths = [ +# "tests", +# ] diff --git a/example_pkg_src/src/__init__.py b/example_pkg_src/src/__init__.py new file mode 100644 index 0000000..5a148b0 --- /dev/null +++ b/example_pkg_src/src/__init__.py @@ -0,0 +1,4 @@ +from ._core import echo + +__all__ = ["echo"] +__version__ = "0.0.0dev0" diff --git a/example_pkg_src/src/conftest.py b/example_pkg_src/src/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/example_pkg_src/src/coremodule.c b/example_pkg_src/src/coremodule.c new file mode 100644 index 0000000..1a0fd81 --- /dev/null +++ b/example_pkg_src/src/coremodule.c @@ -0,0 +1,44 @@ +#define PY_SSIZE_T_CLEAN +#include + +static PyObject * +core_echo(PyObject *self, PyObject *args) +{ + const char *str; + PyObject *ret; + + if (!PyArg_ParseTuple(args, "s", &str)) + return NULL; + + printf("%s\n", str); + + ret = PyLong_FromLong(42); + Py_INCREF(ret); + return ret; +} + +static PyMethodDef CoreMethods[] = { + {"echo", core_echo, METH_VARARGS, "Echo a string and return 42"}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +static struct PyModuleDef coremodule = { + PyModuleDef_HEAD_INIT, + "core", /* name of module */ + NULL, /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, + or -1 if the module keeps state in global variables. */ + CoreMethods +}; + +PyMODINIT_FUNC +PyInit__core(void) +{ + PyObject *m; + + m = PyModule_Create(&coremodule); + if (m == NULL) + return NULL; + + return m; +} diff --git a/example_pkg_src/src/meson.build b/example_pkg_src/src/meson.build new file mode 100644 index 0000000..a09310e --- /dev/null +++ b/example_pkg_src/src/meson.build @@ -0,0 +1,18 @@ +py.extension_module( + '_core', + 'coremodule.c', + install: true, + subdir: 'example_pkg' +) + +python_sources = [ + '__init__.py', + 'conftest.py' +] + +py.install_sources( + python_sources, + subdir: 'example_pkg' +) + +install_subdir('submodule', install_dir: py.get_install_dir() / 'example_pkg') diff --git a/example_pkg_src/src/submodule/__init__.py b/example_pkg_src/src/submodule/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/example_pkg_src/tests/submodule/test_submodule.py b/example_pkg_src/tests/submodule/test_submodule.py new file mode 100644 index 0000000..363b3e2 --- /dev/null +++ b/example_pkg_src/tests/submodule/test_submodule.py @@ -0,0 +1,2 @@ +def test_something(): + pass diff --git a/example_pkg_src/tests/test_core.py b/example_pkg_src/tests/test_core.py new file mode 100644 index 0000000..210d37d --- /dev/null +++ b/example_pkg_src/tests/test_core.py @@ -0,0 +1,6 @@ +from example_pkg import echo # type: ignore[attr-defined] + + +def test_core(): + ans = echo("hello world") + assert ans == 42 diff --git a/spin/tests/conftest.py b/spin/tests/conftest.py index 2b7b53d..b6f9c56 100644 --- a/spin/tests/conftest.py +++ b/spin/tests/conftest.py @@ -5,21 +5,30 @@ from spin import util -@pytest.fixture(autouse=True) -def pre_post_test(): +def dir_switcher(path): # Pre-test code cwd = os.getcwd() - os.chdir("example_pkg") + os.chdir(path) try: yield finally: # Post test code os.chdir(cwd) - util.run(["git", "clean", "-xdf"], cwd="example_pkg") + util.run(["git", "clean", "-xdf"], cwd=path) os.chdir(cwd) +@pytest.fixture() +def example_pkg(): + yield from dir_switcher("example_pkg") + + +@pytest.fixture() +def example_pkg_src_layout(): + yield from dir_switcher("example_pkg_src") + + @pytest.fixture def editable_install(): util.run(["pip", "install", "--quiet", "--no-build-isolation", "-e", "."]) diff --git a/spin/tests/test_build_cmds.py b/spin/tests/test_build_cmds.py index fe5ae18..c0625c2 100644 --- a/spin/tests/test_build_cmds.py +++ b/spin/tests/test_build_cmds.py @@ -17,7 +17,7 @@ from spin.cmds.util import run -def test_basic_build(): +def test_basic_build(example_pkg): """Does the package build?""" spin("build") @@ -27,7 +27,7 @@ def test_basic_build(): ).exists(), "`build-install` folder not created after `spin build`" -def test_debug_builds(): +def test_debug_builds(example_pkg): """Does spin generate gcov debug output files?""" spin("build", "--gcov") @@ -35,13 +35,13 @@ def test_debug_builds(): assert len(list(debug_files)) != 0, "debug files not generated for gcov build" -def test_prefix_builds(): +def test_prefix_builds(example_pkg): """does spin build --prefix create a build-install directory with the correct structure?""" spin("build", "--prefix=/foobar/") assert (Path("build-install") / Path("foobar")).exists() -def test_coverage_builds(): +def test_coverage_builds(example_pkg): """Does gcov test generate coverage files?""" spin("test", "--gcov") @@ -58,7 +58,7 @@ def test_coverage_builds(): ("sonarqube", Path("sonarqube.xml")), ], ) -def test_coverage_reports(report_type, output_file): +def test_coverage_reports(example_pkg, report_type, output_file): """Does gcov test generate coverage reports?""" spin("test", "--gcov", f"--gcov-format={report_type}") @@ -68,7 +68,7 @@ def test_coverage_reports(report_type, output_file): ), f"coverage report not generated for gcov build ({report_type})" -def test_expand_pythonpath(): +def test_expand_pythonpath(example_pkg): """Does an $ENV_VAR get expanded in `spin run`?""" output = spin("run", "echo $PYTHONPATH") assert any( @@ -76,7 +76,7 @@ def test_expand_pythonpath(): ), f"Expected value of $PYTHONPATH, got {stdout(output)} instead" -def test_run_stdout(): +def test_run_stdout(example_pkg): """Ensure `spin run` only includes command output on stdout.""" p = spin( "run", @@ -92,7 +92,7 @@ def test_run_stdout(): # Detecting whether a file is executable is not that easy on Windows, # as it seems to take into consideration whether that file is associated as an executable. @skip_on_windows -def test_recommend_run_python(): +def test_recommend_run_python(example_pkg): """If `spin run file.py` is called, is `spin run python file.py` recommended?""" with tempfile.NamedTemporaryFile(suffix=".py") as f: p = spin("run", f.name, sys_exit=False) @@ -101,20 +101,20 @@ def test_recommend_run_python(): ), "Failed to recommend `python run python file.py`" -def test_sdist(): +def test_sdist(example_pkg): spin("sdist") -def test_example(): +def test_example(example_pkg): spin("example") -def test_docs(): +def test_docs(example_pkg): run(["pip", "install", "--quiet", "sphinx"]) spin("docs") -def test_spin_install(): +def test_spin_install(example_pkg): cwd = os.getcwd() spin("install") with tempfile.TemporaryDirectory() as d: @@ -135,7 +135,7 @@ def test_spin_install(): @skip_unless_linux -def test_gdb(): +def test_gdb(example_pkg): p = spin( "gdb", "-c", @@ -149,7 +149,7 @@ def test_gdb(): @skip_unless_macos -def test_lldb(): +def test_lldb(example_pkg): p = spin( "lldb", "-c", @@ -163,7 +163,7 @@ def test_lldb(): @skip_py_lt_311 # python command does not run on older pythons -def test_parallel_builds(): +def test_parallel_builds(example_pkg): spin("build") spin("build", "-C", "parallel/build") p = spin("python", "--", "-c", "import example_pkg; print(example_pkg.__file__)") diff --git a/spin/tests/test_cli.py b/spin/tests/test_cli.py index 21f5c65..e315843 100644 --- a/spin/tests/test_cli.py +++ b/spin/tests/test_cli.py @@ -3,12 +3,12 @@ import spin as libspin -def test_get_version(): +def test_get_version(example_pkg): p = spin("--version") assert stdout(p) == f"spin {libspin.__version__}" -def test_arg_override(): +def test_arg_override(example_pkg): p = spin("example") assert "--test is: default override" in stdout(p) assert "Default kwd is: 3" in stdout(p) diff --git a/spin/tests/test_editable.py b/spin/tests/test_editable.py index b5e167e..0a5eff3 100644 --- a/spin/tests/test_editable.py +++ b/spin/tests/test_editable.py @@ -1,11 +1,11 @@ from testutil import spin, stdout -def test_detect_editable(editable_install): +def test_detect_editable(example_pkg, editable_install): assert "Editable install of same source detected" in stdout( spin("build") ), "Failed to detect and warn about editable install" -def test_editable_tests(editable_install): +def test_editable_tests(example_pkg, editable_install): spin("test") diff --git a/spin/tests/test_test.py b/spin/tests/test_test.py index e08b058..7f773e4 100644 --- a/spin/tests/test_test.py +++ b/spin/tests/test_test.py @@ -3,27 +3,49 @@ from testutil import spin -def test_test(): +def test_test(example_pkg): """Does the test command run?""" spin("test") -def test_test_with_pythonpath(): +def test_test_with_pythonpath(example_pkg): """Does `spin test` work when PYTHONPATH is set?""" - spin("test", env={**os.environ, "PYTHONPATH": "/tmp"}) + p = spin("test", env={**os.environ, "PYTHONPATH": "/tmp"}) + # Ensure more than zero tests ran + assert b"passed" in p.stdout -def test_test_file_spec(): - spin("test", "example_pkg/submodule/tests/test_submodule.py") +def test_test_file_spec(example_pkg): + p = spin("test", "example_pkg/submodule/tests/test_submodule.py") + # Ensure more than zero tests ran + assert b"passed" in p.stdout -def test_test_module_spec(): - spin("test", "example_pkg.submodule") +def test_test_module_spec(example_pkg): + p = spin("test", "example_pkg.submodule") + # Ensure more than zero tests ran + assert b"passed" in p.stdout -def test_test_editable_file_spec(editable_install): - spin("test", "example_pkg/submodule/tests/test_submodule.py") +def test_test_editable_file_spec(example_pkg, editable_install): + p = spin("test", "example_pkg/submodule/tests/test_submodule.py") + # Ensure more than zero tests ran + assert b"passed" in p.stdout -def test_test_editable_module_spec(editable_install): - spin("test", "example_pkg.submodule") +def test_test_editable_module_spec(example_pkg, editable_install): + p = spin("test", "example_pkg.submodule") + # Ensure more than zero tests ran + assert b"passed" in p.stdout + + +def test_test_source_layout(example_pkg_src_layout): + p = spin("test") + # Ensure more than zero tests ran + assert b"passed" in p.stdout + + +def test_test_source_layout_explicit(example_pkg_src_layout): + p = spin("test", "tests") + # Ensure more than zero tests ran + assert b"passed" in p.stdout From 7303f9d1a719ce54f561d5c5ab15dc3de26cdfcf Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 8 Nov 2024 17:41:57 -0800 Subject: [PATCH 3/4] Satisfy mypy --- .pre-commit-config.yaml | 4 ++++ example_pkg/example_pkg/_core.pyi | 1 + example_pkg_src/src/_core.pyi | 1 + spin/tests/__init__.py | 0 spin/tests/test_build_cmds.py | 7 ++++--- spin/tests/test_cli.py | 4 ++-- spin/tests/test_editable.py | 2 +- spin/tests/test_test.py | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 example_pkg/example_pkg/_core.pyi create mode 100644 example_pkg_src/src/_core.pyi create mode 100644 spin/tests/__init__.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcb08bd..92e2b62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,6 +41,10 @@ repos: rev: 6f546f30c2b142ad5b3edcf20e3d27cf1789b932 # frozen: v1.10.1 hooks: - id: mypy + exclude: | + (?x)( + ^example_pkg_src/ + ) - repo: https://github.com/codespell-project/codespell rev: "193cd7d27cd571f79358af09a8fb8997e54f8fff" # frozen: v2.3.0 diff --git a/example_pkg/example_pkg/_core.pyi b/example_pkg/example_pkg/_core.pyi new file mode 100644 index 0000000..9c2d05d --- /dev/null +++ b/example_pkg/example_pkg/_core.pyi @@ -0,0 +1 @@ +def echo(str) -> None: ... diff --git a/example_pkg_src/src/_core.pyi b/example_pkg_src/src/_core.pyi new file mode 100644 index 0000000..9c2d05d --- /dev/null +++ b/example_pkg_src/src/_core.pyi @@ -0,0 +1 @@ +def echo(str) -> None: ... diff --git a/spin/tests/__init__.py b/spin/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/spin/tests/test_build_cmds.py b/spin/tests/test_build_cmds.py index c0625c2..a966346 100644 --- a/spin/tests/test_build_cmds.py +++ b/spin/tests/test_build_cmds.py @@ -5,7 +5,10 @@ from pathlib import Path import pytest -from testutil import ( + +from spin.cmds.util import run + +from .testutil import ( skip_on_windows, skip_py_lt_311, skip_unless_linux, @@ -14,8 +17,6 @@ stdout, ) -from spin.cmds.util import run - def test_basic_build(example_pkg): """Does the package build?""" diff --git a/spin/tests/test_cli.py b/spin/tests/test_cli.py index e315843..b045151 100644 --- a/spin/tests/test_cli.py +++ b/spin/tests/test_cli.py @@ -1,7 +1,7 @@ -from testutil import spin, stdout - import spin as libspin +from .testutil import spin, stdout + def test_get_version(example_pkg): p = spin("--version") diff --git a/spin/tests/test_editable.py b/spin/tests/test_editable.py index 0a5eff3..117477c 100644 --- a/spin/tests/test_editable.py +++ b/spin/tests/test_editable.py @@ -1,4 +1,4 @@ -from testutil import spin, stdout +from .testutil import spin, stdout def test_detect_editable(example_pkg, editable_install): diff --git a/spin/tests/test_test.py b/spin/tests/test_test.py index 7f773e4..f79ba51 100644 --- a/spin/tests/test_test.py +++ b/spin/tests/test_test.py @@ -1,6 +1,6 @@ import os -from testutil import spin +from .testutil import spin def test_test(example_pkg): From 5c5266cf4541d81030d756d80ee88b18981a58fb Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Mon, 11 Nov 2024 17:23:30 -0800 Subject: [PATCH 4/4] Clean up example_pkg_src pyproject.toml --- example_pkg_src/.spin/cmds.py | 35 -------------------------- example_pkg_src/pyproject.toml | 46 +--------------------------------- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 example_pkg_src/.spin/cmds.py diff --git a/example_pkg_src/.spin/cmds.py b/example_pkg_src/.spin/cmds.py deleted file mode 100644 index 5e3dfe5..0000000 --- a/example_pkg_src/.spin/cmds.py +++ /dev/null @@ -1,35 +0,0 @@ -import json - -import click - -from spin import util - - -@click.command() -@click.option("-f", "--flag") -@click.option("-t", "--test", default="not set") -def example(flag, test, default_kwd=None): - """🧪 Example custom command. - - Accepts arbitrary flags, and shows how to access `pyproject.toml` - config. - """ - click.secho("Running example custom command", bold=True, fg="bright_blue") - print() - config = util.get_config() - commands = util.get_commands() - click.secho("Flag provided with --flag is: ", fg="yellow", nl=False) - print(flag or None) - - click.secho("Flag provided with --test is: ", fg="yellow", nl=False) - print(test or None) - - click.secho(f"Default kwd is: {default_kwd}") - - click.secho("\nDefined commands:", fg="yellow") - for section in commands: - print(f" {section}: ", end="") - print(", ".join(cmd.name for cmd in commands[section])) - - click.secho("\nTool config is:", fg="yellow") - print(json.dumps(config["tool.spin"], indent=2)) diff --git a/example_pkg_src/pyproject.toml b/example_pkg_src/pyproject.toml index 1188a08..8d0589f 100644 --- a/example_pkg_src/pyproject.toml +++ b/example_pkg_src/pyproject.toml @@ -14,51 +14,7 @@ requires = [ package = 'example_pkg' [tool.spin.commands] -# If you don't need sections, you can also provide a list of commands under [tool.spin]: -# -# commands = [ -# "spin.cmds.meson.build", -# "spin.cmds.meson.test", -# "spin.cmds.meson.shell", -# "spin.cmds.meson.ipython", -# "spin.cmds.meson.python", -# ".spin/cmds.py:example" -# ] - "Build" = [ "spin.cmds.meson.build", - "spin.cmds.meson.test", - "spin.cmds.build.sdist", -] -"Documentation" = [ - "spin.cmds.meson.docs" -] -"Environments" = [ - "spin.cmds.meson.shell", - "spin.cmds.meson.ipython", - "spin.cmds.meson.python", - "spin.cmds.meson.run" -] -"Debug" = [ - "spin.cmds.meson.gdb", - "spin.cmds.meson.lldb" + "spin.cmds.meson.test" ] -"Extensions" = [".spin/cmds.py:example"] -"Pip" = [ - "spin.cmds.pip.install" -] -"Meta" = [ - "spin.cmds.meta.introspect" -] - -[tool.spin.kwargs] -".spin/cmds.py:example" = {"test" = "default override", "default_kwd" = 3} - -# [tool.pytest.ini_options] -# pythonpath = ["src"] -# addopts = [ -# "--import-mode=importlib", -# ] -# testpaths = [ -# "tests", -# ]