Merge pull request #270042 from a-n-n-a-l-e-e/pyregion-fix

python311Packages.pyregion: 2.1.1 -> 2.2.0; fix darwin build

authored by Robert Scott and committed by GitHub 24d1305f 9eeeb192

+30 -34
+30 -34
pkgs/development/python-modules/pyregion/default.nix
··· 3 , buildPythonPackage 4 , fetchFromGitHub 5 , fetchpatch 6 - , pyparsing 7 - , numpy 8 , cython 9 , astropy 10 - , astropy-helpers 11 , pytestCheckHook 12 , pytest-astropy 13 }: 14 15 buildPythonPackage rec { 16 pname = "pyregion"; 17 - version = "2.1.1"; 18 19 # pypi src contains cython-produced .c files which don't compile 20 # with python3.9 21 src = fetchFromGitHub { 22 owner = "astropy"; 23 repo = pname; 24 - rev = "v${version}"; 25 - hash = "sha256-xo+XbBJ2HKql9rd7Ma84JofRg8M4u6vmz44Qo8JhEBc="; 26 }; 27 28 propagatedBuildInputs = [ 29 - pyparsing 30 - numpy 31 astropy 32 - cython 33 ]; 34 35 - # Upstream patches needed for the tests to pass 36 - # See https://github.com/astropy/pyregion/pull/157/ 37 - patches = [ 38 - (fetchpatch { 39 - url = "https://github.com/astropy/pyregion/pull/157/commits/082649730d353a0d0c0ee9619be1aa501aabba62.patch"; 40 - hash = "sha256-4mHZt3S29ZfK+QKavm6DLBwVxGl/ga7W7GEcQ5ewxuo="; 41 - }) 42 - (fetchpatch { 43 - url = "https://github.com/astropy/pyregion/pull/157/commits/c448a465dd56887979da62aec6138fc89bb37b19.patch"; 44 - hash = "sha256-GEtvScmVbAdE4E5Xx0hNOPommvzcnJ3jNZpBmY3PbyE="; 45 - }) 46 ]; 47 48 - nativeBuildInputs = [ astropy-helpers cython ]; 49 - 50 nativeCheckInputs = [ pytestCheckHook pytest-astropy ]; 51 52 - disabledTests = lib.optionals (!stdenv.hostPlatform.isDarwin) [ 53 - # Skipping 2 tests because it's failing. Domain knowledge was unavailable on decision. 54 - # Error logs: https://gist.github.com/superherointj/3f616f784014eeb2e3039b0f4037e4e9 55 - "test_calculate_rotation_angle" 56 - "test_region" 57 - ]; 58 - 59 - # Disable automatic update of the astropy-helper module 60 - postPatch = '' 61 - substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" 62 - ''; 63 - 64 # Tests must be run in the build directory 65 preCheck = '' 66 pushd build/lib.* ··· 70 ''; 71 72 meta = with lib; { 73 description = "Python parser for ds9 region files"; 74 homepage = "https://github.com/astropy/pyregion"; 75 license = licenses.mit;
··· 3 , buildPythonPackage 4 , fetchFromGitHub 5 , fetchpatch 6 + # needed to build 7 , cython 8 + , oldest-supported-numpy 9 + , setuptools 10 + , setuptools-scm 11 + , wheel 12 + # needed to run 13 , astropy 14 + , numpy 15 + , pyparsing 16 + # needed to check 17 , pytestCheckHook 18 , pytest-astropy 19 }: 20 21 buildPythonPackage rec { 22 pname = "pyregion"; 23 + version = "2.2.0"; 24 + pyproject = true; 25 26 # pypi src contains cython-produced .c files which don't compile 27 # with python3.9 28 src = fetchFromGitHub { 29 owner = "astropy"; 30 repo = pname; 31 + rev = version; 32 + hash = "sha256-r2STKnZwNvonXATrQ5q9NVD9QftlWI1RWl4F+GZSxVg="; 33 + }; 34 + 35 + env = { 36 + SETUPTOOLS_SCM_PRETEND_VERSION = version; 37 + } // lib.optionalAttrs stdenv.cc.isClang { 38 + # Try to remove on next update. generated code returns a NULL in a 39 + # function where an int is expected. 40 + NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion"; 41 }; 42 43 propagatedBuildInputs = [ 44 astropy 45 + numpy 46 + pyparsing 47 ]; 48 49 + nativeBuildInputs = [ 50 + cython 51 + oldest-supported-numpy 52 + setuptools 53 + setuptools-scm 54 + wheel 55 ]; 56 57 nativeCheckInputs = [ pytestCheckHook pytest-astropy ]; 58 59 # Tests must be run in the build directory 60 preCheck = '' 61 pushd build/lib.* ··· 65 ''; 66 67 meta = with lib; { 68 + changelog = "https://github.com/astropy/pyregion/blob/${version}/CHANGES.rst"; 69 description = "Python parser for ds9 region files"; 70 homepage = "https://github.com/astropy/pyregion"; 71 license = licenses.mit;