Skip to content

Commit

Permalink
python3-netaddr: upgrade 0.10.1 -> 1.2.1 and add ptest
Browse files Browse the repository at this point in the history
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 openembedded#365).
    Add expand_partial_ipv4_address() to the public API.

Fixed:

    Fix IPNetwork(...) in IPRange(...) false negatives (GH openembedded#157).
    Fix a few IPNetwork slicing edge cases (GH openembedded#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: openembedded#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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
alperak authored and kraj committed Mar 4, 2024
1 parent f500d8c commit 8ac8864
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PTESTS_FAST_META_PYTHON = "\
python3-jsmin \
python3-msgpack \
python3-multidict \
python3-netaddr \
python3-ordered-set \
python3-parse \
python3-parse-type \
Expand Down
3 changes: 3 additions & 0 deletions meta-python/recipes-devtools/python/python3-netaddr/run-ptest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

pytest --automake
13 changes: 0 additions & 13 deletions meta-python/recipes-devtools/python/python3-netaddr_0.10.1.bb

This file was deleted.

22 changes: 22 additions & 0 deletions meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SUMMARY = "A network address manipulation library for Python."
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=8afa43eca873b71d5d85dd0be1f707fa"

SRC_URI[sha256sum] = "6eb8fedf0412c6d294d06885c110de945cf4d22d2b510d0404f4e06950857987"

inherit pypi python_setuptools_build_meta ptest

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/
}

0 comments on commit 8ac8864

Please sign in to comment.