Skip to contentSkip to conversation

python3-rfc3339-validator: remove usage of six

PATCH Superseded Ross Burton 1 participant 3 messages Sep 14

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 python3-rfc3339-validator: remove usage of six

Six is only needed to support Python 2 and 3 in a single script, but Py2 was EOL six years ago now. Patch out the need for six, and drop it as a dependency.

Also remove a redundant FILESEXTRAPATHS from when there were python- and python3- versions of the recipe.

---
 .../0001-Remove-usage-of-six.patch            | 62 +++++++++++++++++++
 .../python/python3-rfc3339-validator_0.1.4.bb |  3 +-
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python3-rfc3339-validator/0001-Remove-usage-of-six.patch
meta/recipes-devtools/python/python3-rfc3339-validator/0001-Remove-usage-of-six.patch new file +62 -0
new file mode 100644
index 00000000000..ad34b21edb1
@@ -0,0 +1,62 @@
+From 9e74298b018d61f93768061800fa670de8e34dfe Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+Date: Mon, 14 Sep 2026 22:27:29 +0100
+Subject: [PATCH] Remove usage of six
+
+The last release of Python 2 was 2.7.18, released in April 2020. Python
+was officially end-of-life in 2020.  I think it's time to stop catering
+for people using Python 2, so drop the usage of six.
+
+Closes #11.
+
+Upstream-Status: Submitted [https://github.com/naimetti/rfc3339-validator/pull/14]
+Signed-off-by: Ross Burton <[email protected]>
+---
+ rfc3339_validator.py            | 7 +------
+ setup.py                        | 4 +---
+ tests/test_rfc3339_validator.py | 9 +--------
+ 3 files changed, 3 insertions(+), 17 deletions(-)
+
+diff --git a/rfc3339_validator.py b/rfc3339_validator.py
+index 4be5e87..efc9b7d 100644
+--- a/rfc3339_validator.py
++++ b/rfc3339_validator.py
+@@ -6,11 +6,6 @@ __version__ = '0.1.4'
+ 
+ import re
+ import calendar
+-import six
+-
+-RFC3339_REGEX_FLAGS = 0
+-if six.PY3:
+-    RFC3339_REGEX_FLAGS |= re.ASCII
+ 
+ RFC3339_REGEX = re.compile(r"""
+     ^
+@@ -30,7 +25,7 @@ RFC3339_REGEX = re.compile(r"""
+        | [+-](?:[01]\d|2[0123]):[0-5]\d # Offset
+     )
+     $
+-""", re.VERBOSE | RFC3339_REGEX_FLAGS)
++""", re.VERBOSE | re.ASCII)
+ 
+ 
+ def validate_rfc3339(date_string):
+diff --git a/setup.py b/setup.py
+index 73186bd..b9936b0 100644
+--- a/setup.py
++++ b/setup.py
+@@ -8,9 +8,7 @@ from setuptools import setup, find_packages
+ with open('README.md') as readme_file:
+     readme = readme_file.read()
+ 
+-requirements = [
+-    'six',
+-]
++requirements = []
+ 
+ setup_requirements = []
+ 
+-- 
+2.43.0
+
meta/recipes-devtools/python/python3-rfc3339-validator_0.1.4.bb +1 -2
index 242176dd757..06eb833f7a9 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/naimetti/rfc3339-validator"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=a21b13b5a996f08f7e0b088aa38ce9c6"
 
-FILESEXTRAPATHS:prepend := "${THISDIR}/python-rfc3339-validator:"
+SRC_URI += "file://0001-Remove-usage-of-six.patch"
 
 SRC_URI[sha256sum] = "138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b"
 
@@ -14,7 +14,6 @@ inherit pypi setuptools3
 RDEPENDS:${PN} += "\
     python3-core \
     python3-datetime \
-    python3-six \
 "
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/3 python3-testtools: remove obsolete dependencies

The use of the extras module was removed in 2.6.0[1], and the use of six was removed in 2.5.0[2].

