Skip to content

Commit b5455e0

Browse files
committed
WL#16307: Remove Python 3.8 support
The aim of this WorkLog (WL) is to remove the support of Python 3.8 from MySQL Connector/Python, as a consequence the EL7 platform support for Connector/Python is also getting dropped. Change-Id: Ica0915d9a58f5affacaf02f7577cda85f5c8a3ef
1 parent 8c82309 commit b5455e0

File tree

6 files changed

+27
-142
lines changed

6 files changed

+27
-142
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ v9.1.0
1414
- WL#16444: Drop build support for DEB packages
1515
- WL#16442: Upgrade gssapi version to 1.8.3
1616
- WL#16411: Improve wheel metadata information for Classic and XDevAPI connectors
17+
- WL#16307: Remove Python 3.8 support
1718
- WL#16306: Add support for Python 3.13
1819

1920
v9.0.0

mysql-connector-python/cpydist/data/rpm/mysql-connector-python.spec

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,9 @@
3030

3131
%undefine _package_note_file
3232

33-
%if 0%{?suse_version} == 1315
34-
%global dist .sles12
35-
%{!?__python3: %global __python3 /usr/bin/python3}
36-
%endif
37-
38-
%if 0%{?suse_version} == 1500
39-
%global dist .sl15
40-
%global __python3 /usr/bin/python3.11
41-
%global python3_sitearch %{_libdir}/python3.11/site-packages
42-
%endif
43-
44-
# SCL is used on el7 https://www.softwarecollections.org/en/docs/guide/
45-
%if 0%{?rhel} == 7
46-
%global _enable_debug_package 0
47-
%global debug_package %{nil}
48-
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
49-
%global scl rh-python38
50-
%scl_package mysql-connector-python
51-
%global python3_pkgversion %{nil}
52-
%endif
53-
5433
%if 0%{?rhel} == 8
55-
%{!?__python3: %global __python3 /usr/bin/python3.8}
56-
%{!?python3_pkgversion: %global python3_pkgversion 38}
34+
%{!?__python3: %global __python3 /usr/bin/python3.9}
35+
%{!?python3_pkgversion: %global python3_pkgversion 39}
5736
%endif
5837

5938
%{?mysql_capi: %global with_mysql_capi %{mysql_capi}}
@@ -90,36 +69,15 @@ Summary: Standardized MySQL database driver for Python
9069
Name: mysql-connector-python%{?product_suffix}
9170
Version: %{version}
9271
Release: 1%{?version_extra:.%{version_extra}}%{?byte_code_only:.1}%{?dist}
93-
License: Copyright (c) 2015, 2021, Oracle and/or its affiliates. Under %{?license_type} license as shown in the Description field.
72+
License: Copyright (c) 2015, 2024, Oracle and/or its affiliates. Under %{?license_type} license as shown in the Description field.
9473
URL: https://dev.mysql.com/downloads/connector/python/
9574
Source0: https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python%{?product_suffix}-%{version}-src.tar.gz
9675

9776
%{!?with_mysql_capi:BuildRequires: mysql-devel}
9877

99-
%if 0%{?fedora}
100-
BuildRequires: python3-devel
101-
BuildRequires: python3-setuptools
102-
%endif
103-
104-
%if 0%{?suse_version} == 1500
105-
BuildRequires: python311-devel
106-
BuildRequires: python311-setuptools
107-
%endif
108-
109-
%if 0%{?rhel} == 7
110-
BuildRequires: scl-utils
111-
BuildRequires: scl-utils-build
112-
BuildRequires: rh-python38-build
113-
BuildRequires: rh-python38-runtime
114-
BuildRequires: rh-python38-python-devel
115-
BuildRequires: rh-python38-python-setuptools
116-
BuildRequires: rh-python38-python-rpm-macros
117-
%endif
118-
11978
%if 0%{?rhel} == 8
120-
BuildRequires: python38-devel
121-
BuildRequires: python38-setuptools
122-
BuildRequires: python38-rpm-macros
79+
BuildRequires: python39-devel
80+
BuildRequires: python39-setuptools
12381
%endif
12482

