From 85da7095dc5581df13a8417b0a9f6df3b0a13536319e029e205810421297951d Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 14 May 2025 05:41:57 +0000 Subject: [PATCH] - Add patch avoid-click-8.2-bug.patch: * Work around an upstream click 8.2.0 bug. - Switch to pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-dotenv?expand=0&rev=34 --- avoid-click-8.2-bug.patch | 13 +++++++++++++ python-python-dotenv.changes | 7 +++++++ python-python-dotenv.spec | 13 ++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 avoid-click-8.2-bug.patch diff --git a/avoid-click-8.2-bug.patch b/avoid-click-8.2-bug.patch new file mode 100644 index 0000000..be06a61 --- /dev/null +++ b/avoid-click-8.2-bug.patch @@ -0,0 +1,13 @@ +Index: python-dotenv-1.1.0/src/dotenv/cli.py +=================================================================== +--- python-dotenv-1.1.0.orig/src/dotenv/cli.py ++++ python-dotenv-1.1.0/src/dotenv/cli.py +@@ -60,6 +60,8 @@ def stream_file(path: os.PathLike) -> It + yield stream + except OSError as exc: + print(f"Error opening env file: {exc}", file=sys.stderr) ++ # Work around https://github.com/pallets/click/issues/2913 ++ sys.stderr.flush() + exit(2) + + diff --git a/python-python-dotenv.changes b/python-python-dotenv.changes index a6aef15..71958c8 100644 --- a/python-python-dotenv.changes +++ b/python-python-dotenv.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed May 14 05:41:25 UTC 2025 - Steve Kowalik + +- Add patch avoid-click-8.2-bug.patch: + * Work around an upstream click 8.2.0 bug. +- Switch to pyproject macros. + ------------------------------------------------------------------- Wed Apr 9 17:26:29 UTC 2025 - Richard Rahl diff --git a/python-python-dotenv.spec b/python-python-dotenv.spec index 244aa0c..5384668 100644 --- a/python-python-dotenv.spec +++ b/python-python-dotenv.spec @@ -16,7 +16,6 @@ # -%define skip_python2 1 %{?sle15_python_module_pythons} Name: python-python-dotenv Version: 1.1.0 @@ -25,10 +24,14 @@ Summary: Python library for .env support License: BSD-3-Clause URL: https://github.com/theskumar/python-dotenv Source: https://github.com/theskumar/python-dotenv/archive/v%{version}.tar.gz#/python-dotenv-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Avoid upstream click 8.2 bug -- gh#pallets/click#2913 +Patch0: avoid-click-8.2-bug.patch BuildRequires: %{python_module click >= 5.0} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 3.0.5} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sh >= 2.0} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-click >= 5.0 @@ -45,15 +48,15 @@ BuildArch: noarch Add .env support to your Django/Flask apps in development and deployments. %prep -%setup -q -n python-dotenv-%{version} +%autosetup -p1 -n python-dotenv-%{version} %build export LANG=C.UTF-8 -%python_build +%pyproject_wheel %install export LANG=C.UTF-8 -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/dotenv %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -80,6 +83,6 @@ mv %{buildroot}%{_bindir}/dotenv.orig %{buildroot}%{_bindir}/dotenv %license LICENSE %python_alternative %{_bindir}/dotenv %{python_sitelib}/dotenv/ -%{python_sitelib}/python_dotenv*/ +%{python_sitelib}/python_dotenv-%{version}.dist-info %changelog