nixpkgs/pkgs/development/python-modules/asdf/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
1.9 KiB
Nix
Raw Normal View History

2019-07-15 16:17:51 +00:00
{ lib
2022-04-09 20:47:52 +00:00
, asdf-standard
, asdf-transform-schemas
, astropy
2019-07-15 16:17:51 +00:00
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
2021-07-04 22:30:14 +00:00
, importlib-resources
, jmespath
2019-07-15 16:17:51 +00:00
, jsonschema
2022-04-09 20:47:52 +00:00
, lz4
2019-07-15 16:17:51 +00:00
, numpy
, packaging
, pytest-astropy
, pytestCheckHook
, pythonOlder
, pyyaml
, semantic-version
, setuptools-scm
2019-07-15 16:17:51 +00:00
}:
buildPythonPackage rec {
pname = "asdf";
version = "2.13.0";
2020-12-28 18:33:33 +00:00
format = "pyproject";
2019-07-15 16:17:51 +00:00
disabled = pythonOlder "3.8";
2022-04-09 20:47:52 +00:00
src = fetchFromGitHub {
owner = "asdf-format/";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-u8e7ot5NDRqQFH0eLVnGinBQmQD73BlR5K9HVjA7SIg=";
2019-07-15 16:17:51 +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";
hash = "sha256-h/dYhXRCf5oIIC+u6+8C91mJnmEzuNmlEzqc0UEhLy0=";
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-09 20:47:52 +00:00
nativeBuildInputs = [
setuptools-scm
];
2019-07-15 16:17:51 +00:00
propagatedBuildInputs = [
2022-04-09 20:47:52 +00:00
asdf-standard
asdf-transform-schemas
2021-07-04 22:30:14 +00:00
jmespath
2019-07-15 16:17:51 +00:00
jsonschema
numpy
packaging
pyyaml
semantic-version
2021-07-04 22:30:14 +00:00
] ++ lib.optionals (pythonOlder "3.9") [
importlib-resources
2019-07-15 16:17:51 +00:00
];
nativeCheckInputs = [
astropy
2022-04-09 20:47:52 +00:00
lz4
pytest-astropy
pytestCheckHook
];
preCheck = ''
export PY_IGNORE_IMPORTMISMATCH=1
2019-07-15 16:17:51 +00:00
'';
2022-04-09 20:47:52 +00:00
pythonImportsCheck = [
"asdf"
];
disabledTests = [
"config.rst"
];
2019-07-15 16:17:51 +00:00
meta = with lib; {
description = "Python tools to handle ASDF files";
2022-04-09 20:47:52 +00:00
homepage = "https://github.com/asdf-format/asdf";
2019-07-15 16:17:51 +00:00
license = licenses.bsd3;
maintainers = with maintainers; [ ];
2023-09-23 08:34:34 +00:00
# Many tests fail, according to Hydra
broken = true;
2019-07-15 16:17:51 +00:00
};
}