Repository: pypa/build
Pull request #435 (2022-01-31 19:07:38)

pre-commit: bump repositories
<!--pre-commit.ci start-->
updates:
- [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0)
<!--pre-commit.ci end-->

henryiii: Not related, but Python 3.11 is failing with:

```
E       Expected: _error("Backend 'flit_core.buildapi' is not available.")
15907
E       Actual: _error("Backend operation failed: DeprecationWarning('path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.')")
```

🤣 

Patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9f5883c..966e6ba 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -23,7 +23,7 @@ repos:
   - id: pyupgrade
     args: ["--py36-plus"]
 - repo: https://github.com/psf/black
-  rev: 21.12b0
+  rev: 22.1.0
   hooks:
   - id: black
 - repo: https://github.com/PyCQA/isort
diff --git a/pyproject.toml b/pyproject.toml
index a193fb1..086fa13 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -31,9 +31,11 @@ junit_family = "xunit2"
 norecursedirs = "tests/integration/*"
 markers = [
   "isolated",
+  "pypy3323bug",
 ]
 filterwarnings = [
   "error",
+  "ignore:path is deprecated.:DeprecationWarning",
 ]
 
 [tool.mypy]
diff --git a/tox.ini b/tox.ini
index f5a11d2..425f8a1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -23,13 +23,14 @@ passenv =
 setenv =
     COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
     TEST_STATUS_DIR = {envtmpdir}
+    PYPY3323BUG = 1
     path: TEST_MODE = path
     sdist: TEST_MODE = sdist
     wheel: TEST_MODE = wheel
 extras =
     test
 commands =
-    pytest -rsx --cov --cov-config pyproject.toml \
+    pytest -ra --cov --cov-config pyproject.toml \
       --cov-report=html:{envdir}/htmlcov --cov-context=test \
       --cov-report=xml:{toxworkdir}/coverage.{envname}.xml \
       tests {posargs:-n auto}
@@ -58,7 +59,7 @@ description = check minimum versions required of all dependencies
 skip_install = true
 commands =
     pip install .[test] -c tests/constraints.txt
-    pytest -rsx tests {posargs:-n auto}
+    pytest -ra tests {posargs:-n auto}
 
 [testenv:docs]
 description = build documentations


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 20a1558..669edb0 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -81,6 +81,8 @@ def pytest_collection_modifyitems(config, items):
         return
     for item in items:
         is_integration_file = is_integration(item)
+        if PYPY3_WIN_VENV_BAD and item.get_closest_marker('pypy3323bug') and os.environ.get('PYPY3323BUG', None):
+            item.add_marker(pytest.mark.xfail(reason=PYPY3_WIN_M, strict=False))
         if PYPY3_WIN_VENV_BAD and item.get_closest_marker('isolated'):
             if not (is_integration_file and item.originalname == 'test_build') or (
                 hasattr(item, 'callspec') and '--no-isolation' not in item.callspec.params.get('args', [])
diff --git a/tests/test_env.py b/tests/test_env.py
index 831d725..b36fcce 100644
--- a/tests/test_env.py
+++ b/tests/test_env.py
@@ -97,13 +97,14 @@ def test_isolated_env_has_install_still_abstract():
         Env()
 
 
+@pytest.mark.pypy3323bug
 def test_isolated_env_log(mocker, caplog, package_test_flit):
     mocker.patch('build.env._subprocess')
     caplog.set_level(logging.DEBUG)
 
     builder = build.env.IsolatedEnvBuilder()
-    builder.log('something')
-    with builder as env:
+    builder.log('something')  # line number 106
+    with builder as env:  # line number 107
         env.install(['something'])
 
     assert [(record.levelname, record.message) for record in caplog.records] == [
@@ -112,7 +113,7 @@ def test_isolated_env_log(mocker, caplog, package_test_flit):
         ('INFO', 'Installing packages in isolated environment... (something)'),
     ]
     if sys.version_info >= (3, 8):  # stacklevel
-        assert [(record.lineno) for record in caplog.records] == [105, 107, 198]
+        assert [(record.lineno) for record in caplog.records] == [106, 107, 198]
 
 
 @pytest.mark.isolated
diff --git a/tests/test_main.py b/tests/test_main.py
index d34f1bc..e80db36 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -184,6 +184,7 @@ def test_build_raises_build_backend_exception(mocker, package_test_flit):
         build.__main__.build_package(package_test_flit, '.', ['sdist'])
 
 
+@pytest.mark.pypy3323bug
 def test_build_package(tmp_dir, package_test_setuptools):
     build.__main__.build_package(package_test_setuptools, tmp_dir, ['sdist', 'wheel'])
 
@@ -193,6 +194,7 @@ def test_build_package(tmp_dir, package_test_setuptools):
     ]
 
 
+@pytest.mark.pypy3323bug
 def test_build_package_via_sdist(tmp_dir, package_test_setuptools):
     build.__main__.build_package_via_sdist(package_test_setuptools, tmp_dir, ['wheel'])
 
@@ -202,6 +204,7 @@ def test_build_package_via_sdist(tmp_dir, package_test_setuptools):
     ]
 
 
+@pytest.mark.pypy3323bug
 def test_build_package_via_sdist_cant_build(tmp_dir, package_test_cant_build_via_sdist):
     with pytest.raises(build.BuildBackendException):
         build.__main__.build_package_via_sdist(package_test_cant_build_via_sdist, tmp_dir, ['wheel'])
@@ -212,6 +215,7 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
         build.__main__.build_package_via_sdist(package_test_setuptools, tmp_dir, ['sdist'])
 
 
+@pytest.mark.pypy3323bug
 @pytest.mark.parametrize(
     ('args', 'output'),
     [
@@ -300,6 +304,7 @@ def main_reload_styles():
         importlib.reload(build.__main__)
 
 
+@pytest.mark.pypy3323bug
 @pytest.mark.parametrize(
     ('color', 'stdout_error', 'stdout_body'),
     [
diff --git a/tests/test_util.py b/tests/test_util.py
index eeb94aa..9f090b5 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -5,6 +5,7 @@ import pytest
 import build.util
 
 
+@pytest.mark.pypy3323bug
 @pytest.mark.parametrize('isolated', [False, True])
 def test_wheel_metadata(package_test_setuptools, isolated):
     metadata = build.util.project_wheel_metadata(package_test_setuptools, isolated)
@@ -13,6 +14,7 @@ def test_wheel_metadata(package_test_setuptools, isolated):
     assert metadata['version'] == '1.0.0'
 
 
+@pytest.mark.pypy3323bug
 def test_wheel_metadata_isolation(package_test_flit):
     try:
         import flit_core  # noqa: F401
@@ -33,6 +35,7 @@ def test_wheel_metadata_isolation(package_test_flit):
         build.util.project_wheel_metadata(package_test_flit, isolated=False)
 
 
+@pytest.mark.pypy3323bug
 def test_with_get_requires(package_test_metadata):
     metadata = build.util.project_wheel_metadata(package_test_metadata)