2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-04-15 01:41:22 +00:00
|
|
|
, asdf-standard
|
|
|
|
, asdf-transform-schemas
|
2021-03-23 19:22:30 +00:00
|
|
|
, astropy
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-11-02 22:02:43 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2021-07-14 22:03:04 +00:00
|
|
|
, importlib-resources
|
|
|
|
, jmespath
|
2020-04-24 23:36:52 +00:00
|
|
|
, jsonschema
|
2022-04-15 01:41:22 +00:00
|
|
|
, lz4
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2021-03-23 19:22:30 +00:00
|
|
|
, packaging
|
|
|
|
, pytest-astropy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
|
|
|
, semantic-version
|
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "asdf";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "2.13.0";
|
2021-01-05 17:05:55 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "asdf-format/";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-u8e7ot5NDRqQFH0eLVnGinBQmQD73BlR5K9HVjA7SIg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fix default validation, https://github.com/asdf-format/asdf/pull/1203
|
|
|
|
(fetchpatch {
|
|
|
|
name = "default-validation.patch";
|
|
|
|
url = "https://github.com/asdf-format/asdf/commit/6f79f620b4632e20178d9bd53528702605d3e976.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-h/dYhXRCf5oIIC+u6+8C91mJnmEzuNmlEzqc0UEhLy0=";
|
2022-11-02 22:02:43 +00:00
|
|
|
excludes = [
|
|
|
|
"CHANGES.rst"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/asdf-format/asdf/pull/1203
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "'jsonschema >=4.0.1, <4.10.0'," "'jsonschema >=4.0.1',"
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
asdf-standard
|
|
|
|
asdf-transform-schemas
|
2021-07-14 22:03:04 +00:00
|
|
|
jmespath
|
2020-04-24 23:36:52 +00:00
|
|
|
jsonschema
|
|
|
|
numpy
|
2021-03-23 19:22:30 +00:00
|
|
|
packaging
|
|
|
|
pyyaml
|
|
|
|
semantic-version
|
2021-07-14 22:03:04 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
importlib-resources
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-23 19:22:30 +00:00
|
|
|
astropy
|
2022-04-15 01:41:22 +00:00
|
|
|
lz4
|
|
|
|
pytest-astropy
|
2021-03-23 19:22:30 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export PY_IGNORE_IMPORTMISMATCH=1
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"asdf"
|
|
|
|
];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
disabledTests = [
|
|
|
|
"config.rst"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python tools to handle ASDF files";
|
2022-04-15 01:41:22 +00:00
|
|
|
homepage = "https://github.com/asdf-format/asdf";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|