From bfde0017cd33fd5d498f3d27a6da2b0fc6f0cf8c Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:26:12 -0500 Subject: [PATCH 1/6] fix(pytest_plugin): Pytester import Fixes (#441) --- tests/test_pytest_plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py index b165806e3..3d9cb5503 100644 --- a/tests/test_pytest_plugin.py +++ b/tests/test_pytest_plugin.py @@ -2,11 +2,9 @@ import pytest -import _pytest.pytester - def test_plugin( - pytester: _pytest.pytester.Pytester, + pytester: pytest.Pytester, monkeypatch: pytest.MonkeyPatch, ) -> None: # Initialize variables From 69101f2c221cbf817f215ebbd7ff6b1bbbc77a5f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:30:10 -0500 Subject: [PATCH 2/6] fix(test_common): Avoid reliance on internal pytest API for typing --- tests/test_common.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_common.py b/tests/test_common.py index 14c5c39a5..d09d21e84 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -8,8 +8,6 @@ import pytest -from _pytest.monkeypatch import MonkeyPatch - import libtmux from libtmux.common import ( TMUX_MAX_VERSION, @@ -31,7 +29,7 @@ version_regex = re.compile(r"([0-9]\.[0-9])|(master)") -def test_allows_master_version(monkeypatch: MonkeyPatch) -> None: +def test_allows_master_version(monkeypatch: pytest.MonkeyPatch) -> None: class Hi: stdout = ["tmux master"] stderr = None @@ -49,7 +47,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi: ), "Is the latest supported version with -master appended" -def test_allows_next_version(monkeypatch: MonkeyPatch) -> None: +def test_allows_next_version(monkeypatch: pytest.MonkeyPatch) -> None: TMUX_NEXT_VERSION = str(float(TMUX_MAX_VERSION) + 0.1) class Hi: @@ -67,7 +65,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi: assert TMUX_NEXT_VERSION == get_version() -def test_get_version_openbsd(monkeypatch: MonkeyPatch) -> None: +def test_get_version_openbsd(monkeypatch: pytest.MonkeyPatch) -> None: class Hi: stderr = ["tmux: unknown option -- V"] @@ -84,7 +82,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi: ), "Is the latest supported version with -openbsd appended" -def test_get_version_too_low(monkeypatch: MonkeyPatch) -> None: +def test_get_version_too_low(monkeypatch: pytest.MonkeyPatch) -> None: class Hi: stderr = ["tmux: unknown option -- V"] @@ -97,7 +95,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi: exc_info.match("is running tmux 1.3 or earlier") -def test_ignores_letter_versions(monkeypatch: MonkeyPatch) -> None: +def test_ignores_letter_versions(monkeypatch: pytest.MonkeyPatch) -> None: """Ignore letters such as 1.8b. See ticket https://github.com/tmux-python/tmuxp/issues/55. @@ -120,7 +118,7 @@ def test_ignores_letter_versions(monkeypatch: MonkeyPatch) -> None: assert type(has_version("1.9a")) is bool -def test_error_version_less_1_7(monkeypatch: MonkeyPatch) -> None: +def test_error_version_less_1_7(monkeypatch: pytest.MonkeyPatch) -> None: def mock_get_version() -> LooseVersion: return LooseVersion("1.7") From 472a3a3d236d6e769b27e734d8c417a42482b19f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:54:28 -0500 Subject: [PATCH 3/6] build(pyproject): Include conftest.py with source output --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a8a6d5a4b..dd5570a91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ include = [ { path = ".tmuxp.yaml", format = "sdist" }, { path = "tests", format = "sdist" }, { path = "docs", format = "sdist" }, + { path = "conftest.py", format = "sdist" }, ] [tool.poetry.urls] From 62c2f399534d1ec3ee7e013ebfd1d3e98cc4772c Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:54:59 -0500 Subject: [PATCH 4/6] build(pyproject): Include .tmuxp-before-script.sh with sdist --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index dd5570a91..89895a4c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ packages = [ include = [ { path = "CHANGES", format = "sdist" }, { path = ".tmuxp.yaml", format = "sdist" }, + { path = ".tmuxp-before-script.sh", format = "sdist" }, { path = "tests", format = "sdist" }, { path = "docs", format = "sdist" }, { path = "conftest.py", format = "sdist" }, From bc34e8fdb01b18d2749fe886aca62afb7d1baee7 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:45:54 -0500 Subject: [PATCH 5/6] docs(CHANGES): Update changes for import fixes --- CHANGES | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 2244b41ac..924f5f4f8 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,13 @@ $ pip install --user --upgrade --pre libtmux - _Insert changes/features/fixes for next release here_ +## libtmux 0.15.4 (unreleased) + +### Bug fixes + +- Use stable `pytest` API imports where possible to fix issues in downstream + packaging on Arch (#441, via #442) + ## libtmux 0.15.3 (2022-09-20) ### Tests / docs From f4d5bfcfeeda1f6822eed59e234b1a22faacd3a0 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 21 Sep 2022 18:57:40 -0500 Subject: [PATCH 6/6] docs(CHANGES): Note source files additions --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 924f5f4f8..97431e254 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,11 @@ $ pip install --user --upgrade --pre libtmux - Use stable `pytest` API imports where possible to fix issues in downstream packaging on Arch (#441, via #442) +### Packaging + +- Add `.tmuxp-before-script.sh` (used by `.tmuxp.yaml`) and `conftest.py` to + source distributoins (#441, via #442) + ## libtmux 0.15.3 (2022-09-20) ### Tests / docs