From 6a73714dfdc484bdd127dd10f551a348a5b8551697397576ba0d9cf3e65ce7cb 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 --- .gitattributes | 23 +++++ .gitignore | 1 + avoid-click-8.2-bug.patch | 13 +++ python-dotenv-1.0.1.tar.gz | 3 + python-dotenv-1.1.0.tar.gz | 3 + python-python-dotenv.changes | 169 +++++++++++++++++++++++++++++++++++ python-python-dotenv.spec | 88 ++++++++++++++++++ 7 files changed, 300 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 avoid-click-8.2-bug.patch create mode 100644 python-dotenv-1.0.1.tar.gz create mode 100644 python-dotenv-1.1.0.tar.gz create mode 100644 python-python-dotenv.changes create mode 100644 python-python-dotenv.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc 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-dotenv-1.0.1.tar.gz b/python-dotenv-1.0.1.tar.gz new file mode 100644 index 0000000..d49998f --- /dev/null +++ b/python-dotenv-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cba4f54853af25e248c37400d4bd16549b52b27ee16839317841bbe388b19d56 +size 25641 diff --git a/python-dotenv-1.1.0.tar.gz b/python-dotenv-1.1.0.tar.gz new file mode 100644 index 0000000..56892e4 --- /dev/null +++ b/python-dotenv-1.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b9722774d3126917226cc39d0b63deb45bd9edacf8fa9b08aceee8e6d9a246d +size 26494 diff --git a/python-python-dotenv.changes b/python-python-dotenv.changes new file mode 100644 index 0000000..71958c8 --- /dev/null +++ b/python-python-dotenv.changes @@ -0,0 +1,169 @@ +------------------------------------------------------------------- +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 + +- update to 1.1.0: + * Add a security policy + * Enhance dotenv run: Switch to execvpe for better resource management and + signal handling + * Add Python 3.13 trove classifier + * Add support for python 3.13 and drop 3.8 + * docs: Update README.md + * Some more s/Python-dotenv/python-dotenv/ + * add _is_debugger so load_dotenv will work in pdb + +------------------------------------------------------------------- +Thu Feb 1 21:23:28 UTC 2024 - Dirk Müller + +- update to 1.0.1: + * Gracefully handle code which has been imported from a zipfile + * Allow modules using load_dotenv to be reloaded when launched + in a separate thread + * Fix file not closed after deletion, handle error in the + rewrite function + * Use pathlib.Path in tests + * Fix year in release date in changelog.md + * Use https in README links + +------------------------------------------------------------------- +Sun May 7 09:14:08 UTC 2023 - Dirk Müller + +- update to 1.0.0: + * Drop support for python 3.7, add python 3.12-dev + * Handle situations where the cwd does not exist. + * Use Python 3.11 non-beta in CI + * Modernize variables code + * Modernize main.py and parser.py code + * Improve conciseness of cli.py and __init__.py + * Improve error message for `get` and `list` commands when env + file can't be opened + * Updated License to align with BSD OSI template + * Fix Out-of-scope error when "dest" variable is undefined + * Fix IPython test warning about deprecated `magic` + * Fix type hint for dotenv_path var, add StrPath alias + * CLI: add support for invocations via 'python -m'. + * `load_dotenv` function now returns `False`. + * CLI: add --format= option to list command. + * Drop Python 3.5 and 3.6 and upgrade GA + * Use `open` instead of `io.open`. + * Improve documentation for variables without a value + * Add `parse_it` to Related Projects + * Update README.md + * Improve documentation with direct use of MkDocs + +------------------------------------------------------------------- +Wed Apr 26 01:56:00 UTC 2023 - John Vandenberg + +- Remove duplicate sle15_python_module_pythons + +------------------------------------------------------------------- +Fri Apr 21 12:32:14 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Wed Apr 19 01:08:36 UTC 2023 - Matej Cepl + +- Switch to single spec version build for PSP + +------------------------------------------------------------------- +Thu Apr 13 22:44:15 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Mon Apr 11 10:55:56 UTC 2022 - Markéta Machová + +- Update to 0.20.0 + * The default value of the encoding parameter for load_dotenv and dotenv_values is now "utf-8" instead of None + * Add --override/--no-override option to dotenv run + * Raise ValueError if quote_mode isn't one of always, auto or never in set_key + * Require Python 3.5 or a later version. Python 2 and 3.4 are no longer supported. + * The stream argument of load_dotenv and dotenv_values can now be a text stream (IO[str]), + which includes values like io.StringIO("foo") and open("file.env", "r") + * Add support for Python 3.10. + * Add encoding (Optional[str]) parameter to get_key, set_key and unset_key. +- Do not require mock + +------------------------------------------------------------------- +Mon Feb 21 09:09:13 UTC 2022 - Andreas Schneider + +- Skip building for python2 + +------------------------------------------------------------------- +Mon Dec 7 00:42:19 UTC 2020 - Benjamin Greiner + +- Skip testing with optional jupyter_ipython. Jupyter is only + available for Python >= 3.7 + gh#openSUSE/python-rpm-macros#66 + +------------------------------------------------------------------- +Wed Dec 2 17:16:41 UTC 2020 - Michael Ströder + +- Update to 0.15.0 + * Add --export option to set to make it prepend the binding with export (#270 by @jadutter). + * Make set command create the .env file in the current directory if no .env file was found (#270 by @jadutter). + * Fix potentially empty expanded value for duplicate key (#260 by @bbc2). + * Fix import error on Python 3.5.0 and 3.5.1 (#267 by @gongqingkui). + * Fix parsing of unquoted values containing several adjacent space or tab characters (#277 by @bbc2, review by @x-yuri). + +------------------------------------------------------------------- +Wed Aug 5 13:46:03 UTC 2020 - Marketa Calabkova + +- Update to 0.14.0 + * Privilege definition in file over the environment in variable expansion (#256 by + [@elbehery95]). + * Improve error message for when file isn't found (#245 by [@snobu]). + * Use HTTPS URL in package meta data (#251 by [@ekohl]). + +------------------------------------------------------------------- +Tue Jun 30 04:44:30 UTC 2020 - John Vandenberg + +- Downgrade jupyter_ipython from Recommends to Suggests as + python-dotenv is now a dependency of docker-compose + +------------------------------------------------------------------- +Wed May 20 12:41:06 UTC 2020 - Marketa Calabkova + +- Update to 0.13.0 + * Add support for a Bash-like default value in variable expansion + * Fix escaping of quoted values written by set_key + * Few more fixes + +------------------------------------------------------------------- +Wed Mar 18 09:17:07 UTC 2020 - Tomáš Chvátal + +- Update to 0.12.0: + * various fixes + +------------------------------------------------------------------- +Mon Jul 22 13:18:03 UTC 2019 - Tomáš Chvátal + +- Update to 0.10.3: + * Small cleanups + +------------------------------------------------------------------- +Sat May 25 08:58:11 UTC 2019 - Tomáš Chvátal + +- Update to 0.10.2: + * Add type hints and expose them to users (@qnighy)(#172) + * load_dotenv and dotenv_values now accept an encoding parameter, defaults to None (@theskumar)(@earlbread)(#161) + * Fix str/unicode inconsistency in Python 2: values are always str now. (@bbc2)(#121) + * Fix Unicode error in Python 2, introduced in 0.10.0. (@bbc2)(#176) + +------------------------------------------------------------------- +Thu Mar 7 15:42:54 UTC 2019 - John Vandenberg + +- Add LANG=C.UTF-8 to %check to fix tests on Leap +- Rename tarball to match name provided by PyPI + +------------------------------------------------------------------- +Fri Feb 15 06:37:32 UTC 2019 - John Vandenberg + +- Initial spec for 0.10.1 diff --git a/python-python-dotenv.spec b/python-python-dotenv.spec new file mode 100644 index 0000000..5384668 --- /dev/null +++ b/python-python-dotenv.spec @@ -0,0 +1,88 @@ +# +# spec file for package python-python-dotenv +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-python-dotenv +Version: 1.1.0 +Release: 0 +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 +# rubygem-dotenv also provides executable dotenv +Requires(post): update-alternatives +Requires(postun): update-alternatives +Suggests: python-jupyter_ipython +# There is a very similar Python package which also used `dotenv` namespace +Conflicts: python-dotenv +BuildArch: noarch +%python_subpackages + +%description +Add .env support to your Django/Flask apps in development and deployments. + +%prep +%autosetup -p1 -n python-dotenv-%{version} + +%build +export LANG=C.UTF-8 +%pyproject_wheel + +%install +export LANG=C.UTF-8 +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/dotenv +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export LANG=C.UTF-8 +mv %{buildroot}%{_bindir}/dotenv %{buildroot}%{_bindir}/dotenv.orig +# CLI tests require distribution to be found, and the correct executable installed +export PATH=%{buildroot}%{_bindir}:$PATH +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} +cp %{buildroot}%{_bindir}/dotenv-%{$python_bin_suffix} %{buildroot}%{_bindir}/dotenv +# ipython is optional and only available for python >= 3.7 in Tumbleweed +$python -m pytest -v -k "not ipython" +} +mv %{buildroot}%{_bindir}/dotenv.orig %{buildroot}%{_bindir}/dotenv + +%post +%python_install_alternative dotenv + +%postun +%python_uninstall_alternative dotenv + +%files %{python_files} +%doc README.md +%license LICENSE +%python_alternative %{_bindir}/dotenv +%{python_sitelib}/dotenv/ +%{python_sitelib}/python_dotenv-%{version}.dist-info + +%changelog