Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-requre for openSUSE:Factory checked in at 2024-02-26 19:47:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-requre (Old) and /work/SRC/openSUSE:Factory/.python-requre.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-requre" Mon Feb 26 19:47:06 2024 rev:4 rq:1151858 version:0.8.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-requre/python-requre.changes 2023-07-18 21:55:29.742752994 +0200 +++ /work/SRC/openSUSE:Factory/.python-requre.new.1770/python-requre.changes 2024-02-26 19:47:50.755233964 +0100 @@ -1,0 +2,14 @@ +Mon Feb 26 16:32:40 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- restrict to new python stack in sle15 + +------------------------------------------------------------------- +Mon Feb 26 12:27:18 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 0.8.4: + * Provide `__version__` of the package so it can be easily + checked when installed on the system. + * Fix an issue of clashing with the _coverage_. + * Packaging has been modernized. + +------------------------------------------------------------------- Old: ---- requre-0.8.2.tar.gz New: ---- requre-0.8.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-requre.spec ++++++ --- /var/tmp/diff_new_pack.npRMqg/_old 2024-02-26 19:47:51.691267803 +0100 +++ /var/tmp/diff_new_pack.npRMqg/_new 2024-02-26 19:47:51.691267803 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-requre # -# Copyright (c) 2023 SUSE LLC +# 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 @@ -16,16 +16,16 @@ # +%{?sle15_python_module_pythons} Name: python-requre -Version: 0.8.2 +Version: 0.8.4 Release: 0 Summary: Python libray for storing and using objects for testing License: MIT URL: https://github.com/packit-service/requre Source: https://files.pythonhosted.org/packages/source/r/requre/requre-%{version}.tar.gz +BuildRequires: %{python_module hatch_vcs} BuildRequires: %{python_module pip} -BuildRequires: %{python_module setuptools_scm} -BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -35,7 +35,7 @@ Requires: python-requests Suggests: python-pytest Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module PyYAML} @@ -52,11 +52,6 @@ %prep %setup -q -n requre-%{version} -sed -i '1{/#!/d}' requre/requre_patch.py - -# https://github.com/packit/requre/issues/131 -sed -i 's/not network_connection_avalilable()/False/' tests/*.py - # Remove cyclic dependency with ogr rm tests/test_E2E_ogr.py ++++++ requre-0.8.2.tar.gz -> requre-0.8.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.git_archival.txt new/requre-0.8.4/.git_archival.txt --- old/requre-0.8.2/.git_archival.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/.git_archival.txt 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ +ref-names: $Format:%D$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.gitattributes new/requre-0.8.4/.gitattributes --- old/requre-0.8.2/.gitattributes 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/.gitattributes 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,2 @@ +# Needed for setuptools-scm +.git_archival.txt export-subst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.github/workflows/do-release.yml new/requre-0.8.4/.github/workflows/do-release.yml --- old/requre-0.8.2/.github/workflows/do-release.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/.github/workflows/do-release.yml 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,24 @@ +name: Create a GitHub release once a release PR is merged + +on: + workflow_dispatch: + pull_request: + types: + - closed + +jobs: + if_merged: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') && github.repository_owner == 'packit' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Create GitHub release + run: | + VERSION=$(grep -oP '^# \K[0-9.]*' CHANGELOG.md | head -n 1) + # Take the lines between the first two headers from CHANGELOG.md, + # and use it as a description for the new release. + CHANGELOG=$(awk 'BEGIN { first = 0 } /^# / { if (first == 0) { first = 1 } else { exit } } /^[^#]/ { print $0 }' CHANGELOG.md) + # Use the changelog re-calculated to create a new release + gh release create ${VERSION} --draft --title ${VERSION} -n "${CHANGELOG}" + env: + GH_TOKEN: ${{ secrets.RELEASEBOT_GITHUB_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.github/workflows/opened-issues-to-the-board.yml new/requre-0.8.4/.github/workflows/opened-issues-to-the-board.yml --- old/requre-0.8.2/.github/workflows/opened-issues-to-the-board.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/.github/workflows/opened-issues-to-the-board.yml 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,14 @@ +name: Move new issues into the Kanban board + +on: + issues: + types: [opened] + +jobs: + add-new-issue-to-the-kanban-board: + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.3.0 + with: + project-url: https://github.com/orgs/packit/projects/7 + github-token: ${{ secrets.RELEASEBOT_GITHUB_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.github/workflows/prepare-release.yml new/requre-0.8.4/.github/workflows/prepare-release.yml --- old/requre-0.8.2/.github/workflows/prepare-release.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/.github/workflows/prepare-release.yml 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,34 @@ +name: Prepare a new release +on: + workflow_dispatch: + inputs: + version: + required: true + description: Version number for the new release + +jobs: + prepare-release: + # To not run in forks + if: github.repository_owner == 'packit' + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Prepare release content + uses: packit/prepare-release@v0 + with: + version: ${{ inputs.version }} + specfiles: fedora/python-requre.spec + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + labels: release + commit-message: Release ${{ inputs.version }} + title: Release ${{ inputs.version }} + body: Update the changelog and the specfile for release ${{ inputs.version }}. + delete-branch: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.github/workflows/pypi-publish.yml new/requre-0.8.4/.github/workflows/pypi-publish.yml --- old/requre-0.8.2/.github/workflows/pypi-publish.yml 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/.github/workflows/pypi-publish.yml 2020-02-02 01:00:00.000000000 +0100 @@ -5,14 +5,14 @@ on: release: - types: [created] + types: [released] jobs: build-n-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 - name: Build a source tarball and a binary wheel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.packit.yaml new/requre-0.8.4/.packit.yaml --- old/requre-0.8.2/.packit.yaml 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/.packit.yaml 2020-02-02 01:00:00.000000000 +0100 @@ -1,4 +1,7 @@ --- +# We want to use both instances for all upstream jobs including the `propose-downstream` one. +# For downstream, we need to pick just one instance (`stg` in our case) +# and redefine it for the `koji_build` and `bodhi_update` jobs. packit_instances: ["prod", "stg"] specfile_path: fedora/python-requre.spec # https://packit.dev/docs/configuration/#top-level-keys @@ -17,61 +20,57 @@ # LookupError: setuptools-scm was unable to detect version for '/builddir/build/BUILD/requre-0.11.1'. # Make sure you're either building from a fully intact git repository or PyPI tarballs. create-archive: - - python3 setup.py sdist --dist-dir ./fedora/ + - python3 -m build --sdist --outdir ./fedora/ - bash -c "ls -1t ./fedora/*.tar.gz | head -n 1" - get-current-version: python3 setup.py --version + get-current-version: + - hatch version srpm_build_deps: - - python3-pip # "python3 setup.py --version" needs it - - python3-setuptools_scm + - python3-build + - hatch + - python3-hatch-vcs jobs: - job: sync_from_downstream trigger: commit - job: propose_downstream trigger: release - packit_instances: ["prod", "stg"] - metadata: - dist_git_branches: fedora-all + dist_git_branches: + - fedora-all - job: copr_build trigger: pull_request - metadata: - targets: - - fedora-all - - epel-8 + targets: + - fedora-all + - epel-9 - job: copr_build trigger: commit - metadata: - branch: main - project: packit-dev - targets: - - fedora-all - - epel-8 - list_on_homepage: True - preserve_project: True + branch: main + project: packit-dev + targets: + - fedora-all + - epel-9 + list_on_homepage: True + preserve_project: True - job: copr_build trigger: release - metadata: - project: packit-releases - targets: - - fedora-all - - epel-8 - list_on_homepage: True - preserve_project: True + project: packit-releases + targets: + - fedora-all + - epel-9 + list_on_homepage: True + preserve_project: True # downstream automation: - job: koji_build trigger: commit packit_instances: ["stg"] - metadata: - dist_git_branches: - - fedora-all - - epel-8 + dist_git_branches: + - fedora-all + - epel-9 - job: bodhi_update trigger: commit packit_instances: ["stg"] - metadata: - dist_git_branches: - - fedora-latest # branched version, rawhide updates are created automatically - - fedora-stable - - epel-8 + dist_git_branches: + - fedora-latest # branched version, rawhide updates are created automatically + - fedora-stable + - epel-9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/.pre-commit-config.yaml new/requre-0.8.4/.pre-commit-config.yaml --- old/requre-0.8.2/.pre-commit-config.yaml 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/.pre-commit-config.yaml 2020-02-02 01:00:00.000000000 +0100 @@ -4,20 +4,20 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v3.15.0 hooks: - id: pyupgrade - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.2 + rev: v3.1.0 hooks: - id: prettier exclude: tests/data/.+ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-ast @@ -27,21 +27,21 @@ - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 exclude: examples args: - --max-line-length=100 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v1.7.1 hooks: - id: mypy exclude: examples args: [--no-strict-optional, --ignore-missing-imports] additional_dependencies: [types-click, types-requests, types-PyYAML] - repo: https://github.com/packit/pre-commit-hooks - rev: 3bf9afc5ede12a4ee26e9451f306edf255749396 + rev: v1.2.0 hooks: - id: check-rebase args: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/CHANGELOG.md new/requre-0.8.4/CHANGELOG.md --- old/requre-0.8.2/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,49 @@ +# 0.8.4 + +- Provide `__version__` of the package so it can be easily checked when installed on the system. + +# 0.8.3 + +- Fix an issue of clashing with the _coverage_. +- Packaging has been modernized. + +# 0.8.2 + +- No user-facing changes. + +# 0.8.1 + +- Fix the problem with kwarg decorators that causes the function body not to be executed. + +# 0.8.0 + +- New decorators for handling temporary files (MkTemp) and directories (MkDTemp) in a more transparent way. +- The old implementation based on static paths and counter has been deprecated. + +# 0.7.1 + +- Fix a performance issue when detecting cassettes following the old naming format. + +# New release 0.7.0 + +- New version of requre 0.7.0 + +# New release 0.6.1 + +- python 'tuple' support as base type + +# new version 0.6.0 + +- release new version 0.6.0 + +# simplify user experience + +Features + +- default decorator if not given +- guess output decorator class +- class shortcut decorators + +# new version 0.4.0 + +- repair specfile to be same as possible as in ogr and packit.yaml fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/PKG-INFO new/requre-0.8.4/PKG-INFO --- old/requre-0.8.2/PKG-INFO 2022-04-13 09:25:24.389003000 +0200 +++ new/requre-0.8.4/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,13 +1,12 @@ Metadata-Version: 2.1 Name: requre -Version: 0.8.2 -Summary: Library for testing python code what allows store output of various objects and use stored data for testing -Home-page: https://github.com/packit-service/requre -Author: Red Hat -Author-email: pac...@redhat.com -License: MIT -Keywords: testing,persistent_storage,session_storage -Platform: UNKNOWN +Version: 0.8.4 +Summary: Library for testing Python code that allows to store output of various objects and use the stored data for testing. +Project-URL: Homepage, https://github.com/packit/requre +Author-email: Red Hat <pac...@redhat.com> +License-Expression: MIT +License-File: LICENSE +Keywords: persistent_storage,session_storage,testing Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Intended Audience :: Developers @@ -19,9 +18,14 @@ Classifier: Topic :: Software Development Classifier: Topic :: Utilities Requires-Python: >=3.6 -Description-Content-Type: text/markdown +Requires-Dist: click +Requires-Dist: gitpython +Requires-Dist: pytest +Requires-Dist: pyyaml +Requires-Dist: requests Provides-Extra: testing -License-File: LICENSE +Requires-Dist: pytest; extra == 'testing' +Description-Content-Type: text/markdown [](https://badge.fury.io/py/requre) @@ -69,5 +73,3 @@ ``` $ pip3 install --user git+https://github.com/packit/requre.git ``` - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/fedora/python-requre.spec new/requre-0.8.4/fedora/python-requre.spec --- old/requre-0.8.2/fedora/python-requre.spec 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/fedora/python-requre.spec 1970-01-01 01:00:00.000000000 +0100 @@ -1,88 +0,0 @@ -%global srcname requre - -Name: python-%{srcname} -Version: 0.8.2 -Release: 1%{?dist} -Summary: Python library what allows re/store output of various objects for testing - -License: MIT -URL: https://github.com/packit/requre -Source0: %{pypi_source} -BuildArch: noarch - -BuildRequires: python3-devel -BuildRequires: python3dist(click) -BuildRequires: python3dist(pytest) -BuildRequires: python3dist(pyyaml) -BuildRequires: python3dist(requests) -BuildRequires: python3dist(setuptools) -BuildRequires: python3dist(setuptools-scm) -BuildRequires: python3dist(setuptools-scm-git-archive) -BuildRequires: python3dist(sphinx) - -%description -REQUest REcordingRequre [rekure] - Is Library for storing output of various -function and methods to persistent storage and be able to replay the stored -output to functions. - -%package -n python3-%{srcname} -Summary: %{summary} - -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides -%if 0%{?fedora} < 33 -%{?python_provide:%python_provide python3-%{srcname}} -%endif - -%description -n python3-%{srcname} -REQUest REcordingRequre [rekure] - Is Library for storing output of various -function and methods to persistent storage and be able to replay the stored -output to functions. - -%prep -%autosetup -n %{srcname}-%{version} -# Remove bundled egg-info -rm -rf %{srcname}.egg-info - -%build -%py3_build - -%install -%py3_install - -%files -n python3-%{srcname} -%license LICENSE -%doc README.md -%{_bindir}/requre-patch -%{python3_sitelib}/%{srcname} -%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info - -%changelog -* Wed Apr 13 2022 Frantisek Lachman <flach...@redhat.com> - 0.8.2-1 -- New upstream release 0.8.2 - -* Fri Jun 18 2021 Frantisek Lachman <flach...@redhat.com> - 0.8.1-1 -- New upstream release 0.8.1 - -* Fri May 07 2021 Frantisek Lachman <flach...@redhat.com> - 0.8.0-1 -- New upstream release 0.8.0 - -* Fri Apr 30 2021 Hunor Csomortáni <cs...@redhat.com> - 0.7.1-1 -- New upstream release: 0.7.1 - -* Fri Mar 12 2021 Jan Å Äotka <jsco...@redhat.com> - 0.7.0-1 -- New version - -* Mon Mar 01 2021 Jan Å Äotka <jsco...@redhat.com> - 0.6.1-1 -- new version - -* Tue Feb 16 2021 Jan Å Äotka <jsco...@redhat.com> - 0.6.0-1 -- new version - -* Tue Jan 19 2021 Jiri Popelka <jpope...@redhat.com> - 0.5.0-1 -- 0.5.0 - -* Tue Sep 22 2020 Jan Å Äotka <jsco...@redhat.com> - 0.4.0-1 -- New upstream release 0.4.0 - -* Wed Jan 15 2020 Jan Å Äotka <jsco...@redhat.com> - 0.2.0-1 -- Initial package. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/files/tasks/rpm-test-deps.yaml new/requre-0.8.4/files/tasks/rpm-test-deps.yaml --- old/requre-0.8.2/files/tasks/rpm-test-deps.yaml 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/files/tasks/rpm-test-deps.yaml 2020-02-02 01:00:00.000000000 +0100 @@ -2,12 +2,11 @@ - name: Install test rpm dependencies dnf: name: - - python3.6 + - python3.9 - python3-pip - python3-setuptools - git-core - python3-setuptools_scm - - python3-setuptools_scm_git_archive - python3-wheel # for bdist_wheel - python3-pytest state: present diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/pyproject.toml new/requre-0.8.4/pyproject.toml --- old/requre-0.8.2/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/requre-0.8.4/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,59 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "requre" +authors = [ + { name = "Red Hat", email = "pac...@redhat.com" }, +] +description = "Library for testing Python code that allows to store output of various objects and use the stored data for testing." +readme = "README.md" +license = "MIT" +license-files = { paths = ["LICENSE"] } +requires-python = ">=3.6" +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Software Development", + "Topic :: Utilities", +] +dynamic = ["version"] +keywords = [ + "testing", + "persistent_storage", + "session_storage", +] +dependencies = [ + "click", + "GitPython", + "pytest", + "PyYAML", + "requests", +] + +[project.urls] +Homepage = "https://github.com/packit/requre" + +[project.optional-dependencies] +testing = ["pytest"] + +[project.scripts] +requre-patch = "requre.requre_patch:requre_base" + +[tool.hatch.version] +source = "vcs" +# we can't use pre-release-based version scheme because it generates versions +# that are sorted higher than the last stable release by RPM +# for example: +# - pre-release (guess-next-dev): +# 0.20.1.dev1+g0abcdef.d20230921 > 0.20.1 +# - post-release (no-guess-dev): +# 0.20.0.post1.dev1+g0abcdef < 0.20.1 +raw-options.version_scheme = "no-guess-dev" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre/__init__.py new/requre-0.8.4/requre/__init__.py --- old/requre-0.8.2/requre/__init__.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/requre/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,9 @@ # Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT +import contextlib +from importlib.metadata import PackageNotFoundError, distribution + from requre.base_testclass import RequreTestCase from requre.record_and_replace import record, replace from requre.cassette import Cassette @@ -9,6 +12,9 @@ from requre.helpers.files import StoreFiles from requre.import_system import UpgradeImportSystem +with contextlib.suppress(PackageNotFoundError): + __version__ = distribution(__name__).version + __all__ = [ record.__name__, replace.__name__, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre/cassette.py new/requre-0.8.4/requre/cassette.py --- old/requre-0.8.2/requre/cassette.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/requre/cassette.py 2020-02-02 01:00:00.000000000 +0100 @@ -767,7 +767,7 @@ :return: dict """ - with open(self.storage_file, "r") as yaml_file: + with open(self.storage_file) as yaml_file: output = yaml.safe_load(yaml_file) self.storage_object = output # set proper storage strategy if stored in file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre/helpers/files.py new/requre-0.8.4/requre/helpers/files.py --- old/requre-0.8.2/requre/helpers/files.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/requre/helpers/files.py 2020-02-02 01:00:00.000000000 +0100 @@ -90,7 +90,7 @@ tar_item.name = "." try: tar_store.extract(tar_item, path=pathname) - except IOError: + except OSError: # rewrite readonly files if necessary os.remove(os.path.join(pathname, tar_item.name)) tar_store.extract(tar_item, path=pathname) @@ -284,7 +284,6 @@ def internal(func): @functools.wraps(func) def store_files_int_int(*args, **kwargs): - output = None class_test_id_list = [ cls.__name__, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre/postprocessing.py new/requre-0.8.4/requre/postprocessing.py --- old/requre-0.8.2/requre/postprocessing.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/requre/postprocessing.py 2020-02-02 01:00:00.000000000 +0100 @@ -62,7 +62,6 @@ @staticmethod def minimal_match(dict_obj: Dict, metadata: Dict): - tmp_dict = dict_obj first_item: Dict = {} key_name = DataTypes.__name__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre/record_and_replace.py new/requre-0.8.4/requre/record_and_replace.py --- old/requre-0.8.2/requre/record_and_replace.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/requre/record_and_replace.py 2020-02-02 01:00:00.000000000 +0100 @@ -7,6 +7,7 @@ import os import re import sys +import types from contextlib import contextmanager from typing import Any, Callable, List, Optional, Tuple, Union @@ -193,6 +194,10 @@ module_list: List[ModuleRecord] = [] # go over all modules, and try to find match for module in sys.modules.copy().values(): + if not isinstance(module, types.ModuleType): + # ignore non-modules (for example coverage abuses sys.modules + # to store its DebugOutputFile object) + continue module_list += _apply_module_replacement( what=what, module=module, @@ -326,7 +331,6 @@ def make_generic_decorator_cover(decorator): def make_generic_decorator(*args, regexp_method_pattern=None, **kwargs): - is_direct_call = ( not kwargs and not regexp_method_pattern diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/PKG-INFO new/requre-0.8.4/requre.egg-info/PKG-INFO --- old/requre-0.8.2/requre.egg-info/PKG-INFO 2022-04-13 09:25:23.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,73 +0,0 @@ -Metadata-Version: 2.1 -Name: requre -Version: 0.8.2 -Summary: Library for testing python code what allows store output of various objects and use stored data for testing -Home-page: https://github.com/packit-service/requre -Author: Red Hat -Author-email: pac...@redhat.com -License: MIT -Keywords: testing,persistent_storage,session_storage -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Console -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: POSIX :: Linux -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Topic :: Software Development -Classifier: Topic :: Utilities -Requires-Python: >=3.6 -Description-Content-Type: text/markdown -Provides-Extra: testing -License-File: LICENSE - -[](https://badge.fury.io/py/requre) - -# REQUest REcording - -Requre \[rekure\] - -Is a library for storing output of various function and methods to -persistent storage and be able to replay the stored output to functions -back - -[Documentation](https://requre.readthedocs.io/en/latest/) - -## Plan and current status - -- Used for testing [packit-service](https://github.com/packit-service) organization projects - - ogr - - packit - -## Installation - -On Fedora: - -``` -$ dnf install python3-requre -``` - -Or from PyPI: - -``` -$ pip3 install --user requre -``` - -You can also install `requre` from `main` branch, if you are brave enough: - -You can use our [`packit/packit-dev` Copr repository](https://copr.fedorainfracloud.org/coprs/packit/packit-dev/): - -``` -$ dnf copr enable packit/packit-dev -$ dnf install python3-requre -``` - -Or - -``` -$ pip3 install --user git+https://github.com/packit/requre.git -``` - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/SOURCES.txt new/requre-0.8.4/requre.egg-info/SOURCES.txt --- old/requre-0.8.2/requre.egg-info/SOURCES.txt 2022-04-13 09:25:24.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,135 +0,0 @@ -.gitignore -.packit.yaml -.pre-commit-config.yaml -.pre-commit-hooks.yaml -.zuul.yaml -CONTRIBUTING.md -DCO -Dockerfile.tests -LICENSE -Makefile -README.md -ci.fmf -setup.cfg -setup.py -.github/PULL_REQUEST_TEMPLATE.md -.github/stale.yml -.github/workflows/pypi-publish.yml -docs/Makefile -docs/conf.py -docs/filter_format.rst -docs/index.rst -docs/installation.rst -docs/make.bat -docs/modules.rst -docs/usages/helpers.rst -docs/usages/import_system.rst -docs/usages/index.rst -docs/usages/postprocessing.rst -examples/basic_storage.py -examples/file_store.py -examples/generic_decorator.py -examples/request_example.py -fedora/python-requre.spec -files/zuul-reverse-dep-ogr.yaml -files/zuul-reverse-dep-packit.yaml -files/zuul-tests.yaml -files/tasks/generic-dnf-requirements.yaml -files/tasks/install-ansible.yaml -files/tasks/install-requre.yaml -files/tasks/ogr_reverse_dep_test.yaml -files/tasks/packit-deps.yaml -files/tasks/packit-tests.yaml -files/tasks/rpm-test-deps.yaml -files/tasks/zuul-project-setup.yaml -requre/__init__.py -requre/base_testclass.py -requre/cassette.py -requre/constants.py -requre/exceptions.py -requre/guess_object.py -requre/import_system.py -requre/modules_decorate_all_methods.py -requre/objects.py -requre/online_replacing.py -requre/postprocessing.py -requre/pytest_fixtures.py -requre/record_and_replace.py -requre/requre_patch.py -requre/simple_object.py -requre/singleton.py -requre/storage.py -requre/utils.py -requre.egg-info/PKG-INFO -requre.egg-info/SOURCES.txt -requre.egg-info/dependency_links.txt -requre.egg-info/entry_points.txt -requre.egg-info/requires.txt -requre.egg-info/top_level.txt -requre/helpers/__init__.py -requre/helpers/files.py -requre/helpers/function_output.py -requre/helpers/guess_object.py -requre/helpers/requests_response.py -requre/helpers/simple_object.py -requre/helpers/tempfile.py -requre/helpers/git/__init__.py -requre/helpers/git/fetchinfo.py -requre/helpers/git/helper.py -requre/helpers/git/pushinfo.py -requre/helpers/git/repo.py -tests/__init__.py -tests/conftest.py -tests/test_E2E_example.py -tests/test_E2E_ogr.py -tests/test_base_testclass.py -tests/test_builtins.py -tests/test_cassette.py -tests/test_context_manager.py -tests/test_duplication.py -tests/test_e2e_test_patching.py -tests/test_files.py -tests/test_function_output.py -tests/test_guess_objects.py -tests/test_import_system.py -tests/test_make_generic.py -tests/test_modules_decorate_all_methods.py -tests/test_object.py -tests/test_online_replacing.py -tests/test_pytest_fixtures.py -tests/test_pytest_fixtures_autouse.py -tests/test_record_requests_for_all_methods.py -tests/test_request_response.py -tests/test_storage.py -tests/test_storage_modes.py -tests/test_storage_postprocessing.py -tests/test_tempfile.py -tests/test_tuple.py -tests/testbase.py -tests/data/__init__.py -tests/data/e2e_latency_replacements.py -tests/data/e2e_latency_test.py -tests/data/e2e_test.py -tests/data/e2e_test_replacements.py -tests/data/e2e_test_replacements_special.py -tests/data/requre_postprocessing.yaml -tests/data/special_requre_module.py -tests/test_data/test_E2E_example/TestRead.test.yaml -tests/test_data/test_builtins/Test.test.yaml -tests/test_data/test_duplication/Duplicated.test.yaml -tests/test_data/test_modules_decorate_all_methods/ApplyCommonCase.test_git.yaml -tests/test_data/test_modules_decorate_all_methods/ApplyCommonCase.test_git.yaml.tmpv1xm25f2_1.tar.xz -tests/test_data/test_online_replacing/RecordDecoratorForClass.test_random.yaml -tests/test_data/test_online_replacing/RecordDecoratorForClassCassette.test_random.yaml -tests/test_data/test_online_replacing/RecordDecoratorForClassMultiple.test_random.yaml -tests/test_data/test_online_replacing/RecordDecoratorForMethod.test_random.yaml -tests/test_data/test_online_replacing/RecordDecoratorForMethodMultiple.test_random.yaml -tests/test_data/test_online_replacing/decorated_exact.yaml -tests/test_data/test_pytest_fixtures/test_record_requests_fixture.yaml -tests/test_data/test_pytest_fixtures/test_record_requests_fixture_different_call.yaml -tests/test_data/test_pytest_fixtures/test_record_requests_fixture_different_call_write.yaml -tests/test_data/test_pytest_fixtures/test_record_requests_fixture_write.yaml -tests/test_data/test_pytest_fixtures_autouse/test_record_requests_fixture.yaml -tests/test_data/test_pytest_fixtures_autouse/test_record_requests_fixture_different_call.yaml -tests/test_data/test_tempfile/new_tempdir.yaml -tests/test_data/test_tempfile/new_tempfile.yaml \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/dependency_links.txt new/requre-0.8.4/requre.egg-info/dependency_links.txt --- old/requre-0.8.2/requre.egg-info/dependency_links.txt 2022-04-13 09:25:23.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/entry_points.txt new/requre-0.8.4/requre.egg-info/entry_points.txt --- old/requre-0.8.2/requre.egg-info/entry_points.txt 2022-04-13 09:25:23.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/entry_points.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -[console_scripts] -requre-patch = requre.requre_patch:requre_base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/requires.txt new/requre-0.8.4/requre.egg-info/requires.txt --- old/requre-0.8.2/requre.egg-info/requires.txt 2022-04-13 09:25:24.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -click -GitPython -pytest -PyYAML -requests - -[testing] -pytest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/requre.egg-info/top_level.txt new/requre-0.8.4/requre.egg-info/top_level.txt --- old/requre-0.8.2/requre.egg-info/top_level.txt 2022-04-13 09:25:24.000000000 +0200 +++ new/requre-0.8.4/requre.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -requre diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/setup.cfg new/requre-0.8.4/setup.cfg --- old/requre-0.8.2/setup.cfg 2022-04-13 09:25:24.389003000 +0200 +++ new/requre-0.8.4/setup.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,56 +0,0 @@ -[metadata] -name = requre -url = https://github.com/packit-service/requre -description = Library for testing python code what allows store output of various objects and use stored data for testing -long_description = file: README.md -long_description_content_type = text/markdown -author = Red Hat -author_email = pac...@redhat.com -license = MIT -license_file = LICENSE -classifiers = - Development Status :: 4 - Beta - Environment :: Console - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Topic :: Software Development - Topic :: Utilities -keywords = - testing - persistent_storage - session_storage - -[options] -packages = find: -python_requires = >=3.6 -include_package_data = True -setup_requires = - setuptools_scm - setuptools_scm_git_archive -install_requires = - click - GitPython - pytest - PyYAML - requests - -[options.packages.find] -exclude = - tests* - -[options.extras_require] -testing = - pytest - -[options.entry_points] -console_scripts = - requre-patch = requre.requre_patch:requre_base - -[egg_info] -tag_build = -tag_date = 0 - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/setup.py new/requre-0.8.4/setup.py --- old/requre-0.8.2/setup.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -#!/usr/bin/python3 - -# Copyright Contributors to the Packit project. -# SPDX-License-Identifier: MIT - -from setuptools import setup - -setup(use_scm_version=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/tests/conftest.py new/requre-0.8.4/tests/conftest.py --- old/requre-0.8.2/tests/conftest.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/tests/conftest.py 2020-02-02 01:00:00.000000000 +0100 @@ -22,3 +22,10 @@ # PersistentObjectStorage().cassette.dump() if storage_file.is_file(): storage_file.unlink() + + +def pytest_collection_modifyitems(items): + # make sure Duplicated::test test is executed last + items[:] = sorted( + items, key=lambda i: i.cls is not None and i.cls.__name__ == "Duplicated" + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/tests/test_E2E_ogr.py new/requre-0.8.4/tests/test_E2E_ogr.py --- old/requre-0.8.2/tests/test_E2E_ogr.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/tests/test_E2E_ogr.py 2020-02-02 01:00:00.000000000 +0100 @@ -19,7 +19,7 @@ token = os.environ.get("GITHUB_TOKEN") cassette = Cassette() if cassette.mode == StorageMode.write and (not token): - raise EnvironmentError( + raise OSError( f"You are in Requre write mode, please set proper GITHUB_TOKEN" f" env variables {cassette.storage_file}" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/tests/test_files.py new/requre-0.8.4/tests/test_files.py --- old/requre-0.8.2/tests/test_files.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/tests/test_files.py 2020-02-02 01:00:00.000000000 +0100 @@ -65,12 +65,12 @@ PersistentObjectStorage().cassette.mode = StorageMode.read self.create_file_content("first", target_file=self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) self.create_file_content("second", target_file=self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertNotIn("ahoj", content) self.assertIn("cao", content) @@ -92,7 +92,7 @@ self.create_temp_file() self.create_file_content("first", self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) @@ -100,7 +100,7 @@ self.create_temp_file() self.create_file_content("second", target_file=self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertNotIn("ahoj", content) self.assertIn("cao", content) @@ -118,7 +118,7 @@ filename="ahoj", target_dir=self.temp_dir, content="ciao" ) self.assertIn("ahoj", os.listdir(self.temp_dir)) - with open(os.path.join(self.temp_dir, "ahoj"), "r") as fd: + with open(os.path.join(self.temp_dir, "ahoj")) as fd: content = fd.read() self.assertIn("ciao", content) @@ -131,7 +131,7 @@ ) self.assertIn("ahoj", os.listdir(self.temp_dir)) self.assertNotIn("nonsense", os.listdir(self.temp_dir)) - with open(os.path.join(self.temp_dir, "ahoj"), "r") as fd: + with open(os.path.join(self.temp_dir, "ahoj")) as fd: content = fd.read() self.assertIn("ciao", content) self.assertNotIn("bad", content) @@ -155,7 +155,7 @@ ) self.assertIn(filename, os.listdir(self.temp_dir)) self.assertNotIn("nonsense", os.listdir(self.temp_dir)) - with open(os.path.join(self.temp_dir, filename), "r") as fd: + with open(os.path.join(self.temp_dir, filename)) as fd: content = fd.read() self.assertIn("hidden", content) self.assertNotIn("bad", content) @@ -186,12 +186,12 @@ before = str(PersistentObjectStorage().cassette.storage_object) self.create_file_content("ahoj", target_file=self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) self.create_file_content("cao", target_file=self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertNotIn("ahoj", content) self.assertIn("cao", content) @@ -218,7 +218,7 @@ PersistentObjectStorage().cassette.mode = StorageMode.read self.create_temp_file() self.write_to_file("ahoj", self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) @@ -226,7 +226,7 @@ self.create_temp_file() self.write_to_file("cao", self.temp_file) - with open(self.temp_file, "r") as fd: + with open(self.temp_file) as fd: content = fd.read() self.assertNotIn("ahoj", content) self.assertIn("cao", content) @@ -254,18 +254,18 @@ PersistentObjectStorage().cassette.dump() PersistentObjectStorage().cassette.mode = StorageMode.read oofile1 = self.create_file("first") - with open(ofile1, "r") as fd: + with open(ofile1) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) - with open(oofile1, "r") as fd: + with open(oofile1) as fd: content = fd.read() self.assertIn("ahoj", content) self.assertNotIn("cao", content) # mix with positional option oofile2 = self.create_file("second") - with open(oofile2, "r") as fd: + with open(oofile2) as fd: content = fd.read() self.assertNotIn("ahoj", content) self.assertIn("cao", content) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/tests/test_online_replacing.py new/requre-0.8.4/tests/test_online_replacing.py --- old/requre-0.8.2/tests/test_online_replacing.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/tests/test_online_replacing.py 2020-02-02 01:00:00.000000000 +0100 @@ -24,7 +24,7 @@ def guard(*args, **kwargs): - raise IOError("No Internet connection") + raise OSError("No Internet connection") original_socket = socket.socket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requre-0.8.2/tests/test_storage_postprocessing.py new/requre-0.8.4/tests/test_storage_postprocessing.py --- old/requre-0.8.2/tests/test_storage_postprocessing.py 2022-04-13 09:25:04.000000000 +0200 +++ new/requre-0.8.4/tests/test_storage_postprocessing.py 2020-02-02 01:00:00.000000000 +0100 @@ -78,7 +78,7 @@ "test_fedpkg_clone.yaml:output:str:random_output" ) run_command(f"{CMD_TOOL} --replaces {replacement} {self.storage_file_tmp}") - with open(self.storage_file_tmp, mode="r") as opened_file: + with open(self.storage_file_tmp) as opened_file: output = opened_file.read() self.assertIn("random_output", output) self.assertIn("requre.openshift_integration", output) @@ -88,7 +88,7 @@ def testLatency(self): replacement = "clone%store_function_output:latency:int:50" run_command(f"{CMD_TOOL} --replaces {replacement} {self.storage_file_tmp}") - with open(self.storage_file_tmp, mode="r") as opened_file: + with open(self.storage_file_tmp) as opened_file: output = opened_file.read() self.assertNotIn("random_output", output) self.assertIn("requre.openshift_integration", output) @@ -103,7 +103,7 @@ f"{CMD_TOOL} --replaces {replacement} {self.storage_file_tmp}", output=True ) print(output) - with open(self.storage_file_tmp, mode="r") as opened_file: + with open(self.storage_file_tmp) as opened_file: output = opened_file.read() self.assertNotIn("random_output", output) self.assertIn("requre.openshift_integration", output)