1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 fetchpatch2,
7 hatch-fancy-pypi-readme,
8 hatch-vcs,
9 hatchling,
10 distro,
11 packaging,
12 setuptools,
13 wheel,
14 tomli,
15 # Test Inputs
16 cmake,
17 cython,
18 git,
19 pytestCheckHook,
20 pytest-mock,
21 requests,
22 virtualenv,
23}:
24
25buildPythonPackage rec {
26 pname = "scikit-build";
27 version = "0.18.1";
28 pyproject = true;
29
30 disabled = pythonOlder "3.7";
31
32 src = fetchPypi {
33 pname = "scikit_build";
34 inherit version;
35 hash = "sha256-pBUqxaCE1JnCineXvgYo2DZsM24vsOGgY+sy5V78uOc=";
36 };
37
38 patches = [
39 (fetchpatch2 {
40 name = "setuptools-75.0-compat.patch";
41 url = "https://github.com/scikit-build/scikit-build/commit/3992485c67331097553ec8f54233c4c295943f70.patch";
42 hash = "sha256-U34UY+m6RE3c3UN/jGHuR+sRUqTGmG7dT52NWCY7nIE=";
43 })
44
45 # <https://github.com/scikit-build/scikit-build/pull/1160>
46 ./fix-cmake-4.patch
47 ];
48
49 # This line in the filterwarnings section of the pytest configuration leads to this error:
50 # E UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
51 postPatch = ''
52 sed -i "/'error',/d" pyproject.toml
53 '';
54
55 build-system = [
56 hatch-fancy-pypi-readme
57 hatch-vcs
58 hatchling
59 ];
60
61 dependencies = [
62 distro
63 packaging
64 setuptools
65 wheel
66 ]
67 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
68
69 nativeCheckInputs = [
70 cmake
71 cython
72 git
73 pytestCheckHook
74 pytest-mock
75 requests
76 virtualenv
77 ];
78
79 dontUseCmakeConfigure = true;
80
81 disabledTests = [
82 "test_hello_develop" # tries setuptools develop install
83 "test_source_distribution" # pip has no way to install missing dependencies
84 "test_wheel" # pip has no way to install missing dependencies
85 "test_fortran_compiler" # passes if gfortran is available
86 "test_install_command" # tries to alter out path
87 "test_test_command" # tries to alter out path
88 "test_setup" # tries to install using distutils
89 "test_pep518" # pip exits with code 1
90 "test_dual_pep518" # pip exits with code 1
91 "test_isolated_env_trigger_reconfigure" # Regex pattern 'exit skbuild saving cmake spec' does not match 'exit skbuild running make'.
92 "test_hello_wheel" # [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.9/setuptools/bdist.linux-x86_64/wheel/helloModule.py'
93 "test_hello_cython_sdist" # [Errno 2] No such file or directory: 'dist/hello-cython-1.2.3.tar.gz'
94 "test_hello_pure_sdist" # [Errno 2] No such file or directory: 'dist/hello-pure-1.2.3.tar.gz'
95 # sdist contents differ, contains additional setup.py
96 "test_hello_sdist"
97 "test_manifest_in_sdist"
98 "test_sdist_with_symlinks"
99 ];
100
101 meta = with lib; {
102 changelog = "https://github.com/scikit-build/scikit-build/blob/${version}/CHANGES.rst";
103 description = "Improved build system generator for CPython C/C++/Fortran/Cython extensions";
104 homepage = "https://github.com/scikit-build/scikit-build";
105 license = with licenses; [
106 mit
107 bsd2
108 ]; # BSD due to reuses of PyNE code
109 maintainers = with maintainers; [ FlorianFranzen ];
110 };
111}