12583
%description
@@ -152,27 +110,8 @@ Obsoletes: mysql-connector-python3-cext < %{version}-%{release}
152110
Provides: mysql-connector-python3-cext = %{version}-%{release}
153111
%endif
154112

155-
%if 0%{?fedora}
156-
Requires: python3
157-
%endif
158-
159-
%if 0%{?suse_version} == 1500
160-
Requires: python311
161-
%endif
162-
163-
%if 0%{?rhel} == 7
164-
Requires: %{scl}-runtime
165-
%endif
166-
167113
%if 0%{?rhel} == 8
168-
Requires: python38
169-
%endif
170-
171-
# Some operations requires DNSPYTHON but this is not a strict
172-
# requirement for the RPM install as currently few RPM platforms has
173-
# the required version as RPMs. Users need to install using PIP.
174-
%if 0%{?fedora}
175-
Requires: python3-dns >= %{wants_py_dnspython_version}
114+
Requires: python39
176115
%endif
177116

178117
%description -n mysql-connector-python3%{?product_suffix}
@@ -242,6 +181,11 @@ cd mysql-connector-python
242181
%{python3_sitearch}/_mysql_connector.cpython*.so
243182
244183
%changelog
184+
* Wed Jul 31 2024 Souma Kanti Ghosh <souma.kanti.ghosh@oracle.com> - 9.1.0-1
185+
- Removed rules for Fedora, openSUSE and EL7 platforms
186+
- Removed Python 3.8 support
187+
- Updated copyright year from 2021 to 2024
188+
245189
* Fri May 31 2024 Oscar Pacheco <oscar.p.pacheco@oracle.com> - 9.0.0-1
246190
- Updated for 9.0.0
247191

mysql-connector-python/unittests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def setup_stats_db(cnx):
681681
"""Setup the database for storing statistics"""
682682
cur = cnx.cursor()
683683

684-
supported_python = ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13")
684+
supported_python = ("3.9", "3.10", "3.11", "3.12")
685685
supported_mysql = ("5.7", "8.0", "8.4", "9.0")
686686

687687
columns = []

mysqlx-connector-python/cpydist/data/rpm/mysql-connector-python.spec

Lines changed: 11 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,9 @@
3030

3131
%undefine _package_note_file
3232

33-
%if 0%{?suse_version} == 1315
34-
%global dist .sles12
35-
%{!?__python3: %global __python3 /usr/bin/python3}
36-
%endif
37-
38-
%if 0%{?suse_version} == 1500
39-
%global dist .sl15
40-
%global __python3 /usr/bin/python3.11
41-
%global python3_sitearch %{_libdir}/python3.11/site-packages
42-
%endif
43-
44-
# SCL is used on el7 https://www.softwarecollections.org/en/docs/guide/
45-
%if 0%{?rhel} == 7
46-
%global _enable_debug_package 0
47-
%global debug_package %{nil}
48-
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
49-
%global scl rh-python38
50-
%scl_package mysqlx-connector-python
51-
%global python3_pkgversion %{nil}
52-
%endif
53-
5433
%if 0%{?rhel} == 8
55-
%{!?__python3: %global __python3 /usr/bin/python3.8}
56-
%{!?python3_pkgversion: %global python3_pkgversion 38}
34+
%{!?__python3: %global __python3 /usr/bin/python3.9}
35+
%{!?python3_pkgversion: %global python3_pkgversion 39}
5736
%endif
5837

5938
%{?protobuf_include_dir: %global with_protobuf_include_dir %{protobuf_include_dir}}
@@ -87,38 +66,13 @@ Summary: Standardized MySQL database driver for Python
8766
Name: mysqlx-connector-python%{?product_suffix}
8867
Version: %{version}
8968
Release: 1%{?version_extra:.%{version_extra}}%{?byte_code_only:.1}%{?dist}
90-
License: Copyright (c) 2015, 2021, Oracle and/or its affiliates. Under %{?license_type} license as shown in the Description field.
69+
License: Copyright (c) 2015, 2024, Oracle and/or its affiliates. Under %{?license_type} license as shown in the Description field.
9170
URL: https://dev.mysql.com/downloads/connector/python/
9271
Source0: https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python%{?product_suffix}-%{version}-src.tar.gz
9372

