diff --git a/.distro/python-scikit-build-core.spec b/.distro/python-scikit-build-core.spec index e1bf53ec..867cb2c1 100644 --- a/.distro/python-scikit-build-core.spec +++ b/.distro/python-scikit-build-core.spec @@ -53,7 +53,7 @@ cp -p src/scikit_build_core/_vendor/pyproject_metadata/LICENSE LICENSE-pyproject %if %{with no_classifier_check} export HATCH_METADATA_CLASSIFIERS_NO_VERIFY=1 %endif -%pyproject_buildrequires -x test,test-meta,test-numpy +%pyproject_buildrequires -g test,test-meta,test-numpy %build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8350e1a..47d49a70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,9 +124,7 @@ jobs: - name: Install package (uv) run: - uv pip install - -e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools] - --system + uv pip install -e.[wheels,wheel-free-setuptools] --group=dev --system - name: Test package if: "!contains(matrix.python_version, 'pypy')" @@ -182,7 +180,7 @@ jobs: - name: Install min requirements run: | - uv pip install -e .[test,pyproject] --resolution=lowest-direct --system + uv pip install -e. --group=test --resolution=lowest-direct --system - name: Setup CMake 3.15 uses: jwlawson/actions-setup-cmake@v2.0 @@ -218,7 +216,7 @@ jobs: run: python3.13t -m venv /venv - name: Install deps - run: /venv/bin/pip install -e .[test] ninja + run: /venv/bin/pip install -e . --group=test ninja - name: Test package run: /venv/bin/pytest @@ -241,7 +239,7 @@ jobs: cmake ninja git make gcc-g++ python39 python39-devel python39-pip - name: Install - run: python3.9 -m pip install .[test] + run: python3.9 -m pip install . --group=test - name: Test package run: @@ -274,7 +272,7 @@ jobs: persist-credentials: false - name: Install - run: python -m pip install .[test] + run: python -m pip install . --group=test - name: Test package run: >- @@ -307,7 +305,7 @@ jobs: persist-credentials: false - name: Install - run: python -m pip install .[test] + run: python -m pip install . --group=test - name: Test package run: >- diff --git a/.readthedocs.yml b/.readthedocs.yml index e72d336e..08c4aedf 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,26 +5,15 @@ # Required version: 2 -# Set the version of Python and other tools you might need build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.11" - - # Unshallow the git clone to allow vcs versioning to pick - # up tags properly - jobs: - post_checkout: - - git fetch --unshallow - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -python: - install: - - method: pip - path: . - extra_requirements: - - docs - - pyproject + python: "3.13" + commands: + - git fetch --unshallow + - asdf plugin add uv + - asdf install uv latest + - asdf global uv latest + - uv sync --group docs + - uv run python -m sphinx -T -b html -d docs/_build/doctrees -D language=en + docs $READTHEDOCS_OUTPUT/html diff --git a/noxfile.py b/noxfile.py index f28d5fff..b5cead85 100755 --- a/noxfile.py +++ b/noxfile.py @@ -47,7 +47,7 @@ def pylint(session: nox.Session) -> None: """ # This needs to be installed into the package environment, and is slower # than a pre-commit check - session.install("-e.[dev,test,test-meta]", "pylint==3.3.*") + session.install("-e.", "--group=dev", "pylint==3.3.*") session.run("pylint", "--version") session.run("pylint", "scikit_build_core", *session.posargs) @@ -80,8 +80,8 @@ def _run_tests( posargs.append("--cov-config=pyproject.toml") env["COVERAGE_CORE"] = "sysmon" - install_arg = f"-e.[{','.join(_extras)}]" - session.install(install_arg, *install_args, silent=False) + install_arg = ["-e.", *{" ".join(f"--group={e}" for e in _extras)}] + session.install(*install_arg, *install_args, silent=False) session.run("pytest", *run_args, *posargs, env=env) @@ -104,7 +104,7 @@ def tests(session: nox.Session) -> None: """ Run the unit and regular tests. Includes coverage if --cov passed. """ - _run_tests(session, extras=["test-meta,test-numpy,test-schema,test-hatchling"]) + _run_tests(session, extras=["dev"]) @nox.session(reuse_venv=True, tags=["gen"]) @@ -158,7 +158,7 @@ def docs(session: nox.Session) -> None: serve = args.builder == "html" and session.interactive extra_installs = ["sphinx-autobuild"] if serve else [] - session.install("-e.[docs]", *extra_installs) + session.install("-e.", "--group=docs", *extra_installs) session.chdir("docs") diff --git a/pyproject.toml b/pyproject.toml index c3640708..c9960cf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,32 @@ dependencies = [ [project.optional-dependencies] pyproject = [ ] +wheels = [ + "cmake", + "ninja; sys_platform!='win32'", +] +wheel-free-setuptools = [ + 'setuptools>=70.1; python_version>="3.8"', +] + +[project.urls] +Changelog = "https://scikit-build-core.readthedocs.io/en/latest/changelog.html" +Discussions = "https://github.com/orgs/scikit-build/discussions" +Documentation = "https://scikit-build-core.readthedocs.io" +Homepage = "https://github.com/scikit-build/scikit-build-core" +Issues = "https://github.com/scikit-build/scikit-build-core/issues" + +[project.entry-points] +"distutils.commands".build_cmake = "scikit_build_core.setuptools.build_cmake:BuildCMake" +"distutils.setup_keywords".cmake_source_dir = "scikit_build_core.setuptools.build_cmake:cmake_source_dir" +"distutils.setup_keywords".cmake_args = "scikit_build_core.setuptools.build_cmake:cmake_args" +"distutils.setup_keywords".cmake_install_target = "scikit_build_core.setuptools.build_cmake:cmake_install_target" +"setuptools.finalize_distribution_options".scikit_build_entry = "scikit_build_core.setuptools.build_cmake:finalize_distribution_options" +"validate_pyproject.tool_schema".scikit-build = "scikit_build_core.settings.skbuild_schema:get_skbuild_schema" +hatch.scikit-build = "scikit_build_core.hatch.hooks" + + +[dependency-groups] test = [ "build >=0.8", "cattrs >=22.2.0", @@ -64,30 +90,36 @@ test = [ "wheel >=0.40", ] test-hatchling = [ + { include-group = "test" }, "hatchling >=1.24.0", ] test-meta = [ + { include-group = "test" }, "hatch-fancy-pypi-readme>=22.3", "setuptools-scm", ] test-numpy = [ + { include-group = "test" }, "numpy; python_version<'3.14' and platform_python_implementation!='PyPy' and (platform_system != 'Windows' or platform_machine != 'ARM64')", "numpy~=1.24.0; python_version=='3.8' and platform_python_implementation=='PyPy'", "numpy~=2.0.0; python_version=='3.9' and platform_python_implementation=='PyPy'", "numpy~=2.2.0; python_version=='3.10' and platform_python_implementation=='PyPy'", ] test-schema = [ + { include-group = "test" }, "fastjsonschema", "validate-pyproject", ] cov = [ + { include-group = "test" }, "pytest-cov", ] -wheels = [ - "cmake", - "ninja; sys_platform!='win32'", -] dev = [ + { include-group = "cov" }, + { include-group = "test-hatchling" }, + { include-group = "test-meta" }, + { include-group = "test-numpy" }, + { include-group = "test-schema" }, "rich", ] docs = [ @@ -103,25 +135,7 @@ docs = [ "sphinx-tippy", "sphinxcontrib-programoutput", ] -wheel-free-setuptools = [ - 'setuptools>=70.1; python_version>="3.8"', -] -[project.urls] -Changelog = "https://scikit-build-core.readthedocs.io/en/latest/changelog.html" -Discussions = "https://github.com/orgs/scikit-build/discussions" -Documentation = "https://scikit-build-core.readthedocs.io" -Homepage = "https://github.com/scikit-build/scikit-build-core" -Issues = "https://github.com/scikit-build/scikit-build-core/issues" - -[project.entry-points] -"distutils.commands".build_cmake = "scikit_build_core.setuptools.build_cmake:BuildCMake" -"distutils.setup_keywords".cmake_source_dir = "scikit_build_core.setuptools.build_cmake:cmake_source_dir" -"distutils.setup_keywords".cmake_args = "scikit_build_core.setuptools.build_cmake:cmake_args" -"distutils.setup_keywords".cmake_install_target = "scikit_build_core.setuptools.build_cmake:cmake_install_target" -"setuptools.finalize_distribution_options".scikit_build_entry = "scikit_build_core.setuptools.build_cmake:finalize_distribution_options" -"validate_pyproject.tool_schema".scikit-build = "scikit_build_core.settings.skbuild_schema:get_skbuild_schema" -hatch.scikit-build = "scikit_build_core.hatch.hooks" [tool.hatch] version.source = "vcs" @@ -129,7 +143,6 @@ build.hooks.vcs.version-file = "src/scikit_build_core/_version.py" [tool.uv] -dev-dependencies = ["scikit-build-core[test,test-hatchling,test-meta,test-numpy,test-schema,cov,dev]"] workspace.members = ["tmp/hello/hello"] diff --git a/tests/plans.fmf b/tests/plans.fmf index 6235878a..6a12e7fb 100644 --- a/tests/plans.fmf +++ b/tests/plans.fmf @@ -27,7 +27,7 @@ node-date: 2025-02-27T16:18:39-05:00 describe-name: v0.11.0 EOF - pip install --user .[test] + pip install --user . --group=test discover: how: fmf filter: "tag: pytest"