nixpkgs/pkgs/development/python-modules/netaddr/default.nix
Andrew Childs c32441811f pythonPackages.netaddr: 0.7.19 -> 0.8.0
Updating to >= 0.7.20 fixes tests on macOS Catalina and newer:

        #   inet_pton has to be different on Mac OSX *sigh*
        assert IPAddress('010.000.000.001', flags=INET_PTON) == IPAddress('10.0.0.1')
>       assert int_to_str(0xffff) == '::0.0.255.255'
E       AssertionError: assert '::ffff' == '::0.0.255.255'
E         - ::0.0.255.255
E         + ::ffff
2020-09-20 15:26:11 -07:00

33 lines
809 B
Nix

{ stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, glibcLocales
, importlib-resources
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "netaddr";
version = "0.8.0";
src = fetchPypi {
inherit pname version;
sha256 = "0hx2npi0wnhwlcybilgwlddw6qffx1mb7a3sj4p9s7bvl33mgk6n";
};
LC_ALL = "en_US.UTF-8";
propagatedBuildInputs = stdenv.lib.optionals (pythonOlder "3.7") [ importlib-resources ];
checkInputs = [ glibcLocales pytestCheckHook ];
meta = with stdenv.lib; {
homepage = "https://netaddr.readthedocs.io/en/latest/";
downloadPage = "https://github.com/netaddr/netaddr/releases";
changelog = "https://netaddr.readthedocs.io/en/latest/changes.html";
description = "A network address manipulation library for Python";
license = licenses.mit;
};
}