2024-06-05 15:53:02 +00:00
{
lib ,
buildPythonPackage ,
pythonOlder ,
fetchPypi ,
fetchpatch2 ,
hatch-fancy-pypi-readme ,
hatch-vcs ,
hatchling ,
distro ,
packaging ,
setuptools ,
wheel ,
tomli ,
2022-04-27 09:35:20 +00:00
# Test Inputs
2024-06-05 15:53:02 +00:00
cmake ,
cython ,
git ,
pytestCheckHook ,
pytest-mock ,
requests ,
virtualenv ,
2020-04-24 23:36:52 +00:00
} :
buildPythonPackage rec {
pname = " s c i k i t - b u i l d " ;
2023-08-10 07:59:29 +00:00
version = " 0 . 1 7 . 6 " ;
2022-04-27 09:35:20 +00:00
format = " p y p r o j e c t " ;
2020-04-24 23:36:52 +00:00
2023-08-10 07:59:29 +00:00
disabled = pythonOlder " 3 . 7 " ;
2020-04-24 23:36:52 +00:00
src = fetchPypi {
2023-08-10 07:59:29 +00:00
pname = " s c i k i t _ b u i l d " ;
inherit version ;
hash = " s h a 2 5 6 - t R p R o 2 s 3 x C Z Q m U t Q R 5 E v W b I u M h C y P j I f K H Y R + e 9 u X J 0 = " ;
2020-04-24 23:36:52 +00:00
} ;
2024-01-13 08:15:51 +00:00
patches = [
# https://github.com/scikit-build/scikit-build/pull/1032
# https://github.com/scikit-build/scikit-build/issues/1047
./python312-compatibility.patch
2024-04-21 15:54:59 +00:00
( fetchpatch2 {
# https://github.com/scikit-build/scikit-build/pull/1073
name = " s k b u i l d - s u p p r e s s - p e r m i s s i o n e r r o r . p a t c h " ;
url = " h t t p s : / / g i t h u b . c o m / s c i k i t - b u i l d / s c i k i t - b u i l d / c o m m i t / 4 1 1 8 3 4 1 3 e 4 f 5 e f 2 9 c f 3 d 2 1 e 4 7 0 a 2 c f a 2 3 0 5 7 3 3 f 8 . p a t c h " ;
hash = " s h a 2 5 6 - M 5 S b t 4 C B u i A e G g N 0 D / t o g l V i 1 V 2 G l A 9 h P I O M z c q O w d o = " ;
} )
2024-01-13 08:15:51 +00:00
] ;
2023-01-20 10:41:00 +00:00
# This line in the filterwarnings section of the pytest configuration leads to this error:
# 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.
postPatch = ''
sed - i " / ' e r r o r ' , / d " pyproject . toml
'' ;
2023-08-10 07:59:29 +00:00
nativeBuildInputs = [
hatch-fancy-pypi-readme
hatch-vcs
hatchling
] ;
2020-04-24 23:36:52 +00:00
propagatedBuildInputs = [
distro
packaging
setuptools
wheel
2024-06-05 15:53:02 +00:00
] ++ lib . optionals ( pythonOlder " 3 . 1 1 " ) [ tomli ] ;
2022-04-27 09:35:20 +00:00
2023-02-02 18:25:31 +00:00
nativeCheckInputs = [
2020-04-24 23:36:52 +00:00
cmake
cython
2023-08-10 07:59:29 +00:00
git
2022-04-27 09:35:20 +00:00
pytestCheckHook
2020-04-24 23:36:52 +00:00
pytest-mock
requests
virtualenv
] ;
dontUseCmakeConfigure = true ;
2022-04-27 09:35:20 +00:00
disabledTests = [
2020-04-24 23:36:52 +00:00
" t e s t _ h e l l o _ d e v e l o p " # tries setuptools develop install
" t e s t _ s o u r c e _ d i s t r i b u t i o n " # pip has no way to install missing dependencies
" t e s t _ w h e e l " # pip has no way to install missing dependencies
" t e s t _ f o r t r a n _ c o m p i l e r " # passes if gfortran is available
" t e s t _ i n s t a l l _ c o m m a n d " # tries to alter out path
" t e s t _ t e s t _ c o m m a n d " # tries to alter out path
2020-08-20 17:08:02 +00:00
" t e s t _ s e t u p " # tries to install using distutils
2022-04-15 01:41:22 +00:00
" t e s t _ p e p 5 1 8 " # pip exits with code 1
" t e s t _ d u a l _ p e p 5 1 8 " # pip exits with code 1
2022-04-27 09:35:20 +00:00
" t e s t _ i s o l a t e d _ e n v _ t r i g g e r _ r e c o n f i g u r e " # Regex pattern 'exit skbuild saving cmake spec' does not match 'exit skbuild running make'.
" t e s t _ h e l l o _ w h e e l " # [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.9/setuptools/bdist.linux-x86_64/wheel/helloModule.py'
2024-05-15 15:35:15 +00:00
" t e s t _ h e l l o _ c y t h o n _ s d i s t " # [Errno 2] No such file or directory: 'dist/hello-cython-1.2.3.tar.gz'
" t e s t _ h e l l o _ p u r e _ s d i s t " # [Errno 2] No such file or directory: 'dist/hello-pure-1.2.3.tar.gz'
2022-04-27 09:35:20 +00:00
# sdist contents differ, contains additional setup.py
" t e s t _ h e l l o _ s d i s t "
" t e s t _ m a n i f e s t _ i n _ s d i s t "
" t e s t _ s d i s t _ w i t h _ s y m l i n k s "
] ;
2020-04-24 23:36:52 +00:00
meta = with lib ; {
2023-08-10 07:59:29 +00:00
changelog = " h t t p s : / / g i t h u b . c o m / s c i k i t - b u i l d / s c i k i t - b u i l d / b l o b / ${ version } / C H A N G E S . r s t " ;
2020-04-24 23:36:52 +00:00
description = " I m p r o v e d b u i l d s y s t e m g e n e r a t o r f o r C P y t h o n C / C + + / F o r t r a n / C y t h o n e x t e n s i o n s " ;
2022-04-27 09:35:20 +00:00
homepage = " h t t p s : / / g i t h u b . c o m / s c i k i t - b u i l d / s c i k i t - b u i l d " ;
2024-06-05 15:53:02 +00:00
license = with licenses ; [
mit
bsd2
] ; # BSD due to reuses of PyNE code
2020-04-24 23:36:52 +00:00
maintainers = with maintainers ; [ FlorianFranzen ] ;
} ;
}