Hello community, here is the log from the commit of package spec-cleaner for openSUSE:Factory checked in at 2020-06-16 13:46:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/spec-cleaner (Old) and /work/SRC/openSUSE:Factory/.spec-cleaner.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "spec-cleaner" Tue Jun 16 13:46:42 2020 rev:64 rq:814878 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/spec-cleaner/spec-cleaner.changes 2020-03-26 23:34:46.810807668 +0100 +++ /work/SRC/openSUSE:Factory/.spec-cleaner.new.3606/spec-cleaner.changes 2020-06-16 13:47:24.902461663 +0200 @@ -1,0 +2,7 @@ +Tue Jun 16 10:46:32 UTC 2020 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.2.0 bsc#1099674: + * Fix pypi rewritter to work with wheels + * Do not choke on multiline string macros + +------------------------------------------------------------------- Old: ---- spec-cleaner-1.1.9.tar.gz New: ---- spec-cleaner-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spec-cleaner.spec ++++++ --- /var/tmp/diff_new_pack.zroV2J/_old 2020-06-16 13:47:25.650464186 +0200 +++ /var/tmp/diff_new_pack.zroV2J/_new 2020-06-16 13:47:25.654464199 +0200 @@ -18,16 +18,16 @@ Name: spec-cleaner -Version: 1.1.9 +Version: 1.2.0 Release: 0 Summary: .spec file cleaner License: BSD-3-Clause -Group: Development/Tools/Other URL: https://github.com/openSUSE/spec-cleaner Source0: https://github.com/openSUSE/%{name}/archive/%{name}-%{version}.tar.gz +BuildRequires: python-rpm-macros BuildRequires: python3-pytest BuildRequires: python3-pytest-cov -BuildRequires: python3-pytest-runner +BuildRequires: python3-pytest-isort BuildRequires: python3-pytest-xdist BuildRequires: python3-setuptools # For the pkg_resources used in the binary loader @@ -41,7 +41,6 @@ %package format_spec_file Summary: Binding replacing OBS service format_spec_file -Group: Development/Tools/Other Requires: %{name} = %{version} Conflicts: obs-service-format_spec_file @@ -53,14 +52,14 @@ %setup -q -n %{name}-%{name}-%{version} %build -python3 setup.py build +%python3_build %check export LANG=en_US.UTF-8 python3 -m pytest -k "not webtest" %install -python3 setup.py install --root=%{buildroot} +%python3_install %files %license COPYING ++++++ spec-cleaner-1.1.9.tar.gz -> spec-cleaner-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/.github/workflows/pythonpackage.yml new/spec-cleaner-spec-cleaner-1.2.0/.github/workflows/pythonpackage.yml --- old/spec-cleaner-spec-cleaner-1.1.9/.github/workflows/pythonpackage.yml 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/.github/workflows/pythonpackage.yml 2020-06-16 12:39:03.000000000 +0200 @@ -36,7 +36,7 @@ mypy spec_cleaner - name: Collect the coveralls report env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | coveralls if: success() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/.isort.cfg new/spec-cleaner-spec-cleaner-1.2.0/.isort.cfg --- old/spec-cleaner-spec-cleaner-1.1.9/.isort.cfg 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/.isort.cfg 2020-06-16 12:39:03.000000000 +0200 @@ -0,0 +1,5 @@ +[settings] +# This setting is needed for isort to be compatible with black +line_length = 100 +multi_line_output = 3 +include_trailing_comma = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/.pre-commit-config.yaml new/spec-cleaner-spec-cleaner-1.2.0/.pre-commit-config.yaml --- old/spec-cleaner-spec-cleaner-1.1.9/.pre-commit-config.yaml 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/.pre-commit-config.yaml 2020-06-16 12:39:03.000000000 +0200 @@ -1,4 +1,11 @@ repos: +- repo: https://github.com/timothycrosley/isort + rev: '4.3.21' + hooks: + - id: isort + # pytest is needed for correct sorting of pytest imports + additional_dependencies: [pytest] + - repo: https://github.com/psf/black rev: 19.10b0 hooks: @@ -13,6 +20,6 @@ args: [--max-line-length=100] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.761' + rev: v0.770 hooks: - - id: mypy + - id: mypy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/README.md new/spec-cleaner-spec-cleaner-1.2.0/README.md --- old/spec-cleaner-spec-cleaner-1.1.9/README.md 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/README.md 2020-06-16 12:39:03.000000000 +0200 @@ -37,7 +37,7 @@ spec-cleaner provides quite an extensive testsuite. You can run these tests locally either directly via `pytest`. #### pytest -Just install `python3-pytest`, `python3-pytest-cov` and `python3-pytest-sugar` (for a nice progress bar) and then run all tests via: +Just install `python3-pytest`, `python3-pytest-cov`, `python3-pytest-isort` and `python3-pytest-sugar` (for a nice progress bar) and then run all tests via: pytest @@ -59,7 +59,7 @@ ### pre-commit -spec-cleaner project adopted `pre-commit` framework for managing and maintaining pre-commit hooks. After you clone the spec-cleaner repository, please install [pre-commit](https://pre-commit.com/) framework (`pip install pre-commit`) and run `pre-commit install` to install `pre-commit` into your git hooks. Then `pre-commit` will run automatically on `git commit` and it will check your contribution with `black`, `flake8`, `flake8-docstrings` and `mypy`. +spec-cleaner project adopted `pre-commit` framework for managing and maintaining pre-commit hooks. After you clone the spec-cleaner repository, please install [pre-commit](https://pre-commit.com/) framework (`pip install pre-commit`) and run `pre-commit install` to install `pre-commit` into your git hooks. Then `pre-commit` will run automatically on `git commit` and it will check your contribution with `isort`, `black`, `flake8`, `flake8-docstrings` and `mypy`. Please note that similar checks run in CI when you submit a PR and it won't pass code review without passing these checks. @@ -136,7 +136,6 @@ BSD-1-Clause | BSD 1-Clause License BSD-2-Clause | BSD 2-Clause "Simplified" License BSD-2-Clause-FreeBSD | BSD 2-Clause FreeBSD License -BSD-2-Clause-NetBSD | BSD 2-Clause NetBSD License BSD-2-Clause-Patent | BSD-2-Clause Plus Patent License BSD-3-Clause | BSD 3-Clause "New" or "Revised" License BSD-3-Clause-Attribution | BSD with attribution @@ -153,6 +152,8 @@ BSL-1.0 | Boost Software License 1.0 bzip2-1.0.5 | bzip2 and libbzip2 License v1.0.5 bzip2-1.0.6 | bzip2 and libbzip2 License v1.0.6 +CAL-1.0 | Cryptographic Autonomy License 1.0 +CAL-1.0-Combined-Work-Exception | Cryptographic Autonomy License 1.0 (Combined Work Exception) Caldera | Caldera License CATOSL-1.1 | Computer Associates Trusted Open Source License 1.1 CC-BY-1.0 | Creative Commons Attribution 1.0 Generic @@ -199,6 +200,9 @@ CECILL-C | CeCILL-C Free Software License Agreement CERN-OHL-1.1 | CERN Open Hardware Licence v1.1 CERN-OHL-1.2 | CERN Open Hardware Licence v1.2 +CERN-OHL-P-2.0 | CERN Open Hardware Licence Version 2 - Permissive +CERN-OHL-S-2.0 | CERN Open Hardware Licence Version 2 - Strongly Reciprocal +CERN-OHL-W-2.0 | CERN Open Hardware Licence Version 2 - Weakly Reciprocal ClArtistic | Clarified Artistic License CNRI-Jython | CNRI Jython License CNRI-Python | CNRI Python License @@ -261,6 +265,7 @@ GPL-3.0-or-later | GNU General Public License v3.0 or later gSOAP-1.3b | gSOAP Public License v1.3b HaskellReport | Haskell Language Report License +Hippocratic-2.1 | Hippocratic License 2.1 HPND | Historical Permission Notice and Disclaimer HPND-sell-variant | Historical Permission Notice and Disclaimer - sell variant IBM-pibs | IBM PowerPC Initialization and Boot Software @@ -324,11 +329,13 @@ MS-RL | Microsoft Reciprocal License MTLL | Matrix Template Library License MulanPSL-1.0 | Mulan Permissive Software License, Version 1 +MulanPSL-2.0 | Mulan Permissive Software License, Version 2 Multics | Multics License Mup | Mup License NASA-1.3 | NASA Open Source Agreement 1.3 Naumen | Naumen Public License NBPL-1.0 | Net Boolean Public License v1 +NCGL-UK-2.0 | Non-Commercial Government Licence NCSA | University of Illinois/NCSA Open Source License Net-SNMP | Net-SNMP License NetCDF | NetCDF license @@ -345,6 +352,7 @@ NRL | NRL License NTP | NTP License NTP-0 | NTP No Attribution +O-UDA-1.0 | Open Use of Data Agreement v1.0 OCCT-PL | Open CASCADE Technology Public License OCLC-2.0 | OCLC Research Public License 2.0 ODbL-1.0 | ODC Open Database License v1.0 @@ -355,6 +363,7 @@ OFL-1.1 | SIL Open Font License 1.1 OFL-1.1-no-RFN | SIL Open Font License 1.1 with no Reserved Font Name OFL-1.1-RFN | SIL Open Font License 1.1 with Reserved Font Name +OGC-1.0 | OGC Software License, Version 1.0 OGL-Canada-2.0 | Open Government Licence - Canada OGL-UK-1.0 | Open Government Licence v1.0 OGL-UK-2.0 | Open Government Licence v2.0 @@ -386,10 +395,13 @@ OSL-2.1 | Open Software License 2.1 OSL-3.0 | Open Software License 3.0 Parity-6.0.0 | The Parity Public License 6.0.0 +Parity-7.0.0 | The Parity Public License 7.0.0 PDDL-1.0 | ODC Public Domain Dedication & License 1.0 PHP-3.0 | PHP License v3.0 PHP-3.01 | PHP License v3.01 Plexus | Plexus Classworlds License +PolyForm-Noncommercial-1.0.0 | PolyForm Noncommercial License 1.0.0 +PolyForm-Small-Business-1.0.0 | PolyForm Small Business License 1.0.0 PostgreSQL | PostgreSQL License PSF-2.0 | Python Software Foundation License 2.0 psfrag | psfrag License @@ -493,6 +505,7 @@ GPL-3.0-linking-exception GPL-3.0-linking-source-exception GPL-CC-1.0 +LGPL-3.0-linking-exception LLVM-exception LZMA-exception Libtool-exception @@ -504,6 +517,8 @@ Qt-GPL-exception-1.0 Qt-LGPL-exception-1.1 Qwt-exception-1.0 +SHL-2.0 +SHL-2.1 Swift-exception Universal-FOSS-exception-1.0 WxWindows-exception-3.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/README.md.in new/spec-cleaner-spec-cleaner-1.2.0/README.md.in --- old/spec-cleaner-spec-cleaner-1.1.9/README.md.in 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/README.md.in 2020-06-16 12:39:03.000000000 +0200 @@ -37,7 +37,7 @@ spec-cleaner provides quite an extensive testsuite. You can run these tests locally either directly via `pytest`. #### pytest -Just install `python3-pytest`, `python3-pytest-cov` and `python3-pytest-sugar` (for a nice progress bar) and then run all tests via: +Just install `python3-pytest`, `python3-pytest-cov`, `python3-pytest-isort` and `python3-pytest-sugar` (for a nice progress bar) and then run all tests via: pytest @@ -59,7 +59,7 @@ ### pre-commit -spec-cleaner project adopted `pre-commit` framework for managing and maintaining pre-commit hooks. After you clone the spec-cleaner repository, please install [pre-commit](https://pre-commit.com/) framework (`pip install pre-commit`) and run `pre-commit install` to install `pre-commit` into your git hooks. Then `pre-commit` will run automatically on `git commit` and it will check your contribution with `black`, `flake8`, `flake8-docstrings` and `mypy`. +spec-cleaner project adopted `pre-commit` framework for managing and maintaining pre-commit hooks. After you clone the spec-cleaner repository, please install [pre-commit](https://pre-commit.com/) framework (`pip install pre-commit`) and run `pre-commit install` to install `pre-commit` into your git hooks. Then `pre-commit` will run automatically on `git commit` and it will check your contribution with `isort`, `black`, `flake8`, `flake8-docstrings` and `mypy`. Please note that similar checks run in CI when you submit a PR and it won't pass code review without passing these checks. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/data/licenses_changes.txt new/spec-cleaner-spec-cleaner-1.2.0/data/licenses_changes.txt --- old/spec-cleaner-spec-cleaner-1.1.9/data/licenses_changes.txt 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/data/licenses_changes.txt 2020-06-16 12:39:03.000000000 +0200 @@ -117,8 +117,6 @@ BSD-2-Clause+ BSD-2-Clause+ BSD-2-Clause-FreeBSD BSD-2-Clause-FreeBSD BSD-2-Clause-FreeBSD+ BSD-2-Clause-FreeBSD+ -BSD-2-Clause-NetBSD BSD-2-Clause-NetBSD -BSD-2-Clause-NetBSD+ BSD-2-Clause-NetBSD+ BSD-2-Clause-Patent BSD-2-Clause-Patent BSD-2-Clause-Patent https://opensource.org/licenses/BSDplusPatent BSD-2-Clause-Patent+ BSD-2-Clause-Patent+ @@ -175,6 +173,10 @@ BlueOak-1.0.0+ BlueOak-1.0.0+ Borceux Borceux Borceux+ Borceux+ +CAL-1.0 CAL-1.0 +CAL-1.0+ CAL-1.0+ +CAL-1.0-Combined-Work-Exception CAL-1.0-Combined-Work-Exception +CAL-1.0-Combined-Work-Exception+ CAL-1.0-Combined-Work-Exception+ CATOSL-1.1 CATOSL-1.1 CATOSL-1.1+ CATOSL-1.1+ CC-BY-1.0 CC-BY-1.0 @@ -272,6 +274,12 @@ CERN-OHL-1.1+ CERN-OHL-1.1+ CERN-OHL-1.2 CERN-OHL-1.2 CERN-OHL-1.2+ CERN-OHL-1.2+ +CERN-OHL-P-2.0 CERN-OHL-P-2.0 +CERN-OHL-P-2.0+ CERN-OHL-P-2.0+ +CERN-OHL-S-2.0 CERN-OHL-S-2.0 +CERN-OHL-S-2.0+ CERN-OHL-S-2.0+ +CERN-OHL-W-2.0 CERN-OHL-W-2.0 +CERN-OHL-W-2.0+ CERN-OHL-W-2.0+ CNRI-Jython CNRI-Jython CNRI-Jython+ CNRI-Jython+ CNRI-Python CNRI-Python @@ -469,6 +477,8 @@ HPND-sell-variant+ HPND-sell-variant+ HaskellReport HaskellReport HaskellReport+ HaskellReport+ +Hippocratic-2.1 Hippocratic-2.1 +Hippocratic-2.1+ Hippocratic-2.1+ IBM-pibs IBM-pibs IBM-pibs+ IBM-pibs+ ICU ICU @@ -647,6 +657,8 @@ Motosoto+ Motosoto+ MulanPSL-1.0 MulanPSL-1.0 MulanPSL-1.0+ MulanPSL-1.0+ +MulanPSL-2.0 MulanPSL-2.0 +MulanPSL-2.0+ MulanPSL-2.0+ Multics Multics Multics+ Multics+ Mup Mup @@ -655,6 +667,8 @@ NASA-1.3+ NASA-1.3+ NBPL-1.0 NBPL-1.0 NBPL-1.0+ NBPL-1.0+ +NCGL-UK-2.0 NCGL-UK-2.0 +NCGL-UK-2.0+ NCGL-UK-2.0+ NCSA NCSA NCSA+ NCSA+ NGPL NGPL @@ -692,6 +706,8 @@ NonFree SUSE-NonFree Noweb Noweb Noweb+ Noweb+ +O-UDA-1.0 O-UDA-1.0 +O-UDA-1.0+ O-UDA-1.0+ OCCT-PL OCCT-PL OCCT-PL+ OCCT-PL+ OCLC-2.0 OCLC-2.0 @@ -716,6 +732,8 @@ OFL-1.1-RFN+ OFL-1.1-RFN+ OFL-1.1-no-RFN OFL-1.1-no-RFN OFL-1.1-no-RFN+ OFL-1.1-no-RFN+ +OGC-1.0 OGC-1.0 +OGC-1.0+ OGC-1.0+ OGL-Canada-2.0 OGL-Canada-2.0 OGL-Canada-2.0+ OGL-Canada-2.0+ OGL-UK-1.0 OGL-UK-1.0 @@ -793,8 +811,14 @@ PSF-2.0+ PSF-2.0+ Parity-6.0.0 Parity-6.0.0 Parity-6.0.0+ Parity-6.0.0+ +Parity-7.0.0 Parity-7.0.0 +Parity-7.0.0+ Parity-7.0.0+ Plexus Plexus Plexus+ Plexus+ +PolyForm-Noncommercial-1.0.0 PolyForm-Noncommercial-1.0.0 +PolyForm-Noncommercial-1.0.0+ PolyForm-Noncommercial-1.0.0+ +PolyForm-Small-Business-1.0.0 PolyForm-Small-Business-1.0.0 +PolyForm-Small-Business-1.0.0+ PolyForm-Small-Business-1.0.0+ PostgreSQL PostgreSQL PostgreSQL+ PostgreSQL+ Python-2.0 PSF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/data/licenses_exceptions.txt new/spec-cleaner-spec-cleaner-1.2.0/data/licenses_exceptions.txt --- old/spec-cleaner-spec-cleaner-1.1.9/data/licenses_exceptions.txt 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/data/licenses_exceptions.txt 2020-06-16 12:39:03.000000000 +0200 @@ -14,6 +14,7 @@ GPL-3.0-linking-exception GPL-3.0-linking-source-exception GPL-CC-1.0 +LGPL-3.0-linking-exception LLVM-exception LZMA-exception Libtool-exception @@ -25,6 +26,8 @@ Qt-GPL-exception-1.0 Qt-LGPL-exception-1.1 Qwt-exception-1.0 +SHL-2.0 +SHL-2.1 Swift-exception Universal-FOSS-exception-1.0 WxWindows-exception-3.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/devel-requirements.pip new/spec-cleaner-spec-cleaner-1.2.0/devel-requirements.pip --- old/spec-cleaner-spec-cleaner-1.1.9/devel-requirements.pip 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/devel-requirements.pip 2020-06-16 12:39:03.000000000 +0200 @@ -1,16 +1,16 @@ # Pip Requirement file for development -# pin as 1.11.x breaks up with the github action -coveralls == 1.9.1 +coveralls flake8 flake8-bugbear flake8-builtins flake8-comprehensions -flake8-import-order +flake8-isort flake8-quotes mypy pep8-naming pre-commit pytest pytest-cov +pytest-isort pytest-xdist diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/pytest.ini new/spec-cleaner-spec-cleaner-1.2.0/pytest.ini --- old/spec-cleaner-spec-cleaner-1.1.9/pytest.ini 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/pytest.ini 2020-06-16 12:39:03.000000000 +0200 @@ -1,5 +1,5 @@ [pytest] -addopts = -vv --cov=spec_cleaner -n auto +addopts = -vv --cov=spec_cleaner -n auto --isort python_files = *-tests.py testpaths = tests markers = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/setup.py new/spec-cleaner-spec-cleaner-1.2.0/setup.py --- old/spec-cleaner-spec-cleaner-1.1.9/setup.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/setup.py 2020-06-16 12:39:03.000000000 +0200 @@ -2,6 +2,7 @@ from glob import glob from setuptools import setup + from spec_cleaner import __version__ setup( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/__init__.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/__init__.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/__init__.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/__init__.py 2020-06-16 12:39:03.000000000 +0200 @@ -5,16 +5,15 @@ # See COPYING for details. import argparse -from datetime import datetime import os import sys +from datetime import datetime from typing import Any, Dict, List from .rpmcleaner import RpmSpecCleaner from .rpmexception import RpmException, RpmWrongArgs - -__version__ = '1.1.9' +__version__ = '1.2.0' def process_args(argv: List[str]) -> Dict[str, Any]: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/__main__.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/__main__.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/__main__.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/__main__.py 2020-06-16 12:39:03.000000000 +0200 @@ -1,10 +1,11 @@ import os import sys +from spec_cleaner import main + path = os.path.dirname(os.path.dirname(__file__)) sys.path.insert(0, path) -from spec_cleaner import main if __name__ == '__main__': sys.exit(main()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/fileutils.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/fileutils.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/fileutils.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/fileutils.py 2020-06-16 12:39:03.000000000 +0200 @@ -1,9 +1,9 @@ # vim: set ts=4 sw=4 et: coding=UTF-8 -from io import StringIO import os import sys import sysconfig +from io import StringIO from typing import IO from .rpmexception import RpmException diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmcleaner.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmcleaner.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmcleaner.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmcleaner.py 2020-06-16 12:39:03.000000000 +0200 @@ -5,7 +5,7 @@ import subprocess import sys import tempfile -from typing import Any, Dict, IO, List, Optional, Type +from typing import IO, Any, Dict, List, Optional, Type from .fileutils import open_stringio_spec from .rpmbuild import RpmBuild diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmhelpers.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmhelpers.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmhelpers.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmhelpers.py 2020-06-16 12:39:03.000000000 +0200 @@ -60,7 +60,7 @@ re_spec_macrofunc = re.compile(r'^\s*%define\s(\w+)\(.*') with open_stringio_spec(spec) as f: - for line in (l.rstrip('\n') for l in f): + for line in (i.rstrip('\n') for i in f): found_macro = re_spec_macrofunc.sub(r'\1', line) if found_macro != line: macrofuncs += [found_macro] @@ -68,24 +68,37 @@ def read_conversion_changes(conversion_file): + """ + Read up the conversion file for the replacements. + + Args: + conversion_file: File to load up the data + + Returns: + A dictionary with old -> new values for conversion + """ with open_datafile(conversion_file) as f: # the values are split by ': ' return {key: value for key, value in (line.split(': ') for line in f)} def read_tex_changes(): + """Read up the tex conversion types.""" return read_conversion_changes(TEX_CONVERSIONS) def read_pkgconfig_changes(): + """Read up the pkgconfig conversion types.""" return read_conversion_changes(PKGCONFIG_CONVERSIONS) def read_perl_changes(): + """Read up the perl conversion types.""" return read_conversion_changes(PERL_CONVERSIONS) def read_cmake_changes(): + """Read up the cmake conversion types.""" return read_conversion_changes(CMAKE_CONVERSIONS) @@ -109,12 +122,28 @@ def read_group_changes(): + """ + Read data for allowed groups. + + Returns: + A list with allowed groups + """ with open_datafile(GROUPS_LIST) as f: next(f) # header starts with link where we find the groups return [line.rstrip('\n') for line in f] def fix_license(value, conversions): + """ + Fix license string to match up current SPDX format. + + Args: + value: the current license string + conversions: list of known license format replacements + + Returns: + string with the new license + """ # license ; should be replaced by ands so find it re_license_semicolon = re.compile(r'\s*;\s*') value = value.rstrip(';') @@ -148,6 +177,16 @@ def sort_uniq(seq): + """ + Sort sequence. + + Args: + seq: the sequence of the data + + Returns: + sequence with sorted order and no duplicates + """ + def _check_list(x): if isinstance(x, list): return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmpreamble.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmpreamble.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmpreamble.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmpreamble.py 2020-06-16 12:39:03.000000000 +0200 @@ -38,11 +38,14 @@ """ def __init__(self, options): + """Initialize all the global variables and known categories.""" Section.__init__(self, options) # Old storage self._oldstore = [] # Is the parsed variable multiline (ending with \) + # alternatively if the line contains %{expand while the ending } is on other line self.multiline = False + self.multiline_expand = False # Are we inside of conditional or not self.condition = False # Is the condition with define/global variables @@ -122,7 +125,7 @@ } def start_subparagraph(self): - # Backup the list and start a new one + """Backup the paragraph and start a new one.""" self._oldstore.append(self.paragraph) self.paragraph = RpmPreambleElements(self.options) @@ -173,8 +176,19 @@ if parsed.netloc not in self.PYPI_SOURCE_HOSTS: return url + if self.reg.re_pypi_type.match(parsed.path): + match = self.reg.re_pypi_type.match(parsed.path) + pkg_type = match.group('type') + else: + pkg_type = 'source' + filename = os.path.basename(parsed.path) - modname = filename[: filename.rfind('-')] + if self.reg.re_pypi_modname.match(filename): + match = self.reg.re_pypi_modname.match(filename) + modname = match.group('pkgname') + else: + # no modname -> can't compile url + return url # TODO the following condition checks if the filename starts with a macro, # and expects that if it does, the macro is called "modname". This is not @@ -186,12 +200,11 @@ else: # don't know what to do return url - return parse.urlunparse( ( 'https', 'files.pythonhosted.org', - '/packages/source/{}/{}/{}'.format(modname[0], modname, filename), + '/packages/{}/{}/{}/{}'.format(pkg_type, modname[0], modname, filename), '', '', '', @@ -199,6 +212,12 @@ ) def end_subparagraph(self, endif=False): + """ + End the paragraph and flatten the output. + + If we are at the end we need to flatten and sort everything and give it + in the layers to the paragraph above us. + """ if not self._oldstore: nested = False else: @@ -338,6 +357,7 @@ self.previous_line = str(line) def add(self, line): + """Run over options and add the determined line to proper location.""" line = self._complete_cleanup(line) if self.condition and self.reg.re_patternmacro.search(line): @@ -352,9 +372,15 @@ # know ahead elif self.multiline: self._add_line_to('define', line) - # if it is no longer trailed with backslash stop - if not line.endswith('\\'): - self.multiline = False + # if it is no longer trailed with backslash + # or if the line ends with } on expand then stop + if self.multiline_expand: + if line.endswith('}'): + self.multiline_expand = False + self.multiline = False + else: + if not line.endswith('\\'): + self.multiline = False return # If we match the if else or endif we create subgroup @@ -500,6 +526,9 @@ ): if line.endswith('\\'): self.multiline = True + if '%{expand:' in line and '}' not in line: + self.multiline = True + self.multiline_expand = True # if we are kernel and not multiline we need to be at bottom, so # lets use misc section, otherwise go for define if not self.multiline and line.find('kernel_module') >= 0: @@ -633,6 +662,7 @@ self._add_line_to('misc', line) def output(self, fout, newline=True, new_class=None): + """Dump the results to the output list.""" lines = self.paragraph.flatten_output(self.subpkglicense) self.lines += lines Section.output(self, fout, newline, new_class) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmregexp.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmregexp.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmregexp.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmregexp.py 2020-06-16 12:39:03.000000000 +0200 @@ -103,6 +103,8 @@ re_packageand = re.compile(r'^packageand\(\s*(\S+)\s*:\s*(\S+)\s*\)\s*$') # otherproviders(foo) re_otherproviders = re.compile(r'^otherproviders\(\s*(\S+)\s*\)\s*$') + re_pypi_type = re.compile(r'^/packages/(?P<type>[\w|.]+)') + re_pypi_modname = re.compile(r'^(?P<pkgname>[\w\.\_\-+]+|%{?\w+}?)\-(%{?\w+}?|[\d\.]+)') # rpmdescription re_authors = re.compile(r'^\s*Author(s)?:\s*') @@ -219,4 +221,5 @@ re_deprecated_fgrep_regex = re.compile(r'\bfgrep\b') def __init__(self, keywords: List[str]) -> None: + """Compile all the keywords that are to be unbraced.""" self.re_unbrace_keywords = re.compile('%{(' + '|'.join(keywords) + ')}') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmsection.py new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmsection.py --- old/spec-cleaner-spec-cleaner-1.1.9/spec_cleaner/rpmsection.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/spec_cleaner/rpmsection.py 2020-06-16 12:39:03.000000000 +0200 @@ -1,5 +1,5 @@ # vim: set ts=4 sw=4 et: coding=UTF-8 -from typing import Any, Dict, IO, List, Optional +from typing import IO, Any, Dict, List, Optional from .rpmregexp import Regexp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/acceptance-tests.py new/spec-cleaner-spec-cleaner-1.2.0/tests/acceptance-tests.py --- old/spec-cleaner-spec-cleaner-1.1.9/tests/acceptance-tests.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/acceptance-tests.py 2020-06-16 12:39:03.000000000 +0200 @@ -5,13 +5,13 @@ """ -from glob import glob import os +from glob import glob from shutil import copyfile import pytest -from spec_cleaner import RpmException -from spec_cleaner import RpmSpecCleaner + +from spec_cleaner import RpmException, RpmSpecCleaner def collect_tests(directory): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/fileutils-tests.py new/spec-cleaner-spec-cleaner-1.2.0/tests/fileutils-tests.py --- old/spec-cleaner-spec-cleaner-1.1.9/tests/fileutils-tests.py 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/fileutils-tests.py 2020-06-16 12:39:03.000000000 +0200 @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import pytest + from spec_cleaner import RpmException from spec_cleaner.fileutils import open_datafile, open_stringio_spec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/in/multilineexpand.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/in/multilineexpand.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/in/multilineexpand.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/in/multilineexpand.spec 2020-06-16 12:39:03.000000000 +0200 @@ -0,0 +1,10 @@ +Name: rstudio + +%global _description %{expand: +RStudio is an integrated development environment (IDE) for R. It includes a +console, syntax-highlighting editor that supports direct code execution, as +well as tools for plotting, history, debugging and workspace management. +} + +%description %_description +This package provides common files for %{name}-desktop and %{name}-server. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/in/sources.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/in/sources.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/in/sources.spec 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/in/sources.spec 2020-06-16 12:39:03.000000000 +0200 @@ -4,6 +4,7 @@ Source200: ou NoSource: 300 Source300: godknowswhat +Source400: https://files.pythonhosted.org/packages/py2.py3/i/ipyleaflet/ipyleaflet-%{version}-py2.py3-none-any.whl %prep %setup -q diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/out/multilineexpand.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/out/multilineexpand.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/out/multilineexpand.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/out/multilineexpand.spec 2020-06-16 12:39:03.000000000 +0200 @@ -0,0 +1,11 @@ +%global _description %{expand: +RStudio is an integrated development environment (IDE) for R. It includes a +console, syntax-highlighting editor that supports direct code execution, as +well as tools for plotting, history, debugging and workspace management. +} +Name: rstudio + +%description %{_description} +This package provides common files for %{name}-desktop and %{name}-server. + +%changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/out/sources.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/out/sources.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/out/sources.spec 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/out/sources.spec 2020-06-16 12:39:03.000000000 +0200 @@ -2,6 +2,7 @@ Source2: somethingelse Source200: ou Source300: godknowswhat +Source400: https://files.pythonhosted.org/packages/py2.py3/i/ipyleaflet/ipyleaflet-%{version}-py2.py3-none-any.whl NoSource: 2 NoSource: 300 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/out-minimal/multilineexpand.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/out-minimal/multilineexpand.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/out-minimal/multilineexpand.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/out-minimal/multilineexpand.spec 2020-06-16 12:39:03.000000000 +0200 @@ -0,0 +1,11 @@ +%global _description %{expand: +RStudio is an integrated development environment (IDE) for R. It includes a +console, syntax-highlighting editor that supports direct code execution, as +well as tools for plotting, history, debugging and workspace management. +} +Name: rstudio + +%description %_description +This package provides common files for %{name}-desktop and %{name}-server. + +%changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-1.1.9/tests/out-minimal/sources.spec new/spec-cleaner-spec-cleaner-1.2.0/tests/out-minimal/sources.spec --- old/spec-cleaner-spec-cleaner-1.1.9/tests/out-minimal/sources.spec 2020-03-25 09:48:54.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-1.2.0/tests/out-minimal/sources.spec 2020-06-16 12:39:03.000000000 +0200 @@ -2,6 +2,7 @@ Source2: somethingelse Source200: ou Source300: godknowswhat +Source400: https://files.pythonhosted.org/packages/py2.py3/i/ipyleaflet/ipyleaflet-%{version}-py2.py3-none-any.whl NoSource: 2 NoSource: 300