Bump version, enable new features, add test suite to Fedora CI

This commit is contained in:
Tomas Orsava 2020-04-30 16:24:11 +02:00
parent 79790d12af
commit 54e4aa751b
8 changed files with 55 additions and 6 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/test-sources-2020-04-29.tar.gz
/tests/__pycache__/
/tests/data/scripts_pythondistdeps/usr/

View File

@ -1,7 +1,7 @@
Name: python-rpm-generators
Summary: Dependency generators for Python RPMs
Version: 11
Release: 4%{?dist}
Release: 5%{?dist}
# Originally all those files were part of RPM, so license is kept here
License: GPLv2+
@ -45,6 +45,15 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} pythondistdeps.py
%{_rpmconfigdir}/pythondistdeps.py
%changelog
* Wed Apr 29 2020 Tomas Orsava <torsava@redhat.com> - 11-5
- Backporting proposed upstream changes
https://github.com/rpm-software-management/rpm/pull/1195
- Only provide python3dist(..) for the main Python versions (BZ#1812083)
- Preparation for the proper handling of normalized names (BZ#1791530)
- Add a test suite (and enable it in Fedora CI)
- Better error messages for unsupported package versions
- Fix sorting of dev versions
* Tue Apr 28 2020 Miro Hrončok <mhroncok@redhat.com> - 11-4
- Don't define global Lua variables from Python generator

View File

@ -1,3 +1,3 @@
%__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
%__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
%__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --normalized-names-format legacy-dots --normalized-names-provide-both --majorver-provides-versions 2.7,%{__default_python3_version}
%__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires --normalized-names-format legacy-dots
%__pythondist_path ^/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (test-sources-2020-04-29.tar.gz) = a5539fbe05a4f7128b4f82e960c3f1392a55ad53086dfd7fbc436d2743feaf64784e08667237baed3a32f149db25bc63e4ab3efc2b0270f969c59550b75102b1

View File

@ -0,0 +1 @@
../../../update-test-sources.sh

View File

@ -37,7 +37,7 @@ import sys
import tempfile
import yaml
PYTHONDISTDEPS_PATH = Path(__file__).parent / '..' / 'scripts' / 'pythondistdeps.py'
PYTHONDISTDEPS_PATH = Path(__file__).parent / '..' / 'pythondistdeps.py'
TEST_DATA_PATH = Path(__file__).parent / 'data' / 'scripts_pythondistdeps'

View File

@ -8,10 +8,15 @@
state: latest
- hosts: localhost
tags:
- classic
pre_tasks:
- import_role:
name: standard-test-source
vars:
fetch_only: True
roles:
- role: standard-test-basic
tags:
- classic
tests:
- pythonabi:
dir: .
@ -19,6 +24,18 @@
- pythonname:
dir: .
run: ./pythonname.sh
- prepare-test-data:
dir: .
run: tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/
- pythondistdeps:
dir: ./tests
# Use update-test-sources.sh to update the test data
run: python3 -m pytest --capture=no -vvv
required_packages:
- rpm-build
- python3-devel
- python3-pip
- python3-pytest
- python3-pyyaml
- python3-setuptools
- python3-wheel

19
update-test-sources.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#
# Requirements:
# - pip >= 20.0.1
#
# First prune old test data
rm -rf ./tests/data/scripts_pythondistdeps/usr
# First run the test suite, it will download the test-data again
python3 -m pytest --capture=no -vvv
# Archive the test data into a file with today's date
archive=test-sources-$(date +%Y-%m-%d).tar.gz
tar -zcvf ${archive} -C ./tests/data/scripts_pythondistdeps/ usr
# Now manually run:
# $ fedpkg new-sources ${archive}