Repository: scikit-build/scikit-build-core
Pull request #256 (2023-04-04 01:39:54)

tests: fix msys failures
Testing to see if I can fix the `address space needed by '_common.cpython-311-x86_64-msys.dll' (0x620000) is already occupied` failures. Switching to UCRT instead, currently disabling a few setuptools tests to get it to pass. Speeding up the tests, too.

codecov[bot]: ## [Codecov](https://codecov.io/gh/scikit-build/scikit-build-core/pull/256?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) Report
> Merging [#256](https://codecov.io/gh/scikit-build/scikit-build-core/pull/256?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) (72cee12) into [main](https://codecov.io/gh/scikit-build/scikit-build-core/commit/e2a1479d8392938fbcadb28f824eba0934e9b2da?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) (e2a1479) will **increase** coverage by `0.08%`.
> The diff coverage is `n/a`.

```diff
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
+ Coverage   88.10%   88.19%   +0.08%     
==========================================
  Files          51       51              
  Lines        2236     2236              
==========================================
+ Hits         1970     1972       +2     
+ Misses        266      264       -2     
```


[see 1 file with indirect coverage changes](https://codecov.io/gh/scikit-build/scikit-build-core/pull/256/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build)

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build)


Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 28ad3d1..79e45fb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -85,6 +85,12 @@ jobs:
           pip install .[test,cov] cmake ninja rich hatch-fancy-pypi-readme
           setuptools-scm
 
+      - name: Add NumPy
+        if: >
+          (matrix.runs-on == 'ubuntu-latest' || matrix.python-version !=
+          'pypy-3.8') && matrix.python-version != '3.12-dev'
+        run: "pip install --only-binary=:all: numpy"
+
       - name: Test package
         run: pytest -ra --showlocals --cov=scikit_build_core
 
@@ -105,7 +111,9 @@ jobs:
         with:
           cmake-version: "${{ matrix.cmake-version }}"
 
+      # Skipped on pypy to keep the tests fast
       - name: Test min package
+        if: matrix.python-version != 'pypy-3.8'
         run: pytest -ra --showlocals
 
   cygwin:
@@ -121,8 +129,7 @@ jobs:
         with:
           platform: x86_64
           packages:
-            cmake ninja git make gcc-g++ gcc-fortran python39 python39-devel
-            python39-pip
+            cmake ninja git make gcc-g++ python39 python39-devel python39-pip
 
       - name: Install
         run: python3.9 -m pip install .[test]
@@ -131,7 +138,7 @@ jobs:
         run: python3.9 -m pytest -ra --showlocals -m "not virtualenv"
 
   msys:
-    name: Tests on 🐍 3 • msys
+    name: Tests on 🐍 3 • msys UCRT
     runs-on: windows-latest
 
     defaults:
@@ -141,13 +148,13 @@ jobs:
     steps:
       - uses: msys2/setup-msys2@v2
         with:
-          msystem: msys
+          msystem: UCRT64
           path-type: minimal
           update: true
           install: >-
             base-devel git
           pacboy: >-
-            python python-pip gcc cmake
+            python:p python-pip:p gcc:p cmake:p
 
       - uses: actions/checkout@v3
         with:
@@ -157,7 +164,7 @@ jobs:
         run: python -m pip install .[test]
 
       - name: Test package
-        run: python -m pytest -ra --showlocals
+        run: python -m pytest -ra --showlocals -m "not broken_on_urct"
 
   mingw64:
     name: Tests on 🐍 3 • mingw64
diff --git a/noxfile.py b/noxfile.py
index 7c0f26b..eee0acd 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -46,6 +46,8 @@ def tests(session: nox.Session) -> None:
         extra.append("cmake")
     if shutil.which("ninja") is None:
         extra.append("ninja")
+    if (3, 8) <= sys.version_info < (3, 12):
+        extra.append("numpy")
 
     session.install("-e.[test]", *extra)
     session.run("pytest", *session.posargs, env=env)
diff --git a/pyproject.toml b/pyproject.toml
index 9e14d12..09519ad 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -55,7 +55,6 @@ test = [
     "cattrs >=22.2.0",
     "gitpython",
     "importlib_metadata; python_version<'3.8'",
-    "numpy; python_version>='3.8' and python_version<'3.12'",
     "pathspec >=0.10.1",
     "pybind11",
     "pyproject-metadata >=0.5",
@@ -108,13 +107,14 @@ filterwarnings = [
 log_cli_level = "info"
 testpaths = ["tests"]
 markers = [
+    "broken_on_urct: Broken for now due to lib not found",
     "compile: Compiles code",
     "configure: Configures CMake code",
     "fortran: Fortran code",
     "integration: Full package build",
+    "isolated: Needs an isolated virtualenv",
     "setuptools: Tests setuptools integration",
     "virtualenv: Needs a virtualenv",
-    "isolated: Needs an isolated virtualenv",
 ]
 
 
diff --git a/src/scikit_build_core/builder/sysconfig.py b/src/scikit_build_core/builder/sysconfig.py
index add693f..862564d 100644
--- a/src/scikit_build_core/builder/sysconfig.py
+++ b/src/scikit_build_core/builder/sysconfig.py
@@ -65,6 +65,9 @@ def get_python_library(env: Mapping[str, str], *, abi3: bool = False) -> Path |
             libpath = libdir / ldlibrary
             if Path(os.path.expandvars(libpath)).is_file():
                 return libpath
+            logger.warning("libdir/ldlibrary: {} is not a real file!", libpath)
+        else:
+            logger.warning("libdir: {} is not a directory", libdir)
 
     framework_prefix = sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX")
     if framework_prefix and Path(framework_prefix).is_dir() and ldlibrary:


Test patch:
diff --git a/tests/test_setuptools_pep517.py b/tests/test_setuptools_pep517.py
index b112619..a38d971 100644
--- a/tests/test_setuptools_pep517.py
+++ b/tests/test_setuptools_pep517.py
@@ -75,6 +75,7 @@ def test_pep517_sdist(tmp_path, monkeypatch):
 
 @pytest.mark.compile()
 @pytest.mark.configure()
+@pytest.mark.broken_on_urct()
 @pytest.mark.skipif(
     sys.platform.startswith("cygwin"), reason="Cygwin fails here with ld errors"
 )
diff --git a/tests/test_setuptools_pep518.py b/tests/test_setuptools_pep518.py
index 30740da..74c5966 100644
--- a/tests/test_setuptools_pep518.py
+++ b/tests/test_setuptools_pep518.py
@@ -15,6 +15,7 @@ HELLO_PEP518 = DIR / "packages/simple_setuptools_ext"
 @pytest.mark.compile()
 @pytest.mark.configure()
 @pytest.mark.integration()
+@pytest.mark.broken_on_urct()
 @pytest.mark.skipif(
     sys.platform.startswith("cygwin"), reason="Cygwin fails here with ld errors"
 )
@@ -56,6 +57,7 @@ def test_pep518_wheel(tmp_path, monkeypatch, isolated):
 @pytest.mark.compile()
 @pytest.mark.configure()
 @pytest.mark.integration()
+@pytest.mark.broken_on_urct()
 @pytest.mark.skipif(
     sys.platform.startswith("cygwin"), reason="Cygwin fails here with ld errors"
 )