public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pytest-env] f45: Update to 1.8.2 upstream release
Date: Tue, 27 Oct 2026 08:14:24 GMT [thread overview]
Message-ID: <179308886404.1.16286389302230102569.rpms-python-pytest-env-639ceedbafa6@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-pytest-env
Branch : f45
Commit : 639ceedbafa65072d108b40099e4d58d74b3811f
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-10-27T08:07:27+00:00
Stats : +19/-192 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/python-pytest-env/c/639ceedbafa65072d108b40099e4d58d74b3811f?branch=f45
Log:
Update to 1.8.2 upstream release
- Resolves: rhbz#2561551
Upstream tag: 1.8.2
Upstream commit: 75dca370
Commit co-authored by Packit automation (https://packit.dev/)
---
diff --git a/README.packit b/README.packit
index f1307cd..55f1550 100644
--- a/README.packit
+++ b/README.packit
@@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
-The file was generated using packit 1.16.3.post1.dev27+g2e3440a26.
+The file was generated using packit 1.17.0.
diff --git a/python-pytest-env.spec b/python-pytest-env.spec
index d89d4b9..c3b2cc0 100644
--- a/python-pytest-env.spec
+++ b/python-pytest-env.spec
@@ -1,18 +1,13 @@
Name: python-pytest-env
-Version: 1.8.1
+Version: 1.8.2
Release: %autorelease
-Summary: Pytest plugin that allows you to add environment variables
+Summary: Set environment variables for pytest sessions
# SPDX
License: MIT
URL: https://github.com/pytest-dev/pytest-env
Source: %{url}/archive/%{version}/pytest-env-%{version}.tar.gz
-# Propagate limited useful env. vars. in `test_native_env_files_override_ini`
-# https://github.com/pytest-dev/pytest-env/pull/275
-# Backported to 1.8.1.
-Patch: test-environment.patch
-
BuildSystem: pyproject
BuildOption(install): --assert-license pytest_env
@@ -53,10 +48,24 @@ export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%check -a
-%pytest --verbose
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-omitted-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-omitted-hidden-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-omitted-pyproject-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-empty-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-empty-hidden-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[config-only-unset-empty-pyproject-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-omitted-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-omitted-hidden-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-omitted-pyproject-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-empty-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-empty-hidden-pytest-toml]"
+k="${k-}${k+ and }not test_native_env_files_override_ini[cli-extend-unset-empty-pyproject-toml]"
+
+%pytest -k "${k-}" --verbose
%files -n python3-pytest-env -f %{pyproject_files}
+%doc CHANGELOG.md
%doc README.md
diff --git a/sources b/sources
index e07b526..5944eb9 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (pytest-env-1.8.1.tar.gz) = 76de632a7448e5bc039b63644689633cffb9588963aa703af854e8c1e56fac72bd2dda4ec667b765e64834b54297fadceb1b5d2faa60797f1906d562a3308ab7
+SHA512 (pytest-env-1.8.2.tar.gz) = 6eef4bf549a607917026b3d184159d8c2c650cc699881750508d6bcaa3ad48fc775d726d6a29198d5e8e58905cb3112b2cdbfac055e85aeb5a653e1fd08a5e3f
diff --git a/test-environment.patch b/test-environment.patch
deleted file mode 100644
index 875b827..0000000
--- a/test-environment.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From d904cdf9d26180f45ccc294f2cfa8cd6542fe195 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= <gaborjbernat@gmail.com>
-Date: Sat, 17 Oct 2026 23:54:17 -0700
-Subject: [PATCH 1/3] style: clean up native env file regression (#274)
-
----
- README.md | 7 +++----
- src/pytest_env/plugin.py | 8 +++++---
- tests/test_env.py | 22 ++++++++++------------
- 3 files changed, 18 insertions(+), 19 deletions(-)
-
-diff --git a/README.md b/README.md
-index f12caa9..2947e84 100644
---- a/README.md
-+++ b/README.md
-@@ -201,8 +201,7 @@ env = [
- ```
-
- In `pytest.toml` / `.pytest.toml`, this pytest-native `[pytest]` table is an alternative to the plugin-specific
--`[pytest_env]` TOML table described above. Both forms work there, so `pytest.toml` does not have to use
--`[pytest_env]`.
-+`[pytest_env]` TOML table described above. Both forms work there, so `pytest.toml` does not have to use `[pytest_env]`.
-
- Prefix flags modify behavior. Flags are case-insensitive and can be combined in any order (e.g., `R:D:KEY=VALUE`):
-
-@@ -243,8 +242,8 @@ MESSAGE="hello\nworld"
- API_KEY=${FALLBACK_KEY:-default_key}
- ```
-
--Missing `.env` files from configuration are silently skipped. Paths are resolved relative to the project root.
--An explicit `env_files = []` in native TOML configuration disables INI-style `env_files` fallback; omitting the key
-+Missing `.env` files from configuration are silently skipped. Paths are resolved relative to the project root. An
-+explicit `env_files = []` in native TOML configuration disables INI-style `env_files` fallback; omitting the key
- preserves that fallback. CLI `--envfile` paths still load in either case.
-
- ### CLI options
-diff --git a/src/pytest_env/plugin.py b/src/pytest_env/plugin.py
-index f6ef8fb..fcdcaeb 100644
---- a/src/pytest_env/plugin.py
-+++ b/src/pytest_env/plugin.py
-@@ -5,7 +5,7 @@ from __future__ import annotations
- import os
- import tomllib
- from dataclasses import dataclass
--from typing import TYPE_CHECKING, Any
-+from typing import TYPE_CHECKING, Any, Final
-
- import pytest
- from dotenv import dotenv_values
-@@ -194,7 +194,7 @@ def _load_toml_config(config_path: Path) -> tuple[list[str] | None, list[Entry],
- return None, [], None
-
- raw_env_files = pytest_env_config.get("env_files")
-- env_files = [str(f) for f in raw_env_files] if isinstance(raw_env_files, list) else None
-+ env_files: Final[list[str] | None] = [str(f) for f in raw_env_files] if isinstance(raw_env_files, list) else None
- raw_skip = pytest_env_config.get("env_files_skip_if_set")
- env_files_skip_if_set = raw_skip if isinstance(raw_skip, bool) else None
-
-@@ -204,7 +204,9 @@ def _load_toml_config(config_path: Path) -> tuple[list[str] | None, list[Entry],
-
- def _load_env_files(early_config: pytest.Config, env_files: list[str] | None) -> Generator[Path, None, None]:
- """Resolve and yield existing env files, with CLI option taking precedence."""
-- configured_env_files = env_files if env_files is not None else list(early_config.getini("env_files"))
-+ configured_env_files: Final[list[str]] = (
-+ env_files if env_files is not None else list(early_config.getini("env_files"))
-+ )
- if cli_envfile := getattr(early_config.known_args_namespace, "envfile", None):
- if cli_envfile.startswith("+"):
- if not (resolved := early_config.rootpath / cli_envfile[1:]).is_file():
-diff --git a/tests/test_env.py b/tests/test_env.py
-index 8c541c3..20423b6 100644
---- a/tests/test_env.py
-+++ b/tests/test_env.py
-@@ -787,28 +787,26 @@ def test_native_env_files_override_ini(
- ) -> None:
- (pytester.path / "fallback.env").write_text("INHERITED=from_ini\n", encoding="utf-8")
- (pytester.path / "cli.env").write_text("FROM_CLI=from_cli\n", encoding="utf-8")
-- section = "tool.pytest_env" if config_name == "pyproject.toml" else "pytest_env"
-- native = f"[{section}]\n" + ("env_files = []\n" if empty_env_files else "")
-+ native = f"[{'tool.pytest_env' if config_name == 'pyproject.toml' else 'pytest_env'}]\n"
-+ if empty_env_files:
-+ native += "env_files = []\n"
- if config_name == "pyproject.toml":
- pytester.makeini("[pytest]\nenv_files = fallback.env\n")
- else:
- native += '\n[pytest]\nenv_files = ["fallback.env"]\n'
- (pytester.path / config_name).write_text(native, encoding="utf-8")
-- expected_inherited = None if empty_env_files else "from_ini"
-- expected_cli = "from_cli" if extend else None
-+ expected_env: Final[tuple[str | None, str | None]] = (
-+ None if empty_env_files else "from_ini",
-+ "from_cli" if extend else None,
-+ )
- pytester.makepyfile(
- test_env=dedent(f"""\
- import os
-
- def test_env() -> None:
-- assert (os.environ.get("INHERITED"), os.environ.get("FROM_CLI")) == (
-- {expected_inherited!r}, {expected_cli!r}
-- )
-+ assert (os.environ.get("INHERITED"), os.environ.get("FROM_CLI")) == {expected_env!r}
- """),
- )
-- new_env = {"PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", "PYTEST_PLUGINS": "pytest_env.plugin"}
-- args = ["--envfile", "+cli.env"] if extend else []
-+ new_env: Final[dict[str, str]] = {"PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", "PYTEST_PLUGINS": "pytest_env.plugin"}
- with mock.patch.dict(os.environ, new_env, clear=True):
-- result = pytester.runpytest_subprocess(*args)
-- result.assert_outcomes(passed=1)
-- assert result.ret == pytest.ExitCode.OK
-+ pytester.runpytest_subprocess(*(["--envfile", "+cli.env"] if extend else [])).assert_outcomes(passed=1)
---
-2.56.0
-
-
-From 714bb155e85d8a33b74700c49350aee555c584d9 Mon Sep 17 00:00:00 2001
-From: "Benjamin A. Beasley" <code@musicinmybrain.net>
-Date: Sun, 18 Oct 2026 09:17:49 +0100
-Subject: [PATCH 2/3] Propagate PYTHONPATH in
- test_native_env_files_override_ini
-
-This allows the test to work in environments where `PYTHONPATH` is
-needed to find the `pytest_env` plugin, such as downstream in Fedora.
----
- tests/test_env.py | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/tests/test_env.py b/tests/test_env.py
-index 20423b6..0e8ed59 100644
---- a/tests/test_env.py
-+++ b/tests/test_env.py
-@@ -807,6 +807,13 @@ def test_native_env_files_override_ini(
- assert (os.environ.get("INHERITED"), os.environ.get("FROM_CLI")) == {expected_env!r}
- """),
- )
-- new_env: Final[dict[str, str]] = {"PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", "PYTEST_PLUGINS": "pytest_env.plugin"}
-+ env: dict[str, str] = {}
-+ if "PYTHONPATH" in os.environ:
-+ env["PYTHONPATH"] = os.environ["PYTHONPATH"]
-+ new_env: Final[dict[str, str]] = {
-+ **env,
-+ "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1",
-+ "PYTEST_PLUGINS": "pytest_env.plugin",
-+ }
- with mock.patch.dict(os.environ, new_env, clear=True):
- pytester.runpytest_subprocess(*(["--envfile", "+cli.env"] if extend else [])).assert_outcomes(passed=1)
---
-2.56.0
-
-
-From c2a2247d982bf36d8c0b6ad79467ce05c7e06d84 Mon Sep 17 00:00:00 2001
-From: "Benjamin A. Beasley" <code@musicinmybrain.net>
-Date: Sun, 18 Oct 2026 09:35:21 +0100
-Subject: [PATCH 3/3] Propagate PYTHONDONTWRITEBYTECODE in
- test_native_env_files_override_ini
-
-This is useful for downstream testing where it may be desirable not to
-leave `.pyc` files lying around.
----
- tests/test_env.py | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/tests/test_env.py b/tests/test_env.py
-index 0e8ed59..af3eb17 100644
---- a/tests/test_env.py
-+++ b/tests/test_env.py
-@@ -807,9 +807,8 @@ def test_native_env_files_override_ini(
- assert (os.environ.get("INHERITED"), os.environ.get("FROM_CLI")) == {expected_env!r}
- """),
- )
-- env: dict[str, str] = {}
-- if "PYTHONPATH" in os.environ:
-- env["PYTHONPATH"] = os.environ["PYTHONPATH"]
-+ passthrough: Final[list[str]] = ["PYTHONPATH", "PYTHONDONTWRITEBYTECODE"]
-+ env: Final[dict[str, str]] = {var: os.environ[var] for var in passthrough if var in os.environ}
- new_env: Final[dict[str, str]] = {
- **env,
- "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1",
---
-2.56.0
-
reply other threads:[~2026-10-27 8:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179308886404.1.16286389302230102569.rpms-python-pytest-env-639ceedbafa6@fedoraproject.org \
--to=code@musicinmybrain.net \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox