nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 src = fetchPypi {
31 pname = "scikit_build";
32 inherit version;
33 hash = "sha256-pBUqxaCE1JnCineXvgYo2DZsM24vsOGgY+sy5V78uOc=";
34 };
35
36 patches = [
37 (fetchpatch2 {
38 name = "setuptools-75.0-compat.patch";
39 url = "https://github.com/scikit-build/scikit-build/commit/3992485c67331097553ec8f54233c4c295943f70.patch";
40 hash = "sha256-U34UY+m6RE3c3UN/jGHuR+sRUqTGmG7dT52NWCY7nIE=";
41 })
42
43 # <https://github.com/scikit-build/scikit-build/pull/1160>
44 ./fix-cmake-4.patch
45 ];
46
47 # This line in the filterwarnings section of the pytest configuration leads to this error:
48 # 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.
49 postPatch = ''
50 sed -i "/'error',/d" pyproject.toml
51 '';
52
53 build-system = [
54 hatch-fancy-pypi-readme
55 hatch-vcs
56 hatchling
57 ];
58
59 dependencies = [
60 distro
61 packaging
62 setuptools
63 wheel
64 ]
65 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
66
67 nativeCheckInputs = [
68 cmake
69 cython
70 git
71 pytestCheckHook
72 pytest-mock
73 requests
74 virtualenv
75 ];
76
77 dontUseCmakeConfigure = true;
78
79 disabledTests = [
80 "test_hello_develop" # tries setuptools develop install
81 "test_source_distribution" # pip has no way to install missing dependencies
82 "test_wheel" # pip has no way to install missing dependencies
83 "test_fortran_compiler" # passes if gfortran is available
84 "test_install_command" # tries to alter out path
85 "test_test_command" # tries to alter out path
86 "test_setup" # tries to install using distutils
87 "test_pep518" # pip exits with code 1
88 "test_dual_pep518" # pip exits with code 1
89 "test_isolated_env_trigger_reconfigure" # Regex pattern 'exit skbuild saving cmake spec' does not match 'exit skbuild running make'.
90 "test_hello_wheel" # [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.9/setuptools/bdist.linux-x86_64/wheel/helloModule.py'
91 "test_hello_cython_sdist" # [Errno 2] No such file or directory: 'dist/hello-cython-1.2.3.tar.gz'
92 "test_hello_pure_sdist" # [Errno 2] No such file or directory: 'dist/hello-pure-1.2.3.tar.gz'
93 # sdist contents differ, contains additional setup.py
94 "test_hello_sdist"
95 "test_manifest_in_sdist"
96 "test_sdist_with_symlinks"
97 ];
98
99 meta = {
100 changelog = "https://github.com/scikit-build/scikit-build/blob/${version}/CHANGES.rst";
101 description = "Improved build system generator for CPython C/C++/Fortran/Cython extensions";
102 homepage = "https://github.com/scikit-build/scikit-build";
103 license = with lib.licenses; [
104 mit
105 bsd2
106 ]; # BSD due to reuses of PyNE code
107 maintainers = with lib.maintainers; [ FlorianFranzen ];
108 };
109}