Compare commits

...

No commits in common. "c8-stream-3.6" and "c10s" have entirely different histories.

10 changed files with 198 additions and 58 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

18
.gitignore vendored
View File

@ -1 +1,17 @@
SOURCES/PyMySQL-0.10.1.tar.gz
/PyMySQL-0.6.6.tar.gz
/PyMySQL-0.6.7.tar.gz
/PyMySQL-0.7.9.tar.gz
/PyMySQL-0.7.10.tar.gz
/PyMySQL-0.7.11.tar.gz
/PyMySQL-0.8.0.tar.gz
/PyMySQL-0.8.1.tar.gz
/PyMySQL-0.9.0.tar.gz
/PyMySQL-0.9.1.tar.gz
/PyMySQL-0.9.2.tar.gz
/PyMySQL-0.9.3.tar.gz
/PyMySQL-0.10.0.tar.gz
/PyMySQL-0.10.1.tar.gz
/PyMySQL-1.0.2.tar.gz
/PyMySQL-1.0.3.tar.gz
/PyMySQL-1.1.0.tar.gz
/PyMySQL-1.1.1.tar.gz

View File

@ -1 +0,0 @@
723f04ee8864c7b4eac41e48690fd73bf82c147c SOURCES/PyMySQL-0.10.1.tar.gz

View File

@ -1,14 +0,0 @@
# This default charset revert is discussed in BZ#1885641
--- PyMySQL-0.10.1/pymysql/connections.py.old 2021-01-20 16:52:27.393165771 +0100
+++ PyMySQL-0.10.1/pymysql/connections.py 2021-01-20 16:52:53.876589478 +0100
@@ -88,7 +88,7 @@
}
-DEFAULT_CHARSET = 'utf8mb4'
+DEFAULT_CHARSET = 'latin1'
MAX_PACKET_LEN = 2**24-1

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

7
plans/main.fmf Normal file
View File

@ -0,0 +1,7 @@
execute:
how: tmt
discover:
how: fmf
/mariadb:

View File

