diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1dec8867..21e13213 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - "pypy-3.7" - "pypy-3.8" - "pypy-3.9" - - "3.11-dev" + - "3.11" - "3.10" - "3.9" - "3.8" @@ -45,9 +45,6 @@ jobs: tox-target: - "tox" - "min" - exclude: - - { py: "3.11-dev", os: macos } - - { py: "3.11-dev", os: windows } steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8e9f768b..aded1375 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,10 +6,28 @@ Changelog Unreleased ========== +- Hide a Python 3.11.0 unavoidable warning with venv (`PR #527`_) + - Fix infinite recursion error in ``check_dependency`` with circular dependencies (`PR #512`_, Fixes `#511`_) +- Only import colorama on Windows (`PR #494`_, Fixes `#493`_) + +- Flush output more often to reduce interleaved output (`PR #494`_) + +- Small API cleanup, like better ``__all__`` and srcdir being read only. (`PR #477`_) + +- Only use ``importlib_metadata`` when needed (`PR #401`_) + +- Clarify in printout when build dependencies are being installed (`PR #514`_) + +.. _PR #401: https://github.com/pypa/build/pull/401 +.. _PR #477: https://github.com/pypa/build/pull/477 +.. _PR #494: https://github.com/pypa/build/pull/494 .. _PR #512: https://github.com/pypa/build/pull/512 +.. _PR #514: https://github.com/pypa/build/pull/514 +.. _PR #527: https://github.com/pypa/build/pull/527 +.. _#493: https://github.com/pypa/build/issues/493 .. _#511: https://github.com/pypa/build/issues/511 diff --git a/pyproject.toml b/pyproject.toml index baafe0a5..a4f7f4d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ markers = [ filterwarnings = [ "error", "ignore:path is deprecated.:DeprecationWarning", + "ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning", ] [tool.mypy] diff --git a/src/build/env.py b/src/build/env.py index 101aadd5..b4a90a9e 100644 --- a/src/build/env.py +++ b/src/build/env.py @@ -11,6 +11,7 @@ import sys import sysconfig import tempfile +import warnings from types import TracebackType from typing import Callable, Collection, List, Optional, Tuple, Type @@ -262,7 +263,10 @@ def _create_isolated_env_venv(path: str) -> Tuple[str, str]: symlinks = _fs_supports_symlink() try: - venv.EnvBuilder(with_pip=True, symlinks=symlinks).create(path) + with warnings.catch_warnings(): + if sys.version_info[:3] == (3, 11, 0): + warnings.filterwarnings('ignore', 'check_home argument is deprecated and ignored.', DeprecationWarning) + venv.EnvBuilder(with_pip=True, symlinks=symlinks).create(path) except subprocess.CalledProcessError as exc: raise build.FailedProcessError(exc, 'Failed to create venv. Maybe try installing virtualenv.') from None diff --git a/tests/test_env.py b/tests/test_env.py index 7f683c4c..f6f381ad 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -119,8 +119,8 @@ def test_isolated_env_log(mocker, caplog, package_test_flit): if sys.version_info >= (3, 8): # stacklevel assert [(record.lineno) for record in caplog.records] == [ frameinfo.lineno + 1, - frameinfo.lineno - 7, - frameinfo.lineno + 84, + frameinfo.lineno - 6, + frameinfo.lineno + 85, ] diff --git a/tests/test_projectbuilder.py b/tests/test_projectbuilder.py index 170ee739..57ff9f9b 100644 --- a/tests/test_projectbuilder.py +++ b/tests/test_projectbuilder.py @@ -576,6 +576,7 @@ def mock_tomli_not_available(mocker): importlib.reload(build) +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='No need to test old toml support on 3.11+') def test_toml_instead_of_tomli(mocker, mock_tomli_not_available, tmp_dir, package_test_flit): mocker.patch('pep517.wrappers.Pep517HookCaller', autospec=True) @@ -609,7 +610,7 @@ def test_log(mocker, caplog, package_test_flit): ('INFO', 'something'), ] if sys.version_info >= (3, 8): # stacklevel - assert caplog.records[-1].lineno == 601 + assert caplog.records[-1].lineno == 602 @pytest.mark.parametrize(