[1] testtools 5d3b595 ("Drop extras of extras; fixtures no longer uses it")
[2] testtools 8e8bf52 ("Remove six")

---
 meta/recipes-devtools/python/python3-testtools_2.9.1.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-devtools/python/python3-testtools_2.9.1.bb +0 -2
index 0c7f6221781..31809fe1edd 100644
@@ -13,9 +13,7 @@ SRC_URI[sha256sum] = "39ad9eb9e1b935d6838f4b3aee4d6e72db65df5602f6feda998dbb4fe8
 RDEPENDS:${PN} += "\
     python3-compression \
     python3-doctest \
-    python3-extras \
     python3-json \
-    python3-six \
     "
 
 BBCLASSEXTEND = "nativesdk"
Signature · 1 line
2.43.0
#2 lore raw

PATCH 3/3 python3-six: remove obsolete package

In reply to Ross Burton

Python 2 was end-of-lifed six years ago now, so I think it's time to retire the six module from core and move it to meta-python.

A lot of recipes in meta-oe still claim to depend on it, but I expect the majority of those are redundant.

---
 meta/conf/distro/include/maintainers.inc      |  1 -
 .../distro/include/ptest-packagelists.inc     |  1 -
 .../python/python3-six_1.17.0.bb              | 23 -------------------
 3 files changed, 25 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3-six_1.17.0.bb
meta/conf/distro/include/maintainers.inc +0 -1
index bded4bf6c7d..a41f2488089 100644
@@ -723,7 +723,6 @@ RECIPE_MAINTAINER:pn-python3-setuptools = "Trevor Gamblin <[email protected]
 RECIPE_MAINTAINER:pn-python3-setuptools-rust = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-setuptools-scm = "Trevor Gamblin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-shacl2code = "Benjamin Robin <[email protected]>"
-RECIPE_MAINTAINER:pn-python3-six = "Trevor Gamblin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-smartypants = "Trevor Gamblin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-smmap = "Trevor Gamblin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-snowballstemmer = "Tim Orling <[email protected]>"
meta/conf/distro/include/ptest-packagelists.inc +0 -1
index 2b5d665abe7..4012be5f499 100644
@@ -90,7 +90,6 @@ PTESTS_FAST = "\
     python3-pytz \
     python3-pyyaml \
     python3-rpds-py \
-    python3-six \
     python3-trove-classifiers \
     python3-vcs-versioning \
     python3-uritools \
meta/recipes-devtools/python/python3-six_1.17.0.bb deleted +0 -23
deleted file mode 100644
index ca120e03086..00000000000
@@ -1,23 +0,0 @@
-inherit setuptools3 ptest-python-pytest
-require python-six.inc
-
-SRC_URI[sha256sum] = "ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"
-
-PTEST_PYTEST_DIR = "."
-
-# test_six.py exercises the six.moves mappings, which import these stdlib
-# modules that are packaged separately in oe-core.
-RDEPENDS:${PN}-ptest += " \
-    python3-html \
-    python3-netclient \
-    python3-xmlrpc \
-"
-
-do_install_ptest:append() {
-    # six ships its test at the sdist root; keep only test_six.py plus the
-    # generated run-ptest, and drop the packaged library sources / bytecode.
-    rm -f  ${D}${PTEST_PATH}/six.py
-    rm -f  ${D}${PTEST_PATH}/setup.py ${D}${PTEST_PATH}/setup.cfg ${D}${PTEST_PATH}/MANIFEST.in
-    rm -f  ${D}${PTEST_PATH}/CHANGES ${D}${PTEST_PATH}/README.rst ${D}${PTEST_PATH}/PKG-INFO ${D}${PTEST_PATH}/LICENSE
-    rm -rf ${D}${PTEST_PATH}/build ${D}${PTEST_PATH}/documentation ${D}${PTEST_PATH}/six.egg-info ${D}${PTEST_PATH}/__pycache__
-}
Signature · 1 line
2.43.0