diff mbox series

[meta-python] python3-netaddr: upgrade 0.10.1 -> 1.2.1 and add ptest

Message ID 20240304053939.1021959-1-alperyasinak1@gmail.com
State Accepted
Headers show
Series [meta-python] python3-netaddr: upgrade 0.10.1 -> 1.2.1 and add ptest | expand

Commit Message

Alper Ak March 4, 2024, 5:39 a.m. UTC
Ptest result:

Testsuite summary
TOTAL: 340
PASS: 339
SKIP: 1
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 28

* Tested on qemux86_64 and qemuarm64
* Add ptest into PTESTS_FAST_META_PYTHON items
==============

Switch to the python_setuptools_build_meta backend

License-Update: License check file changed from LICENSE to LICENSE.rst

Changelog:

Release: 1.2.1
===============
Fixed:

    Fix bad version 1.2.0 upload to PyPI – now yanked. No changes to the package.

Release: 1.2.0
===============
Added:

    Add CLI tool subcommand to display Network information.

Changed:

    Support running Interactive shell without IPython installed.

Fixed:

    Explicitly raise TypeError is a non-string value is passed to valid_ipv4() or valid_ipv6().

Release: 1.1.0
===============
Added:

    Add the required Python version to the package metadata (GH #365).
    Add expand_partial_ipv4_address() to the public API.

Fixed:

    Fix IPNetwork(...) in IPRange(...) false negatives (GH #157).
    Fix a few IPNetwork slicing edge cases (GH #214).
    Fix support for partial IP addresses accidentally left in IPNetwork in 1.0.0.
    When I removed the implicit_prefix switch I missed the fact that there was some partial IPv4 address expansion triggered unconditionally.
    If you need the old behavior use expand_partial_ipv4_address().
    Related GH issue: #110.
    Fixed an incorrect license classifier in the package metadata.

Release: 1.0.0
===============
Removed:

    Drop support for Python versions lower than 3.7.
    Remove the flag shorthands: N, P and Z. Use NOHOST, INET_PTON and ZEROFILL instead.
    Remove abbreviated CIDR format support in IPNetwork (implicit_prefix=True), use cidr_abbrev_to_verbose() if you need this behavior.
    Remove the IPAddress.is_private method.
    There are more precise replacements for subset of the addresses that used to handled by is_private:
        IPAddress.is_link_local()
        IPAddress.is_ipv4_private_use()
        IPAddress.is_ipv6_unique_local()
        IPAddress.is_global()
    The following address blocks used to be handled by is_private have no dedicated convenience methods and you’ll have to handle them manually or request a method addition:
        100.64.0.0/10 – Shared Address Space
        192.0.0.0/24 – IETF Protocol Assignments (watch out – there are exceptions in there)
        198.18.0.0/15 – Benchmarking
        239.0.0.0-239.255.255.255 – 240.0.0.0/4 is Reserved, 239.0.0.0/8 – unclear

Changed:

    Stop accepting leading zeros when parsing IPv4 addresses in INET_PTON mode (it’s been allowed on some platforms).
    If you need to allow and discard leading zeros use the ZEROFILL flag.
    This change will affect implicit conversions from str in all relevant contexts. If you need to control the IPv4 parsing mode construct IPAddress objects explicitly.
    Stop parsing IPv4 addresses permissively (inet_aton()-like) by default.
    INET_PTON is the default mode.
    If you need to be permissive and parse using inet_aton() semantics use the INET_ATON flag.
    This change will affect implicit conversions from str in all relevant contexts. If you need to control the IPv4 parsing mode construct IPAddress objects explicitly.
    Apply the two changes above to valid_ipv4() as well.
    Update the address databases to the 2024-02-10 versions.

Fixed:

    Return False instead of raising AddrFormatError when an empty string is passed to valid_ipv4() or valid_ipv6().
    Fix handling of dialect provided to EUI during copy-construction.

Signed-off-by: alperak <alperyasinak1@gmail.com>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-netaddr/run-ptest          |  3 +++
 ...ddr_0.10.1.bb => python3-netaddr_1.2.1.bb} | 23 +++++++++++++------
 3 files changed, 20 insertions(+), 7 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-netaddr/run-ptest
 rename meta-python/recipes-devtools/python/{python3-netaddr_0.10.1.bb => python3-netaddr_1.2.1.bb} (16%)
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index b6e8d865a..53934e656 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -30,6 +30,7 @@  PTESTS_FAST_META_PYTHON = "\
     python3-jsmin \
     python3-msgpack \
     python3-multidict \
+    python3-netaddr \
     python3-ordered-set \
     python3-parse \
     python3-parse-type \
diff --git a/meta-python/recipes-devtools/python/python3-netaddr/run-ptest b/meta-python/recipes-devtools/python/python3-netaddr/run-ptest
new file mode 100644
index 000000000..8d2017d39
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-netaddr/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-netaddr_0.10.1.bb b/meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb
similarity index 16%
rename from meta-python/recipes-devtools/python/python3-netaddr_0.10.1.bb
rename to meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb
index ce16cc178..082e7c502 100644
--- a/meta-python/recipes-devtools/python/python3-netaddr_0.10.1.bb
+++ b/meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb
@@ -1,13 +1,22 @@ 
 SUMMARY = "A network address manipulation library for Python."
 LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e6345d695ffe3776f68a56fe7962db44"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=8afa43eca873b71d5d85dd0be1f707fa"
 
-SRC_URI[sha256sum] = "f4da4222ca8c3f43c8e18a8263e5426c750a3a837fdfeccf74c68d0408eaa3bf"
+SRC_URI[sha256sum] = "6eb8fedf0412c6d294d06885c110de945cf4d22d2b510d0404f4e06950857987"
 
-inherit pypi setuptools3
+inherit pypi python_setuptools_build_meta ptest
 
-RDEPENDS:${PN} += " \
-    python3-io \
-    python3-pprint \
-    python3-xml \
+SRC_URI += " \
+        file://run-ptest \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/netaddr/tests/* ${D}${PTEST_PATH}/tests/
+}
+