diff --git a/examples/decorator/.template/pyproject.toml b/examples/decorator/.template/pyproject.toml index 537fdacc..d27a1be9 100644 --- a/examples/decorator/.template/pyproject.toml +++ b/examples/decorator/.template/pyproject.toml @@ -5,3 +5,6 @@ build-backend = "maturin" [project] name = "{{project-name}}" version = "0.1.0" + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/decorator/noxfile.py b/examples/decorator/noxfile.py index 17a6b80f..23d967cc 100644 --- a/examples/decorator/noxfile.py +++ b/examples/decorator/noxfile.py @@ -2,8 +2,7 @@ import nox @nox.session -def python(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop") +def python(session: nox.Session): + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") diff --git a/examples/decorator/pyproject.toml b/examples/decorator/pyproject.toml index 8575ca25..88280a6b 100644 --- a/examples/decorator/pyproject.toml +++ b/examples/decorator/pyproject.toml @@ -14,3 +14,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", ] + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/decorator/requirements-dev.txt b/examples/decorator/requirements-dev.txt deleted file mode 100644 index 9ea7f14b..00000000 --- a/examples/decorator/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=3.5.0 -pip>=21.3 -maturin>=0.12,<0.13 diff --git a/examples/getitem/.template/pyproject.toml b/examples/getitem/.template/pyproject.toml index 537fdacc..d27a1be9 100644 --- a/examples/getitem/.template/pyproject.toml +++ b/examples/getitem/.template/pyproject.toml @@ -5,3 +5,6 @@ build-backend = "maturin" [project] name = "{{project-name}}" version = "0.1.0" + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/getitem/noxfile.py b/examples/getitem/noxfile.py index 17a6b80f..23d967cc 100644 --- a/examples/getitem/noxfile.py +++ b/examples/getitem/noxfile.py @@ -2,8 +2,7 @@ import nox @nox.session -def python(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop") +def python(session: nox.Session): + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") diff --git a/examples/getitem/pyproject.toml b/examples/getitem/pyproject.toml index 2cb6dc71..6e05570e 100644 --- a/examples/getitem/pyproject.toml +++ b/examples/getitem/pyproject.toml @@ -14,3 +14,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", ] + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/getitem/requirements-dev.txt b/examples/getitem/requirements-dev.txt deleted file mode 100644 index d9913970..00000000 --- a/examples/getitem/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=3.5.0 -pip>=21.3 -maturin>=1,<2 diff --git a/examples/maturin-starter/.template/pyproject.toml b/examples/maturin-starter/.template/pyproject.toml index 537fdacc..d27a1be9 100644 --- a/examples/maturin-starter/.template/pyproject.toml +++ b/examples/maturin-starter/.template/pyproject.toml @@ -5,3 +5,6 @@ build-backend = "maturin" [project] name = "{{project-name}}" version = "0.1.0" + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/maturin-starter/noxfile.py b/examples/maturin-starter/noxfile.py index 17a6b80f..12ed90e5 100644 --- a/examples/maturin-starter/noxfile.py +++ b/examples/maturin-starter/noxfile.py @@ -3,7 +3,6 @@ import nox @nox.session def python(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop") + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") diff --git a/examples/maturin-starter/pyproject.toml b/examples/maturin-starter/pyproject.toml index fb9c808f..52ecba15 100644 --- a/examples/maturin-starter/pyproject.toml +++ b/examples/maturin-starter/pyproject.toml @@ -14,3 +14,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", ] + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/maturin-starter/requirements-dev.txt b/examples/maturin-starter/requirements-dev.txt deleted file mode 100644 index 9ea7f14b..00000000 --- a/examples/maturin-starter/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=3.5.0 -pip>=21.3 -maturin>=0.12,<0.13 diff --git a/examples/plugin/plugin_api/noxfile.py b/examples/plugin/plugin_api/noxfile.py index 3b53c0c3..12ed90e5 100644 --- a/examples/plugin/plugin_api/noxfile.py +++ b/examples/plugin/plugin_api/noxfile.py @@ -3,7 +3,6 @@ import nox @nox.session def python(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop", "--features", "extension-module") + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") diff --git a/examples/plugin/plugin_api/pyproject.toml b/examples/plugin/plugin_api/pyproject.toml index 5a460385..82f331d9 100644 --- a/examples/plugin/plugin_api/pyproject.toml +++ b/examples/plugin/plugin_api/pyproject.toml @@ -10,3 +10,6 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/plugin/plugin_api/requirements-dev.txt b/examples/plugin/plugin_api/requirements-dev.txt deleted file mode 100644 index 20c7cdfb..00000000 --- a/examples/plugin/plugin_api/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=3.5.0 -pip>=21.3 -maturin>=0.14 diff --git a/examples/setuptools-rust-starter/noxfile.py b/examples/setuptools-rust-starter/noxfile.py index f6c62af1..9edab962 100644 --- a/examples/setuptools-rust-starter/noxfile.py +++ b/examples/setuptools-rust-starter/noxfile.py @@ -2,7 +2,7 @@ import nox @nox.session -def python(session): +def python(session: nox.Session): session.install("-rrequirements-dev.txt") session.run_always( "pip", "install", "-e", ".", "--no-build-isolation", env={"BUILD_DEBUG": "1"} diff --git a/examples/string-sum/.template/pyproject.toml b/examples/string-sum/.template/pyproject.toml index 537fdacc..d27a1be9 100644 --- a/examples/string-sum/.template/pyproject.toml +++ b/examples/string-sum/.template/pyproject.toml @@ -5,3 +5,6 @@ build-backend = "maturin" [project] name = "{{project-name}}" version = "0.1.0" + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/string-sum/noxfile.py b/examples/string-sum/noxfile.py index 17a6b80f..23d967cc 100644 --- a/examples/string-sum/noxfile.py +++ b/examples/string-sum/noxfile.py @@ -2,8 +2,7 @@ import nox @nox.session -def python(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop") +def python(session: nox.Session): + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") diff --git a/examples/string-sum/pyproject.toml b/examples/string-sum/pyproject.toml index 088f2b47..4433178e 100644 --- a/examples/string-sum/pyproject.toml +++ b/examples/string-sum/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1,<2"] build-backend = "maturin" [project] -name = "string sum" +name = "string_sum" version = "0.1.0" classifiers = [ "License :: OSI Approved :: MIT License", @@ -14,3 +14,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", ] + +[project.optional-dependencies] +dev = ["pytest"] diff --git a/examples/string-sum/requirements-dev.txt b/examples/string-sum/requirements-dev.txt deleted file mode 100644 index 9ea7f14b..00000000 --- a/examples/string-sum/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=3.5.0 -pip>=21.3 -maturin>=0.12,<0.13 diff --git a/examples/word-count/.template/pre-script.rhai b/examples/word-count/.template/pre-script.rhai index 0748517e..5ba02b12 100644 --- a/examples/word-count/.template/pre-script.rhai +++ b/examples/word-count/.template/pre-script.rhai @@ -1,3 +1,4 @@ variable::set("PYO3_VERSION", "0.20.0"); file::rename(".template/Cargo.toml", "Cargo.toml"); +file::rename(".template/pyproject.toml", "pyproject.toml"); file::delete(".template"); diff --git a/examples/word-count/.template/pyproject.toml b/examples/word-count/.template/pyproject.toml index b436b675..8aa3c955 100644 --- a/examples/word-count/.template/pyproject.toml +++ b/examples/word-count/.template/pyproject.toml @@ -1,9 +1,13 @@ [build-system] -requires = ["setuptools>=41.0.0", "wheel", "setuptools_rust>=1.0.0"] +requires = ["maturin>=1,<2"] +build-backend = "maturin" [project] name = "{{project-name}}" version = "0.1.0" +[project.optional-dependencies] +dev = ["pytest"] + [tool.pytest.ini_options] addopts = "--benchmark-disable" diff --git a/examples/word-count/.template/setup.cfg b/examples/word-count/.template/setup.cfg deleted file mode 100644 index 7b861826..00000000 --- a/examples/word-count/.template/setup.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[metadata] -name = {{project-name}} -version = 0.1.0 -packages = - word_count - -[options] -include_package_data = True -zip_safe = False diff --git a/examples/word-count/noxfile.py b/examples/word-count/noxfile.py index 39230d26..d64f210f 100644 --- a/examples/word-count/noxfile.py +++ b/examples/word-count/noxfile.py @@ -4,15 +4,14 @@ nox.options.sessions = ["test"] @nox.session -def test(session): - session.install("-rrequirements-dev.txt") - session.install("maturin") - session.run_always("maturin", "develop") +def test(session: nox.Session): + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest") @nox.session -def bench(session): - session.install("-rrequirements-dev.txt") - session.install(".") +def bench(session: nox.Session): + session.env["MATURIN_PEP517_ARGS"] = "--profile=dev" + session.install(".[dev]") session.run("pytest", "--benchmark-enable") diff --git a/examples/word-count/pyproject.toml b/examples/word-count/pyproject.toml index 6f88a517..e5703294 100644 --- a/examples/word-count/pyproject.toml +++ b/examples/word-count/pyproject.toml @@ -15,6 +15,8 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", ] +[project.optional-dependencies] +dev = ["pytest", "pytest-benchmark"] [tool.pytest.ini_options] addopts = "--benchmark-disable" diff --git a/examples/word-count/requirements-dev.txt b/examples/word-count/requirements-dev.txt deleted file mode 100644 index fcd8fc54..00000000 --- a/examples/word-count/requirements-dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest>=3.5.0 -pytest-benchmark>=3.1.1