1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, hatch-fancy-pypi-readme
6, hatch-vcs
7, hatchling
8, distro
9, packaging
10, setuptools
11, wheel
12, tomli
13 # Test Inputs
14, cmake
15, cython
16, git
17, path
18, pytestCheckHook
19, pytest-mock
20, requests
21, virtualenv
22}:
23
24buildPythonPackage rec {
25 pname = "scikit-build";
26 version = "0.17.6";
27 format = "pyproject";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchPypi {
32 pname = "scikit_build";
33 inherit version;
34 hash = "sha256-tRpRo2s3xCZQmUtQR5EvWbIuMhCyPjIfKHYR+e9uXJ0=";
35 };
36
37 # This line in the filterwarnings section of the pytest configuration leads to this error:
38 # 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.
39 postPatch = ''
40 sed -i "/'error',/d" pyproject.toml
41 '';
42
43 nativeBuildInputs = [
44 hatch-fancy-pypi-readme
45 hatch-vcs
46 hatchling
47 ];
48
49 propagatedBuildInputs = [
50 distro
51 packaging
52 setuptools
53 wheel
54 ] ++ lib.optionals (pythonOlder "3.11") [
55 tomli
56 ];
57
58 nativeCheckInputs = [
59 cmake
60 cython
61 git
62 pytestCheckHook
63 pytest-mock
64 requests
65 virtualenv
66 ];
67
68 dontUseCmakeConfigure = true;
69
70 disabledTests = [
71 "test_hello_develop" # tries setuptools develop install
72 "test_source_distribution" # pip has no way to install missing dependencies
73 "test_wheel" # pip has no way to install missing dependencies
74 "test_fortran_compiler" # passes if gfortran is available
75 "test_install_command" # tries to alter out path
76 "test_test_command" # tries to alter out path
77 "test_setup" # tries to install using distutils
78 "test_pep518" # pip exits with code 1
79 "test_dual_pep518" # pip exits with code 1
80 "test_isolated_env_trigger_reconfigure" # Regex pattern 'exit skbuild saving cmake spec' does not match 'exit skbuild running make'.
81 "test_hello_wheel" # [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.9/setuptools/bdist.linux-x86_64/wheel/helloModule.py'
82 # sdist contents differ, contains additional setup.py
83 "test_hello_sdist"
84 "test_manifest_in_sdist"
85 "test_sdist_with_symlinks"
86 ];
87
88 meta = with lib; {
89 changelog = "https://github.com/scikit-build/scikit-build/blob/${version}/CHANGES.rst";
90 description = "Improved build system generator for CPython C/C++/Fortran/Cython extensions";
91 homepage = "https://github.com/scikit-build/scikit-build";
92 license = with licenses; [ mit bsd2 ]; # BSD due to reuses of PyNE code
93 maintainers = with maintainers; [ FlorianFranzen ];
94 };
95}