From 82be1e61562ffe1cad4b7b7a9730fa3288e2d65ef027bf2637f2595da962196c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 20 Dec 2024 00:12:36 +0000 Subject: [PATCH] - Add missing requirements - Add fix-broken-mock-test.patch to fix testsuite OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-nox?expand=0&rev=23 --- .gitattributes | 23 ++++ .gitignore | 1 + fix-broken-mock-test.patch | 46 +++++++ nox-2024.10.9.tar.gz | 3 + nox-2024.4.15.tar.gz | 3 + python-nox.changes | 252 +++++++++++++++++++++++++++++++++++++ python-nox.spec | 90 +++++++++++++ 7 files changed, 418 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 fix-broken-mock-test.patch create mode 100644 nox-2024.10.9.tar.gz create mode 100644 nox-2024.4.15.tar.gz create mode 100644 python-nox.changes create mode 100644 python-nox.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/fix-broken-mock-test.patch b/fix-broken-mock-test.patch new file mode 100644 index 0000000..916c8dc --- /dev/null +++ b/fix-broken-mock-test.patch @@ -0,0 +1,46 @@ +From 28bbaa5a17ed1ac39be63b1ecd9bd7e187a7db2e Mon Sep 17 00:00:00 2001 +From: Henry Schreiner +Date: Thu, 12 Dec 2024 21:44:02 -0500 +Subject: [PATCH] tests: fix broken mock on CPython 3.12.8+ (#903) + +Signed-off-by: Henry Schreiner +--- + nox/command.py | 4 +++- + tests/test_command.py | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +Index: nox-2024.04.15/nox/command.py +=================================================================== +--- nox-2024.04.15.orig/nox/command.py ++++ nox-2024.04.15/nox/command.py +@@ -36,6 +36,8 @@ if TYPE_CHECKING: + + ExternalType = Literal["error", True, False] + ++_PLATFORM = sys.platform ++ + + class CommandFailed(Exception): + """Raised when an executed command returns a non-success status code.""" +@@ -67,7 +69,7 @@ def _clean_env(env: Mapping[str, str | N + clean_env = {k: v for k, v in env.items() if v is not None} + + # Ensure systemroot is passed down, otherwise Windows will explode. +- if sys.platform == "win32": ++ if _PLATFORM.startswith("win"): + clean_env.setdefault("SYSTEMROOT", os.environ.get("SYSTEMROOT", "")) + + return clean_env +Index: nox-2024.04.15/tests/test_command.py +=================================================================== +--- nox-2024.04.15.orig/tests/test_command.py ++++ nox-2024.04.15/tests/test_command.py +@@ -157,7 +157,7 @@ def test_run_env_remove(monkeypatch): + ) + + +-@mock.patch("sys.platform", "win32") ++@mock.patch("nox.command._PLATFORM", "win32") + def test_run_env_systemroot(): + systemroot = os.environ.setdefault("SYSTEMROOT", "sigil") + diff --git a/nox-2024.10.9.tar.gz b/nox-2024.10.9.tar.gz new file mode 100644 index 0000000..46c0f5d --- /dev/null +++ b/nox-2024.10.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2045cae9525cd25d62070213515a9aff830beba3d1934b0432cad10abcdf9f96 +size 4001096 diff --git a/nox-2024.4.15.tar.gz b/nox-2024.4.15.tar.gz new file mode 100644 index 0000000..46c0f5d --- /dev/null +++ b/nox-2024.4.15.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2045cae9525cd25d62070213515a9aff830beba3d1934b0432cad10abcdf9f96 +size 4001096 diff --git a/python-nox.changes b/python-nox.changes new file mode 100644 index 0000000..5e401ba --- /dev/null +++ b/python-nox.changes @@ -0,0 +1,252 @@ +------------------------------------------------------------------- +Thu Dec 19 15:26:17 UTC 2024 - Nico Krapp + +- Add missing requirements +- Add fix-broken-mock-test.patch to fix testsuite + +------------------------------------------------------------------- +Wed Oct 23 20:29:29 UTC 2024 - Dirk Müller + +- update to 2024.10.09: + * This release adds explicit support for Python 3.13 and drops + support for running Nox itself under Python 3.7. Note that + you can still use 3.7 in your Nox sessions, we just dropped + support for installing & running `nox` itself in 3.7. + * Allow setting tags on parametrized sessions + * Added support for `uv`-installed pythons + * Added `session.install_and_run_script` + * Updated type annotation of `stderr` parameter to make it + optional + * Removed `add_timestamp` from `noxfile.options` + +------------------------------------------------------------------- +Sat Apr 20 20:57:29 UTC 2024 - Dirk Müller + +- update to 2024.04.15: + * Added support for PEP 723 (inline script metadata) with + `nox.project.load_toml` + * Added support for `micromamba` + * Added `venv_backend` property to sessions + * Added the ability to use `None` to remove environment + variables + * Added support for skipping sessions by default using + `default=False` + * Use static arguments instead of `**kwargs` + * Do not depend on `pipx` in Nox GitHub action + * Disallow `UV_SYSTEM_PYTHON` + * Ensure 'uv' always works in a uv venv + * Fixed missing f-string in `--help` message + * Don't error if not installing to passthrough + * Avoid mixing `venv` and `conda` from environment + * Skip test for conda env when `conda` isn't installed +- drop support-tox-4.patch (upstream) + +------------------------------------------------------------------- +Fri Mar 15 21:08:41 UTC 2024 - Dirk Müller + +- update to 2024.03.02: + * Add `uv` backend + * Add venv backend fallback + * Add option `--reuse-venv {yes,no,never,always}` + * Add environment variable `NOX_DEFAULT_VENV_BACKEND` for + default backend + * Rename `session.run_always` to `session.run_install` + * Add more option argument completions + * Implement `tox-to-nox` for tox 4 + * Allow `--force-python` on unparametrized sessions + * Add `include_outer_env` parameter to `session.run` and + friends + * GitHub Action: Add support for the `~` version specifier + +------------------------------------------------------------------- +Fri Jun 23 02:42:02 UTC 2023 - Steve Kowalik + +- Add patch support-tox-4.patch: + * Support tox 4 +- Refresh upstream tarball due to repo move. + +------------------------------------------------------------------- +Tue Apr 25 02:05:35 UTC 2023 - John Vandenberg + +- Update to v2023.4.22 + * Add support for NOXPYTHON, NOXEXTRAPYTHON and NOXFORCEPYTHON + * feat: --json --list-sessions + * style: spelling and grammar fixes + * Constrain tox to <4.0.0 and minor fixes + * chore: long term fix for bugbear opinionated checks + * chore: switch to hatchling + * Don't run python 2.7 virtualenv tests for newer versions of virtualenv + * allow the use of argcomplete 3 + * fix: enable list_sessions for session completion + * chore: remove 3.6 tests, min version is 3.7 +- from v2022.11.21 + * Include Python 3.11 classifier & testing + * Fixed a few typos + * Drop dependency on py + * nox.session.run now accepts a pathlib.Path for the command + * Document nox.session.run's stdout and stderr arguments and + add example of capturing output + * Docs: fix argument passing in session.posargs example + * GitHub Action: move to 3.11 final + * Cleanup Python 2 style code +- from 2022.8.7 + * Drop support for Python 3.6 + * Disable running session.install outside a venv + * Official Nox GitHub Action + * Missing interpreters now error the session on CI by default + * Allow configurable child shutdown timeouts + * Add session tags + * Add short -N alias for --no-reuse-existing-virtualenvs + * Export session name in NOX_CURRENT_SESSION environment variable + * Add VENV_DIR to dev session in cookbook + * Support descriptions in tox-to-nox + * Document that silent=True returns the command output + * Support argcomplete v2 + * Fix incorrect FileNotFoundError in load_nox_module + * Update the classifiers, documentation, and more to point to the + new Winterbloom location + * Support PEP 621 (pyproject.toml) + * Prefer type checking against Jinja2 + * Full strictness checking on mypy + * Drop 99% coverage threshold flag for 3.10 in noxfile +- from 2022.1.7 + * Add mamba backend + * Add session.debug to show debug-level messages + * Add cookbook page to the documentation + * Add support for the FORCE_COLOR environment variable + * Allow using session.chdir() as a context manager + * Deprecate use of session.install() without a valid backend + * Test against Python 3.10 + * Add support for the channel option when using the conda backend + * Show more specific error message when the --keywords expression + contains a syntax error + * Include reference to session.notify() in tutorial page + * Document how session.run() fails and how to handle failures + * Allow the list of sessions to be empty + * Fix broken temporary directory when using session.chdir() + * Set the CONDA_PREFIX environment variable + * Fix bin directory for the conda backend on Windows + * Replace deprecated load_module with exec_module + * Include tests with source distributions + * Add missing copyright notices + * Use the new ReadTheDocs configurations + * Make setuptools use the standard library's distutils to + work around virtualenv bug. + * Use shlex.join() when logging a command + * Use shutil.rmtree() over shelling out to rm -rf in noxfile + * Fix missing Python 3.9 CI session + * Unpin docs session and add --error-on-missing-interpreter to CI + * Only run conda_tests session by default if user has conda installed + * Update dependencies in requirements-conda-test.txt +- from v2021.10.1 + * Add session.warn to output warnings + * Add a shared session cache directory + * Add session.invoked_from + * Conda logs now respect nox.options.verbose + * Add friendlier message if no noxfile.py is found + * Show the noxfile.py docstring when using nox -l + * Move configs into pyproject.toml or setup.cfg (flake8) + * Use PEP 517 build system, remove setup.py, use setup.cfg +- from v2021.6.12 + * Fix crash on Python 2 when reusing environments + * Hide staleness check behind a feature flag + * Group command-line options in --help message by function + * Avoid polluting tests with a .nox directory +- from v2021.6.6 + * Add option --no-install to skip install commands in + reused environments + * Add option --force-python as shorthand for --python and + --extra-python + * Do not reuse environments if the interpreter or the + environment type has changed + * Allow common variations in session names with parameters, + such as double quotes instead of single quotes. + Session names are considered equal if they produce the same + Python AST. + * Preserve the order of parameters in session names + * Allow @nox.parametrize to select the session Python + * Allow passing posargs when scheduling another session via + session.notify + * Prevent sessions from modifying each other's posargs + * Add nox.needs_version to specify Nox version requirements + * Add session.name to get the session name + * Gracefully shutdown child processes + * Decode command output using the system locale if UTF-8 + decoding fails + * Fix creation of Conda environments when venv_params is used + * Various improvements to Nox's type annotations + * Allow colorlog <7.0.0. +- from v2020.12.31 + * Fix NoxColoredFormatter.format + * Use conda remove to clean up existing conda environments + * Support users specifying an undeclared parametrization of + python via --extra-python + * Support double-digit minor version in python keyword + * Add py.typed to manifest.in + * Update Nox to latest supported python versions + * Decouple merging of --python with nox.options from --sessions + and --keywords + * Do not merge command-line options in place +- from v2020.8.22 + * conda_install and install args are now automatically double-quoted + when needed + * Offline mode is now auto-detected by default by conda_install. + This allows users to continue executing Nox sessions on already + installed environments + * Fix the default paths for Conda on Windows where the python.exe + found was not the correct one + * Add the --add-timestamp option + * Add Session.run_always() + +------------------------------------------------------------------- +Wed Jun 17 06:16:32 UTC 2020 - Steve Kowalik + +- Update to version 2020.5.24: + * Add new options for `venv_backend`, including the ability to set the + backend globally. (#326) + * Fix various typos in the documentation. (#325, #326, #281) + * Add `session.create_tmp`. (#320) + * Place all of Nox's command-line options into argparse groups. (#306) + * Add the `--pythons` command-line option to allow specifying which versions + of Python to run. (#304) + * Add a significant amount of type annotations. (#297, #294, #290, #282, #274) + * Stop building universal wheels since we don't support Python 2. (#293) + * Add the ability to specify additional options for the virtualenv backend using `venv_params`. (#280) + * Prefer `importlib.metadata` for metadata loading, removing our dependency on `pkg_resources`. (#277) + * Add OmegaConf and Hydra to list of projects that use Nox. (#279) + * Use a more accurate error message, along with the cause, if loading of noxfile runs into error. (#272) + * Test against Python 3.8. (#270) + * Fix a syntax highlighting mistake in configuration docs. (#268) + * Use `stdout.isatty` to finalize color instead of `stdin.isatty`. (#267) + +------------------------------------------------------------------- +Thu May 21 10:56:38 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Mon Mar 30 10:05:56 UTC 2020 - pgajdos@suse.com + +- version update to 2019.11.9 + - Fix example installation call for pip. (#259) + - Allow colorlog 4. (#257) + - Order Pythons in descending version in `appveyor.yml`. (#258) + - Add link to GitHub Action for Nox. (#255) + - Use double "\`" for inline code. (#254) + - Add types to `_option_set.py`. (#249) + - Add type hints to `tasks.py`. (#241) + - Fix typo (virtulenvs). (#247) + - Replace flake8 sorter with isort. (#242) + - Pass `VIRTUAL_ENV` environment variable to commands executed in a virtualenv. (#245) + - Fix docs to show correct list for parametrize. (#244) + - Add argcomplete dependency to conda test session. (#240) + +------------------------------------------------------------------- +Tue Oct 15 06:00:07 UTC 2019 - John Vandenberg + +- Remove upper version specifiers preventing use with latest colorlog + +------------------------------------------------------------------- +Mon Oct 14 09:48:06 AM UTC 2019 - John Vandenberg + +- Initial spec for v2019.8.20 diff --git a/python-nox.spec b/python-nox.spec new file mode 100644 index 0000000..6c15531 --- /dev/null +++ b/python-nox.spec @@ -0,0 +1,90 @@ +# +# spec file for package python-nox +# +# Copyright (c) 2024 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} +%global padded_version 2024.04.15 +Name: python-nox +Version: 2024.10.9 +Release: 0 +Summary: Flexible test automation +License: Apache-2.0 +URL: https://nox.thea.codes +Source: https://github.com/wntrblm/nox/archive/refs/tags/%{padded_version}.tar.gz#/nox-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-broken-mock-test.patch (gh#28bbaa5) +Patch0: fix-broken-mock-test.patch +BuildRequires: %{python_module base >= 3.8} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: git-core +BuildRequires: python-rpm-macros +Requires: python-argcomplete >= 1.9.4 +Requires: python-colorlog >= 2.6.1 +Requires: python-virtualenv >= 14.0.0 +Requires: (python-tomli if python-base < 3.11) +Requires(post): update-alternatives +Requires(postun): update-alternatives +Suggests: python-Jinja2 +Suggests: python-tox +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module Flask} +BuildRequires: %{python_module argcomplete >= 1.9.4} +BuildRequires: %{python_module colorlog >= 2.6.1} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module tox} +BuildRequires: %{python_module virtualenv >= 14.0.0} +# Missing deps conda +# /SECTION +%python_subpackages + +%description +Flexible test automation. + +%prep +%autosetup -p1 -n nox-%{padded_version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/tox-to-nox +%python_clone -a %{buildroot}%{_bindir}/nox +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%post +%python_install_alternative tox-to-nox +%python_install_alternative nox + +%postun +%python_uninstall_alternative tox-to-nox +%python_uninstall_alternative nox + +%files %{python_files} +%doc README.md +%license LICENSE +%python_alternative %{_bindir}/nox +%python_alternative %{_bindir}/tox-to-nox +%{python_sitelib}/nox* + +%changelog