@ -1,21 +1,13 @@
%global pypi_name PyMySQL
Name: python-%{pypi_name}
Version: 0.10.1
Release: 2%{?dist}
Name: python-PyMySQL
Version: 1.1.1
Release: 3%{?dist}
Summary: Pure-Python MySQL client library
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}/
Source0: https://files.pythonhosted.org/packages/source/P/PyMySQL/PyMySQL-%{version}.tar.gz
Patch0: default_charset_revert.patch
URL: https://pypi.org/project/pymysql/
Source: %{pypi_source PyMySQL}
BuildArch: noarch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%description
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
@ -23,60 +15,129 @@ to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
and Jython.
%package -n python%{python3_pkgversion}-%{pypi_name}
%package -n python3-PyMySQL
Summary: %{summary}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-cryptography
BuildRequires: python%{python3_pkgversion}-rpm-macros
Requires: python%{python3_pkgversion}-cryptography
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
BuildRequires: python3-devel
%description -n python%{python3_pkgversion}-%{pypi_name}
%description -n python3-PyMySQL
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
and Jython.
%pyproject_extras_subpkg -n python3-PyMySQL rsa %{!?rhel:ed25519}
%prep
%setup -qn %{pypi_name}-%{version}
%patch0 -p1
rm -rf %{pypi_name}.egg-info
# Remove tests files so they are not installed globally.
rm -rf tests
%autosetup -n pymysql-%{version}
%generate_buildrequires
%pyproject_buildrequires -x rsa %{!?rhel:-x ed25519}
%build
%py3_build
%pyproject_wheel
%install
%py3_install
%pyproject_install
%pyproject_save_files pymysql
%check
# Tests cannot be launch on koji, they require a mysqldb running.
%pyproject_check_import
%files -n python%{python3_pkgversion}-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/pymysql/
%files -n python3-PyMySQL -f %{pyproject_files}
%doc README.md
%changelog
* Wed Jan 20 2021 Lukas Javorsky <ljavorsk@redhat.com> - 0.10.1-2
- Revert upstream change of default charset (from utf8mb4 to latin1)
- Resolves BZ#1885641
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.1.1-3
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Tue Oct 06 2020 Michal Schorm <mschorm@redhat.com> - 0.10.1-1
- Rebase to 0.10 version to add support for MariaDB ed25519 authentication mechanism
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 0.9.3-3
- Exclude unsupported i686 arch
* Sat Jun 15 2024 Julien Enselme <jujens@jujens.eu> - 1.1.1-1
- Update to 1.1.1
* Thu Nov 21 2019 Lumír Balhar <lbalhar@redhat.com> - 0.9.3-2
- Adjusted for Python 3.8 module in RHEL 8
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.1.0-7
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jan 16 2024 Carl George <carlwgeorge@fedoraproject.org> - 1.1.0-4
- Convert to pyproject macros
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 04 2023 Python Maint <python-maint@redhat.com> - 1.1.0-2
- Rebuilt for Python 3.12
* Tue Jul 04 2023 Julien Enselme <jujens@jujens.eu> - 1.1.0-1
- Update to 1.1.0
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 1.0.3-3
- Rebuilt for Python 3.12
* Thu May 11 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.3-2
- Disable ed25519 in RHEL builds
* Tue Apr 25 2023 Julien Enselme <jujens@jujens.eu> - 1.0.3-1
- Update to 1.0.3
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Aug 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.2-3
- Add metapackages for “rsa” and “ed25519” extras
- Drop hard dependency on python3-cryptography
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jun 29 2022 Julien Enselme <jujens@jujens.eu> - 1.0.2-1
- Update to 1.0.2
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 0.10.1-6
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.10.1-3
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Sep 10 2020 Fedora Release Monitoring <release-monitoring@fedoraproject.org> - 0.10.1-1
- Update to 0.10.1 (#1877703)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Jul 18 2020 Julien Enselme <jujens@jujens.eu> - 0.10.0-1
- Update to 0.10.0
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.9.3-3
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Nov 18 2019 Lumír Balhar <lbalhar@redhat.com> - 0.9.3-1
- New upstream version 0.9.3

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (PyMySQL-1.1.1.tar.gz) = 09d533232a2e939ea4586452b97bd6f2d35cf5347027167ab16f154cc5cd63713da6b8782b9669829e1f4f161f189c79bacd2b57cf50880c27d90c832bc3683f

9
tests/unit/main.fmf Normal file
View File

@ -0,0 +1,9 @@
test: ./test.sh
framework: beakerlib
require:
- library(database/mariadb)
- python3-PyMySQL
- python3-pytest
- git-core
tag:
- rhel-buildroot

54
tests/unit/test.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
# Runs upstream tests (they are not part of the source tarball)
# make sure to update VERSION_TAG in the case of rebase
# Autodetection from rpm if not set directly
# VERSION_TAG="${VERSION_TAG:-v1.1.0}"
PYTHON="${PYTHON:-python3}"
USER="tester$$"
USER_HOME="/home/$USER"
UPSTREAM_SOURCE="https://github.com/PyMySQL/PyMySQL"
rlJournalStart
rlPhaseStartSetup
rlImport "database/mariadb" || rlDie
rlRun mariadbStart || rlDie
rlRun "mysql -uroot -e \"SET PASSWORD FOR 'root'@'localhost' = '' \""
rlRun "mysql -h127.0.0.1 -uroot -e 'select version()'" || rlDie
rlRun "useradd $USER"
git clone $UPSTREAM_SOURCE "$USER_HOME/repo"
SYSTEM_LOCATION="$(dirname $($PYTHON -c 'import pymysql; print(pymysql.__file__)'))"
if [[ -z "$VERSION_TAG" ]]; then
VERSION_TAG="v$(rpm -qf $SYSTEM_LOCATION --qf '%{VERSION}')"
rlLog "Detected version: $VERSION_TAG"
fi
rlRun "(cd $USER_HOME/repo && git checkout $VERSION_TAG)"
rlRun "rlFileBackup --clean $SYSTEM_LOCATION"
rlRun "mv $USER_HOME/repo/pymysql/tests $SYSTEM_LOCATION"
rlRun 'mysql -h127.0.0.1 -uroot -e "SET GLOBAL local_infile=on"'
rlRun "mysql -h127.0.0.1 -uroot --comments < $USER_HOME/repo/ci/docker-entrypoint-initdb.d/init.sql"
rlRun "mysql -h127.0.0.1 -uroot --comments < $USER_HOME/repo/ci/docker-entrypoint-initdb.d/mysql.sql"
rlRun "mysql -h127.0.0.1 -uroot --comments < $USER_HOME/repo/ci/docker-entrypoint-initdb.d/mariadb.sql"
rlRun "cp $USER_HOME/repo/ci/docker.json $SYSTEM_LOCATION/tests/databases.json"
rlRun "sed -e 's^/run/mysqld/mysqld.sock^/var/lib/mysql/mysql.sock^' -i $SYSTEM_LOCATION/tests/databases.json"
rlPhaseEnd
rlPhaseStartTest
# there is no `nacl` on rhel/c10s
rlRun "su -l -c \"pytest -v $SYSTEM_LOCATION/tests -k 'not testAuthEd25519'\" $USER"
rlPhaseEnd
rlPhaseStartCleanup
rlRun mariadbStop
rlRun "userdel -rf $USER"
rlPhaseEnd
rlJournalEnd