94-
%if 0%{?fedora}
95-
BuildRequires: python3-devel
96-
BuildRequires: python3-setuptools
97-
%endif
98-
99-
%if 0%{?suse_version} == 1500
100-
BuildRequires: python311-devel
101-
BuildRequires: python311-setuptools
102-
%endif
103-
104-
%if 0%{?rhel} == 7
105-
BuildRequires: scl-utils
106-
BuildRequires: scl-utils-build
107-
BuildRequires: rh-python38-build
108-
BuildRequires: rh-python38-runtime
109-
BuildRequires: rh-python38-python-devel
110-
BuildRequires: rh-python38-python-setuptools
111-
BuildRequires: rh-python38-python-rpm-macros
112-
%endif
113-
11473
%if 0%{?rhel} == 8
115-
BuildRequires: python38-devel
116-
BuildRequires: python38-setuptools
117-
BuildRequires: python38-rpm-macros
118-
%endif
119-
120-
%if 0%{?fedora}
121-
%global __requires_exclude .*protobuf.*
74+
BuildRequires: python39-devel
75+
BuildRequires: python39-setuptools
12276
%endif
12377

12478
%description
@@ -151,27 +105,8 @@ Obsoletes: mysqlx-connector-python3-cext < %{version}-%{release}
151105
Provides: mysqlx-connector-python3-cext = %{version}-%{release}
152106
%endif
153107

154-
%if 0%{?fedora}
155-
Requires: python3
156-
%endif
157-
158-
%if 0%{?suse_version} == 1500
159-
Requires: python311
160-
%endif
161-
162-
%if 0%{?rhel} == 7
163-
Requires: %{scl}-runtime
164-
%endif
165-
166108
%if 0%{?rhel} == 8
167-
Requires: python38
168-
%endif
169-
170-
# Some operations requires DNSPYTHON but this is not a strict
171-
# requirement for the RPM install as currently few RPM platforms has
172-
# the required version as RPMs. Users need to install using PIP.
173-
%if 0%{?fedora}
174-
Requires: python3-dns >= %{wants_py_dnspython_version}
109+
Requires: python39
175110
%endif
176111

177112

@@ -238,6 +173,11 @@ sed -i -e '/protobuf/d' %{buildroot}%{python3_sitearch}/mysqlx_connector_python-
238173
%{python3_sitearch}/_mysqlxpb.cpython*.so
239174
240175
%changelog
176+
* Mon Aug 5 2024 Souma Kanti Ghosh <souma.kanti.ghosh@oracle.com> - 9.1.0-1
177+
- Removed rules for Fedora, openSUSE and EL7 platforms
178+
- Removed Python 3.8 support
179+
- Updated copyright year from 2021 to 2024
180+
241181
* Fri May 31 2024 Oscar Pacheco <oscar.p.pacheco@oracle.com> - 9.0.0-1
242182
- Updated for 9.0.0
243183

mysqlx-connector-python/docs/mysqlx/requirements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Requirements
22
============
33

44
* MySQL 8.0.0 or higher, with the X Plugin enabled
5-
* Python >= 3.8
5+
* Python >= 3.9
66
* Protobuf C++ (version == 4.25.3)
77
* Python Protobuf (version == 4.25.3)
88
* dnspython (version == 2.6.1) for DNS SRV support

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ skip_glob = [
5151

5252
[tool.black]
5353
line-length = 88
54-
target-version = ['py38']
54+
target-version = ['py39']
5555
exclude = '''
5656
(
5757
/(
@@ -133,7 +133,7 @@ good-names = ["i", "f", "db", "dt", "ca", "hi", "pw"]
133133
[tool.mypy]
134134
# https://mypy.readthedocs.io/en/stable/command_line.html
135135
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
136-
python_version = 3.8
136+
python_version = 3.9
137137
disallow_untyped_defs = true
138138
show_error_codes = true
139139
warn_unused_ignores = true

0 commit comments

Comments
 (0)