From 203035d4f0720cc08ac9ec6776491071489c99bd Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 27 Aug 2024 20:33:46 -0400 Subject: [PATCH] docs: add build info (#878) Adding a few things, mostly a docs update with more help debugging builds. Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 17 ++++-- docs/build.md | 89 +++++++++++++++++++++++++++++- pyproject.toml | 1 - tests/conftest.py | 32 +++++------ tests/test_broken_fallback.py | 4 +- tests/test_cmake_config.py | 8 +-- tests/test_dynamic_metadata.py | 6 +- tests/test_editable.py | 18 +++--- tests/test_fileapi.py | 4 +- tests/test_fortran.py | 8 +-- tests/test_get_requires.py | 2 +- tests/test_hatchling.py | 12 ++-- tests/test_pyproject_abi3.py | 4 +- tests/test_pyproject_extra_dirs.py | 4 +- tests/test_pyproject_pep517.py | 16 +++--- tests/test_pyproject_pep518.py | 44 +++++++-------- tests/test_pyproject_pep660.py | 10 ++-- tests/test_pyproject_purelib.py | 4 +- tests/test_setuptools_abi3.py | 4 +- tests/test_setuptools_pep517.py | 10 ++-- tests/test_setuptools_pep518.py | 16 +++--- tests/test_shutil.py | 2 +- tests/test_simple_pure.py | 10 ++-- tests/test_simplest_c.py | 8 +-- 24 files changed, 210 insertions(+), 123 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bba51903..ec6038bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: exclude: "^tests" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.6.2 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -50,8 +50,8 @@ repos: - id: cmake-format exclude: ^src/scikit_build_core/resources/find_python - - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v4.0.0-alpha.8" + - repo: https://github.com/rbubley/mirrors-prettier + rev: "v3.3.3" hooks: - id: prettier types_or: [yaml, markdown, html, css, scss, javascript, json] @@ -60,7 +60,7 @@ repos: stages: [manual] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.11.2 hooks: - id: mypy exclude: | @@ -130,15 +130,20 @@ repos: additional_dependencies: [cogapp] - repo: https://github.com/henryiii/validate-pyproject-schema-store - rev: 2024.07.29 + rev: 2024.08.26 hooks: - id: validate-pyproject - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.1 + rev: 0.29.2 hooks: - id: check-dependabot - id: check-github-workflows - id: check-readthedocs - id: check-metaschema files: \.schema\.json + + - repo: https://github.com/scientific-python/cookie + rev: 2024.08.19 + hooks: + - id: sp-repo-review diff --git a/docs/build.md b/docs/build.md index 34da7fc2..41d0331a 100644 --- a/docs/build.md +++ b/docs/build.md @@ -1,8 +1,53 @@ # Build procedure +## Quickstart + +For any backend, you can make a SDist and then build a wheel from it with one +command (choose your favorite way to run apps): + +````{tab} pipx + +```bash +pipx run build +``` + +```` + +````{tab} uv + +```bash +uvx --from build pyproject-build --installer=uv +``` + +```` + +````{tab} pip + +```bash +pip install build +python -m build +``` + +```` + +You can then check the file contents: + +```bash +tar -tf dist/*.tar.gz +unzip -l dist/*.whl +``` + +The SDist should contain a copy of the repo with all the files you'll need (CI +files and such are not required). And the wheel should look like the installed +project with a few helper files. + +You can inspect any SDist or wheel on PyPI at . + +## In-depth + Modern Python build procedure is as follows: -## SDist +### SDist The SDist is a tarfile with all the code required to build the project, along with a little bit of metadata. To build an SDist, you use the `build` tool with @@ -29,7 +74,16 @@ Without build isolation, you can build an SDist manually with This will produce an SDist in the `dist` directory. For any other backend, substitute the backend above. -## Wheel +#### File structure in the SDist + +Since you can build a wheel from the source or from the SDist, the structure +should be identical to the source, though some files (like CI files) may be +omitted. Files from git submodules should be included. It is best if the SDist +can be installed without internet connection, but that's not always the case. + +There also is a `PKG-INFO` file with metadata in SDists. + +### Wheel The wheel is a zip file (ending in `.whl`) with the built code of the project, along with required metadata. There is no code that executes on install; it is a @@ -69,7 +123,36 @@ without building a wheel, and editable versions of the wheel build. Editable "wheels" are temporary wheels that are only produced to immediately install and discard, and are expected to provide mechanisms to link back to the source code. -## Installing +#### File structure in the wheel + +The basic structure of the wheel is what will be extracted to site-packages. +This means most of the files are usually in `/...`, though if a +top-level extension is present, then that could be something like +`..so`. There's also a +`-.dist-info/` directory with various metadata +files in it (`METADATA`, `WHEEL`, and `RECORD`), along with license files. There +are a few other metadata files that could be here too, like `entry_points.txt`. + +There are also several directories that installers can extract to different locations, +namely: + +* `.data/scripts`: Goes to the `/bin` or `/Scripts` directory in + the environment. Any file starting with `#!python` will get the correct path + injected by the installer. Most build-backends (like setuptools and + scikit-build-core) will convert normal Python shabang lines like + `#!/usr/bin/env python` into `#!python` for you. Though if you are writing Python + and placing them here, it's usually better to use entry points and let the installer + generate the entire file. +* `.data/headers`: Goes to the include directory for the current + version of Python in the environment. +* `.data/data`: Goes to the root of the environment. + +Note that if a user is not in a virtual environment, these folders install +directly to the Python install's location, which could be `/` or `/usr`! In +general, it's best to put data inside the package's folder in site-packages and +then use `importlib.resources` to access it. + +### Installing Installing simply unpacks a wheel into the target filesystem. No code is run, no configuration files are present. If pip tries to install a repo or an SDist, it diff --git a/pyproject.toml b/pyproject.toml index 1def77d5..eb8d0ae1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -217,7 +217,6 @@ ignore = ["W002"] # Triggers on __init__.py's [tool.ruff] -src = ["src"] exclude = ["src/scikit_build_core/_vendor"] # Required due to "build" module [tool.ruff.lint] diff --git a/tests/conftest.py b/tests/conftest.py index 0755e51c..b3ee569f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -157,13 +157,13 @@ def install(self, *args: str, isolated: bool = True) -> None: self.module("pip", "install", *isolated_flags, *args) -@pytest.fixture() +@pytest.fixture def isolated(tmp_path: Path, pep518_wheelhouse: Path) -> VEnv: path = tmp_path / "venv" return VEnv(path, wheelhouse=pep518_wheelhouse) -@pytest.fixture() +@pytest.fixture def virtualenv(tmp_path: Path) -> VEnv: path = tmp_path / "venv" return VEnv(path) @@ -205,7 +205,7 @@ def process_package( shutil.rmtree("dist") -@pytest.fixture() +@pytest.fixture def package_simple_pyproject_ext( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -220,7 +220,7 @@ def package_simple_pyproject_ext( return package -@pytest.fixture() +@pytest.fixture def package_simple_pyproject_script_with_flags( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -231,7 +231,7 @@ def package_simple_pyproject_script_with_flags( return package -@pytest.fixture() +@pytest.fixture def package_simple_pyproject_source_dir( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -242,7 +242,7 @@ def package_simple_pyproject_source_dir( return package -@pytest.fixture() +@pytest.fixture def package_simple_setuptools_ext( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -251,7 +251,7 @@ def package_simple_setuptools_ext( return package -@pytest.fixture() +@pytest.fixture def package_mixed_setuptools( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -260,7 +260,7 @@ def package_mixed_setuptools( return package -@pytest.fixture() +@pytest.fixture def package_filepath_pure( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -269,7 +269,7 @@ def package_filepath_pure( return package -@pytest.fixture() +@pytest.fixture def package_dynamic_metadata( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -278,14 +278,14 @@ def package_dynamic_metadata( return package -@pytest.fixture() +@pytest.fixture def package_hatchling(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> PackageInfo: package = PackageInfo("hatchling") process_package(package, tmp_path, monkeypatch) return package -@pytest.fixture() +@pytest.fixture def package_simplest_c(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> PackageInfo: package = PackageInfo( "simplest_c", @@ -294,7 +294,7 @@ def package_simplest_c(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Packa return package -@pytest.fixture() +@pytest.fixture def navigate_editable(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> PackageInfo: package = PackageInfo( "navigate_editable", @@ -303,7 +303,7 @@ def navigate_editable(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Packag return package -@pytest.fixture() +@pytest.fixture def broken_fallback(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> PackageInfo: package = PackageInfo( "broken_fallback", @@ -312,7 +312,7 @@ def broken_fallback(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> PackageI return package -@pytest.fixture() +@pytest.fixture def package_sdist_config( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -323,7 +323,7 @@ def package_sdist_config( return package -@pytest.fixture() +@pytest.fixture def package_simple_purelib_package( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> PackageInfo: @@ -342,7 +342,7 @@ def which_mock(name: str) -> str | None: return None -@pytest.fixture() +@pytest.fixture def protect_get_requires(fp, monkeypatch): """ Protect get_requires from actually calling anything variable during tests. diff --git a/tests/test_broken_fallback.py b/tests/test_broken_fallback.py index f30ca452..8473c37a 100644 --- a/tests/test_broken_fallback.py +++ b/tests/test_broken_fallback.py @@ -9,8 +9,8 @@ ) -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("broken_fallback") @pytest.mark.parametrize("broken_define", ["BROKEN_CMAKE", "BROKEN_CODE"]) def test_broken_code(broken_define: str, capfd: pytest.CaptureFixture[str]): diff --git a/tests/test_cmake_config.py b/tests/test_cmake_config.py index 93730b52..42ca42a8 100644 --- a/tests/test_cmake_config.py +++ b/tests/test_cmake_config.py @@ -71,7 +71,7 @@ def configure_args( yield f"-C{cmake_init}" -@pytest.mark.configure() +@pytest.mark.configure def test_init_cache( generator: str, tmp_path: Path, @@ -116,7 +116,7 @@ def test_init_cache( ) -@pytest.mark.configure() +@pytest.mark.configure def test_too_old(fp, monkeypatch): monkeypatch.setattr(shutil, "which", lambda _: None) fp.register( @@ -133,7 +133,7 @@ def test_too_old(fp, monkeypatch): assert "Could not find CMake with version >=3.15" in excinfo.value.args[0] -@pytest.mark.configure() +@pytest.mark.configure def test_cmake_args( generator: str, tmp_path: Path, @@ -167,7 +167,7 @@ def test_cmake_args( assert len(fp.calls) == 2 -@pytest.mark.configure() +@pytest.mark.configure def test_cmake_paths( generator: str, tmp_path: Path, diff --git a/tests/test_dynamic_metadata.py b/tests/test_dynamic_metadata.py index c1ce8569..129b429b 100644 --- a/tests/test_dynamic_metadata.py +++ b/tests/test_dynamic_metadata.py @@ -91,7 +91,7 @@ def special_loader(name: str, *args: Any, **kwargs: Any) -> Any: return original_loader(name, *args, **kwargs) -@pytest.fixture() +@pytest.fixture def mock_entry_points(monkeypatch): monkeypatch.setattr(importlib, "import_module", special_loader) @@ -229,8 +229,8 @@ def test_dual_metadata(): get_standard_metadata(pyproject, settings) -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("mock_entry_points", "package_dynamic_metadata") def test_pep517_wheel(virtualenv): dist = Path("dist") diff --git a/tests/test_editable.py b/tests/test_editable.py index 507ba12e..1d54d866 100644 --- a/tests/test_editable.py +++ b/tests/test_editable.py @@ -6,9 +6,9 @@ from conftest import PackageInfo, process_package -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.parametrize("isolate", [True, False], ids=["isolated", "notisolated"]) @pytest.mark.parametrize( "package", @@ -52,9 +52,9 @@ def test_navigate_editable(isolated, isolate, package): assert value == "Some_value_C" -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.parametrize( ("editable", "editable_mode"), [(False, ""), (True, "redirect"), (True, "inplace")] ) @@ -108,9 +108,9 @@ def test_cython_pxd(monkeypatch, tmp_path, editable, editable_mode, isolated): ) -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_simplest_c") def test_install_dir(isolated): isolated.install("pip>=23") diff --git a/tests/test_fileapi.py b/tests/test_fileapi.py index 69edf81d..ee306f3d 100644 --- a/tests/test_fileapi.py +++ b/tests/test_fileapi.py @@ -33,7 +33,7 @@ def prepare_env_or_skip() -> None: pytest.skip("No build system found") -@pytest.mark.configure() +@pytest.mark.configure def test_cattrs_comparison(tmp_path): build_dir = tmp_path / "build" @@ -63,7 +63,7 @@ def test_no_index(tmp_path): load_reply_dir_cattrs(tmp_path) -@pytest.mark.configure() +@pytest.mark.configure def test_simple_pure(tmp_path): build_dir = tmp_path / "build" diff --git a/tests/test_fortran.py b/tests/test_fortran.py index 21de6dd2..7801baf9 100644 --- a/tests/test_fortran.py +++ b/tests/test_fortran.py @@ -23,10 +23,10 @@ ninja_info = best_program(get_ninja_programs(), version=SpecifierSet(">=1.10")) -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.fortran() -@pytest.mark.network() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.fortran +@pytest.mark.network @pytest.mark.skipif(shutil.which("gfortran") is None, reason="gfortran not available") @pytest.mark.skipif( sysconfig.get_platform().startswith("win"), diff --git a/tests/test_get_requires.py b/tests/test_get_requires.py index df515818..58d4a36b 100644 --- a/tests/test_get_requires.py +++ b/tests/test_get_requires.py @@ -20,7 +20,7 @@ @pytest.fixture(autouse=True) -def protect_get_requires_autouse(protect_get_requires: None): # noqa: ARG001 +def protect_get_requires_autouse(protect_get_requires: None): """ Autouse this fixture in this test. """ diff --git a/tests/test_hatchling.py b/tests/test_hatchling.py index f87511df..143177bc 100644 --- a/tests/test_hatchling.py +++ b/tests/test_hatchling.py @@ -9,8 +9,8 @@ pytest.importorskip("hatchling") -@pytest.mark.network() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.integration @pytest.mark.usefixtures("package_hatchling") def test_hatchling_sdist(isolated) -> None: isolated.install("build[virtualenv]") @@ -33,10 +33,10 @@ def test_hatchling_sdist(isolated) -> None: @pytest.mark.skipif( sys.version_info < (3, 8), reason="Full hatchling support requires Python 3.8+" ) -@pytest.mark.network() -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_hatchling") @pytest.mark.parametrize( "build_args", [(), ("--wheel",)], ids=["sdist_to_wheel", "wheel_directly"] diff --git a/tests/test_pyproject_abi3.py b/tests/test_pyproject_abi3.py index 17e843a4..a36a228b 100644 --- a/tests/test_pyproject_abi3.py +++ b/tests/test_pyproject_abi3.py @@ -13,8 +13,8 @@ SYSCONFIGPLAT = sysconfig.get_platform() -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.skipif( sysconfig.get_platform().startswith(("msys", "mingw")), reason="abi3 FindPython on MSYS/MinGW reports not found", diff --git a/tests/test_pyproject_extra_dirs.py b/tests/test_pyproject_extra_dirs.py index f9a6f55a..e9f15989 100644 --- a/tests/test_pyproject_extra_dirs.py +++ b/tests/test_pyproject_extra_dirs.py @@ -9,8 +9,8 @@ from pathutils import contained -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_filepath_pure") def test_pep517_wheel_extra_dirs(monkeypatch): monkeypatch.setenv("SKBUILD_CMAKE_DEFINE", "SOME_DEFINE3=baz;SOME_DEFINE4=baz") diff --git a/tests/test_pyproject_pep517.py b/tests/test_pyproject_pep517.py index 5714bb8a..7977c918 100644 --- a/tests/test_pyproject_pep517.py +++ b/tests/test_pyproject_pep517.py @@ -160,8 +160,8 @@ def each_unignored_file_ordered(*args, **kwargs): assert hash == package_simple_pyproject_ext.sdist_dated_hash -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_simple_pyproject_script_with_flags") @pytest.mark.parametrize( ("env_var", "setting"), @@ -189,8 +189,8 @@ def test_passing_cxx_flags(monkeypatch, env_var, setting): } -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_simple_pyproject_ext") def test_pep517_wheel(virtualenv): dist = Path("dist") @@ -239,8 +239,8 @@ def test_pep517_wheel(virtualenv): assert add.strip() == "3" -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_simple_pyproject_source_dir") def test_pep517_wheel_source_dir(virtualenv): dist = Path("dist") @@ -298,8 +298,8 @@ def test_pep517_wheel_source_dir(virtualenv): @pytest.mark.skip(reason="Doesn't work yet") -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure def test_pep517_wheel_time_hash(monkeypatch): monkeypatch.setenv("SOURCE_DATE_EPOCH", "12345") dist = Path("dist") diff --git a/tests/test_pyproject_pep518.py b/tests/test_pyproject_pep518.py index db7640a0..70c6955a 100644 --- a/tests/test_pyproject_pep518.py +++ b/tests/test_pyproject_pep518.py @@ -10,7 +10,7 @@ import pytest -@pytest.fixture() +@pytest.fixture def cleanup_overwrite(): overwrite = Path("overwrite.cmake") yield overwrite @@ -23,8 +23,8 @@ def compute_uncompressed_hash(inp: Path): return hashlib.sha256(f.read()).hexdigest() -@pytest.mark.network() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.integration def test_pep518_sdist(isolated, package_simple_pyproject_ext): correct_metadata = textwrap.dedent( """\ @@ -64,9 +64,9 @@ def test_pep518_sdist(isolated, package_simple_pyproject_ext): assert correct_metadata == pkg_info_contents -@pytest.mark.network() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_sdist_config") def test_pep518_sdist_with_cmake_config(isolated, cleanup_overwrite): cleanup_overwrite.write_text("set(MY_VERSION fiddlesticks)") @@ -106,10 +106,10 @@ def test_pep518_sdist_with_cmake_config(isolated, cleanup_overwrite): assert cleanup_overwrite.is_file() -@pytest.mark.network() -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_sdist_config") @pytest.mark.parametrize( "build_args", [(), ("--wheel",)], ids=["sdist_to_wheel", "wheel_directly"] @@ -155,10 +155,10 @@ def test_pep518_wheel_sdist_with_cmake_config( assert cleanup_overwrite.is_file() -@pytest.mark.network() -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_simple_pyproject_ext") @pytest.mark.parametrize( "build_args", [(), ("--wheel",)], ids=["sdist_to_wheel", "wheel_directly"] @@ -195,10 +195,10 @@ def test_pep518_wheel(isolated, build_args): assert add == "3" -@pytest.mark.network() -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.parametrize( "build_args", [(), ("--wheel",)], ids=["sdist_to_wheel", "wheel_directly"] ) @@ -242,10 +242,10 @@ def test_pep518_rebuild_build_dir(isolated, tmp_path, build_args): assert version == "0.0.1" -@pytest.mark.network() -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.network +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.usefixtures("package_simple_pyproject_ext") def test_pep518_pip(isolated): isolated.install("-v", ".") diff --git a/tests/test_pyproject_pep660.py b/tests/test_pyproject_pep660.py index f21ddbc7..e83d325d 100644 --- a/tests/test_pyproject_pep660.py +++ b/tests/test_pyproject_pep660.py @@ -15,8 +15,8 @@ def editable_mode(request: pytest.FixtureRequest) -> str: # TODO: figure out why gmake is reporting no rule to make simple_pure.cpp -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.xfail( sys.platform.startswith("cygwin"), strict=False, @@ -50,9 +50,9 @@ def test_pep660_wheel(editable_mode: str): assert "Version: 0.0.1" in metadata -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration @pytest.mark.parametrize("isolate", [True, False], ids=["isolated", "not_isolated"]) @pytest.mark.usefixtures("package_simplest_c") def test_pep660_pip_isolated(isolated, isolate, editable_mode: str): diff --git a/tests/test_pyproject_purelib.py b/tests/test_pyproject_purelib.py index e7262151..e3632c48 100644 --- a/tests/test_pyproject_purelib.py +++ b/tests/test_pyproject_purelib.py @@ -5,8 +5,8 @@ from scikit_build_core.build import build_wheel -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_simple_purelib_package") def test_pep517_wheel(virtualenv): dist = Path("dist") diff --git a/tests/test_setuptools_abi3.py b/tests/test_setuptools_abi3.py index 03513cb6..0bb3b971 100644 --- a/tests/test_setuptools_abi3.py +++ b/tests/test_setuptools_abi3.py @@ -15,8 +15,8 @@ SYSCONFIGPLAT = sysconfig.get_platform() -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.skipif( sys.implementation.name == "pypy", reason="pypy does not support abi3" ) diff --git a/tests/test_setuptools_pep517.py b/tests/test_setuptools_pep517.py index 91d4446b..76ea5e75 100644 --- a/tests/test_setuptools_pep517.py +++ b/tests/test_setuptools_pep517.py @@ -62,9 +62,9 @@ def test_pep517_sdist(): assert metadata_set <= pkg_info_contents -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.broken_on_urct() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.broken_on_urct @pytest.mark.usefixtures("package_simple_setuptools_ext") @pytest.mark.xfail( sys.platform.startswith("cygwin"), @@ -99,8 +99,8 @@ def test_pep517_wheel(virtualenv): assert add.strip() == "3" -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.usefixtures("package_mixed_setuptools") def test_pep517_mixed_wheel(virtualenv): dist = Path("dist") diff --git a/tests/test_setuptools_pep518.py b/tests/test_setuptools_pep518.py index 6dde9c11..21f9c7f7 100644 --- a/tests/test_setuptools_pep518.py +++ b/tests/test_setuptools_pep518.py @@ -8,10 +8,10 @@ # TODO: work out why this fails on Cygwin -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() -@pytest.mark.broken_on_urct() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration +@pytest.mark.broken_on_urct @pytest.mark.xfail( sys.platform.startswith("cygwin"), reason="Cygwin fails here with ld errors", @@ -46,10 +46,10 @@ def test_pep518_wheel(isolated): assert add == "3" -@pytest.mark.compile() -@pytest.mark.configure() -@pytest.mark.integration() -@pytest.mark.broken_on_urct() +@pytest.mark.compile +@pytest.mark.configure +@pytest.mark.integration +@pytest.mark.broken_on_urct @pytest.mark.xfail( sys.platform.startswith("cygwin"), reason="Cygwin fails here with ld errors", diff --git a/tests/test_shutil.py b/tests/test_shutil.py index 1cfd2c38..120925ee 100644 --- a/tests/test_shutil.py +++ b/tests/test_shutil.py @@ -30,7 +30,7 @@ def _make_dir_with_ro(tmp_path: Path) -> Path: return base -@pytest.fixture() +@pytest.fixture def make_dir_with_ro(tmp_path: Path) -> Path: return _make_dir_with_ro(tmp_path) diff --git a/tests/test_simple_pure.py b/tests/test_simple_pure.py index fbbd8c4f..65efaf4b 100644 --- a/tests/test_simple_pure.py +++ b/tests/test_simple_pure.py @@ -55,8 +55,8 @@ def config(tmp_path_factory): # TODO: figure out why gmake is reporting no rule to make simple_pure.cpp -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.xfail( sys.platform.startswith("cygwin"), strict=False, @@ -80,8 +80,8 @@ def test_bin_in_config(config): # TODO: figure out why gmake is reporting no rule to make simple_pure.cpp -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.xfail( sys.platform.startswith("cygwin"), strict=False, @@ -101,7 +101,7 @@ def test_install(config): assert result.stdout == "0 one 2 three \n" -@pytest.mark.configure() +@pytest.mark.configure def test_variable_defined(tmp_path, capfd): prepare_env_or_skip() diff --git a/tests/test_simplest_c.py b/tests/test_simplest_c.py index 15a8ca17..8c43cda6 100644 --- a/tests/test_simplest_c.py +++ b/tests/test_simplest_c.py @@ -45,8 +45,8 @@ def test_pep517_sdist(tmp_path, monkeypatch): } -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure @pytest.mark.parametrize( "component", [[], ["PythonModule"], ["PythonModule", "Generated"]] ) @@ -98,8 +98,8 @@ def test_pep517_wheel(tmp_path, monkeypatch, virtualenv, component): assert version == "4.0" -@pytest.mark.compile() -@pytest.mark.configure() +@pytest.mark.compile +@pytest.mark.configure def test_pep517_wheel_incexl(tmp_path, monkeypatch, virtualenv): dist = tmp_path / "dist" dist.mkdir()