Commit Graph

3281 Commits

Author SHA1 Message Date
Todd Zullinger f44dc3ebfd rpmdiff: adjust for rpm-4.19.0 API changes
The `fiFromHeader()` method has been removed from rpm-4.19.0, in rpm
commit 742be88cd (Drop the klunky and ugly rpm.fi python binding
finally, 2022-04-08)

It has (apparently) been deprecated since rpm commit f0c3985a7 (Make
fiFromHeader() static inside header-py, deprecate, 2009-09-23).

Use `rpm.files()` instead, which was added in rpm commit 3b086277b (New
rpmfile[s] python bindings, 2013-12-18).  This was released in
rpm-4.12.0.
2023-06-07 03:50:12 -04:00
Todd Zullinger ea139a3140 DocCheck: adjust for rpm-4.19.0 API changes
Apparently, using `dsFromHeader()` has been deprecated for a long time.
Using `rpm.ds()` is the preferred method.  It has been available for ~10
years, according to rpm commit 8d32255ff (Drop hdr.dsFromHeader() and
hdr.dsOfHeader() methods, 2022-04-08).
2023-06-07 03:50:12 -04:00
Martin Liska 645b9b3462 Add logo to README.md. 2023-04-24 11:04:38 +02:00
Martin Liska 600830222e Allow *args for get_tested_path. 2023-04-24 10:53:31 +02:00
Martin Liška ef6052b111
Merge pull request #1059 from marxin/use-get_tested_path
tests: use get_tested_path rather than testpath
2023-04-24 10:45:03 +02:00
Martin Liska 755ef0bf7e tests: use get_tested_path rather than testpath 2023-04-24 10:42:30 +02:00
Martin Liska b6138558cb Remove trailing whitespace. 2023-04-24 10:34:08 +02:00
Martin Liska 95033966bb pytest: fix one warning
Fixes:
/usr/lib/python3.10/site-packages/_pytest/python.py:199: PytestReturnNotNoneWarning: Expected None, but
test/test_filter.py::testpath returned PosixPath('/home/marxin/Programming/rpmlint/test'),
which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
2023-04-24 10:21:36 +02:00
Afrid Hussain f766a70ede
Introducing new file 'pytest.ini' a conf file for pytest (#1047)
* Introducing new file 'pytest.ini' a conf file for pytest

* Completly removing conftest.py file

This commit removes the conftest.py file in the root directory, whose's intention is only to add project path to sys.path when pytest is run wihout any arguments.
Which can be replaced with pytest.ini configuration variables.

changes:

- Added pythonpath variable to pytest.ini file

Reference:

- https://docs.pytest.org/en/7.3.x/reference/reference.html#confval-pythonpath

* Explicitly telling pytest to run tests from  directory

When it is not given, it recursively searches for testing directories according to the naming conventions and other rules, which takes time. However when explicilty telling pytest which directory to run tests it directly runs tests, no more searching for directories

Changes:

- In pytest.ini file created a testpaths variable and initialized with test, if in future, if more testing directories comes, just adding the corresponding directories should do the work

Reference:
- https://docs.pytest.org/en/7.3.x/reference/reference.html#confval-testpaths
2023-04-24 09:51:58 +02:00
Martin Liška 33df51a8f0
Merge pull request #1055 from danigm/logo
Add rpmlint.svg with the new rpmlint logo
2023-04-24 09:49:16 +02:00
Daniel Garcia Moreno 3e8ef16108 Add rpmlint.svg with the new rpmlint logo
Fix https://github.com/rpm-software-management/rpmlint/issues/1052
2023-04-20 13:35:46 +02:00
Martin Liška fa0bf9b291
Merge pull request #1054 from marxin/drop-pytest-flake8
Drop dependency on pytest-flake8 as it's unmaintained.
2023-04-19 21:08:38 +02:00
Martin Liska 25d48424b5 Drop dependency on pytest-flake8 as it's unmaintained.
Fixes: #1051
2023-04-19 16:37:07 +02:00
Martin Liška b9c413f419
Merge pull request #1050 from danigm/python-check
PythonCheck: Improve dependencies check
2023-04-11 14:40:17 +02:00
Daniel Garcia Moreno 40395a9e40 PythonCheck: Improve dependencies check
Improves the python extra dependencies evaluation, looking for all the
extras that are in the requirements like "module[extra1,extra2]".

See https://github.com/rpm-software-management/rpmlint/issues/1043
See 1c9310a285 (r106981163)
2023-04-11 11:46:13 +02:00
Martin Liška a82b1600b3
Merge pull request #1049 from danigm/fix-patch-detection
SpecCheck: Improve patch applied regex
2023-04-11 11:18:53 +02:00
Daniel Garcia Moreno 3631d5f12b SpecCheck: Improve patch applied regex
This patch improves the SpecCheck regular expression to detect patterns
like `%patch -P1 -p1`.

Fix https://github.com/rpm-software-management/rpmlint/issues/461
2023-04-10 09:17:20 +02:00
Martin Liška aaee1f14f7
Merge pull request #1046 from marxin/fix-binaries-check-instability
tests: make a local copy of configuration in test_binaries.py
2023-04-03 12:45:40 +02:00
Martin Liska 908e2430e1 tests: make a local copy of configuration in test_binaries.py 2023-04-03 12:36:10 +02:00
Martin Liska ca23d3c538 Add test for #1040. 2023-04-03 11:17:18 +02:00
Martin Liška ccb114e2ab
Merge pull request #1040 from cyungmann/fix-1035
Exclude systemd directory in UsrLibBinaryException
2023-04-03 11:09:41 +02:00
Martin Liška 1c9310a285
Merge pull request #1044 from danigm/fix-python-dep-check
PythonCheck: Handle complex dependency declaration gracefully
2023-03-31 09:25:34 +02:00
Daniel Garcia Moreno d6977cb991 PythonCheck: Handle complex dependency declaration gracefully
This patch catch the exception produced when a python dependency have
unexpected characters and do not produces a valid regular expression. It
also introduces a new method to handle the extra dependency declaration,
converting it to a possible python package name like
"module[extra] -> module-extra"

Fix https://github.com/rpm-software-management/rpmlint/issues/1043
2023-03-31 08:03:20 +02:00
Martin Liška eef3496006
Merge pull request #1042 from marxin/use-python-magic-part2
packit: use python-magic python pages for openSUSE CI
2023-03-29 14:15:04 +02:00
Martin Liska 96296a23df packit: use python-magic python pages for openSUSE CI 2023-03-29 13:54:17 +02:00
Martin Liška 1e537777c5
Merge pull request #1041 from marxin/use-python-magic
Start using python-magic package in CI.
2023-03-29 13:52:07 +02:00
Martin Liska e2090450cc openSUSE: Start using python-magic package in CI. 2023-03-29 12:50:29 +02:00
Chris Yungmann 6fc5a4675a
Exclude systemd directory in UsrLibBinaryException
Update UsrLibBinaryException in configdefaults.toml to exclude the systemd directory since it is common to install non-binary preset and systemd unit files there.
2023-03-28 09:39:28 -05:00
Martin Liška 36ea497cce
Merge pull request #1039 from marxin/fix-issue-879
stringToVersion: make epoch always an integer
2023-03-27 17:01:08 +02:00
Martin Liska 691b5d9990 stringToVersion: make epoch always an integer
Right now, we compare two version that are equal, but first part
uses integer and the second one string for epoch version:
('1', '5.5.4'), (1, '5.5.4'). Always leave epoch as integer.

Fixes: #879
2023-03-27 16:56:00 +02:00
Martin Liška 938efebbd6
Merge pull request #1038 from marxin/no-legacypath
pytest: disable legacypath
2023-03-27 09:54:45 +02:00
Martin Liska 8c06a042d6 pytest: disable legacypath 2023-03-27 09:51:24 +02:00
Martin Liska 3a6812a73f Replace one more usage of tmpdir in a test. 2023-03-27 09:49:15 +02:00
Martin Liška 8253a0dd33
Merge pull request #1037 from afrid18/refactor-tmpdir
Pytest documentation recommends refactoring "tmpdir" to "tmp_path"
2023-03-27 09:48:07 +02:00
Afrid Hussain 51a694f087
Pytest documentation recommends refactoring "tmpdir" to "tmp_path" 2023-03-26 06:04:58 +05:30
Martin Liška 96857d2dae
Merge pull request #1034 from danigm/improve-python-deps-check
PythonCheck: Remove spaces from requirements before compare
2023-03-24 14:29:49 +01:00
Daniel Garcia Moreno 5298d6da4f PythonCheck: Ignore python-devel in req check 2023-03-24 14:17:27 +01:00
Daniel Garcia Moreno ac986799b6 PythonCheck: ignore python-base package in requirements check 2023-03-24 11:30:56 +01:00
Martin Liška f621e58160
Merge pull request #1033 from marxin/patchable-function-entry-in-archive
Add new check: patchable-function-entry-in-archive.
2023-03-24 10:24:52 +01:00
Daniel Garcia Moreno 6bc83dfd95 PythonCheck: Remove spaces from requirements before compare 2023-03-24 09:33:24 +01:00
Martin Liska fdc5d02ab2 Add new check: patchable-function-entry-in-archive.
It is a sanity check for a static library that it should not contain
a __patchable_function_entries section.
2023-03-23 17:35:44 +01:00
Martin Liška 213f5cf3ae
Merge pull request #1022 from danigm/check-python-deps
PythonCheck: Add python requirements verification
2023-03-21 12:59:12 +01:00
Daniel Garcia Moreno 76a091814a PythonCheck: Add python requirements verification
This patch add two new warning messages, comparing the requirements
declared by the python package with the requirements found in the rpm
package and tries to detect missing or leftovers dependencies.

Fixes #1018
2023-03-21 12:46:44 +01:00
Martin Liška 1c8f7ca455
Merge pull request #1028 from tmzullinger/license-exception-in-group-again
TagsCheck: handle license exception in first item of a grouping
2023-03-20 09:54:15 +01:00
Todd Zullinger 65abdbd383 TagsCheck: handle license exception in first item of a grouping
The change in 7d707f7f (TagsCheck: handle license exception in grouping,
2023-03-03) is insufficient when the exception is on the first item in a
grouping, e.g.:

    License: (Apache-2.0 WITH LLVM-exception OR NCSA) AND BSD-3-Clause

Adjust `license_exception_regex` to exclude a leading '(' as well as a
trailing ')'.
2023-03-20 03:20:44 -04:00
Todd Zullinger 48aa148bd6 TagsCheck: restore space exclusion to license_exception_regex
In 7d707f7f (TagsCheck: handle license exception in grouping,
2023-03-03), the regex lost the exclusion of space characters.  This
isn't immediately noticeable because we strip the strings generated by
the regex before use, but it's better to keep the regex more precise.

Suggested-by: Daniel Garcia Moreno <daniel.garcia@suse.com>
2023-03-20 03:14:14 -04:00
Martin Liška 8ae737c5b7
Merge pull request #1026 from mimi1vx/prof_devel
Include -prof in devel packages regex
2023-03-19 07:59:24 +01:00
Martin Liška 01dc7e1da3
Merge pull request #1027 from mimi1vx/flake_fix
Remove unnnecesary lambda and map in favor generator expressions
2023-03-19 07:59:07 +01:00
Ondřej Súkup 84d9aee2e5 Remove unnnecesary lambda and map in favor generator expressions
This fixes CI complaints on openSUSE Tumbleweed
2023-03-19 01:53:03 +01:00
Ondřej Súkup 5587febadc
Include -prof in devel packages regex 2023-03-19 01:29:43 +01:00