Yueh-Shun Li 76e2a397c2 treewide: pytestFlagsArray -> pytestFlags and join flag and option argument
This treewide change targets Python packages
that specifies pytest flags with pytestFlagsArray,
and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.

Use the __structuredAttrs-agnostic argument pytestFlags
instead of the deprecated pytestFlagsArray.

For flags with option arguments,
join each flag and their option argument into a single command-line argument
following POSIX Utility Argument Syntax[1]
for easier overriding (remove/replace).

Examples:

* [ "-W" "ignore:message:WarningClass" ] ->
  [ "-Wignore:message:WarningClass" ]

* [ "--reruns" "3" ] ->
  [ "--reruns=3" ]

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
2025-06-16 01:02:16 +08:00

75 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
fetchpatch,
deprecation,
hatchling,
pythonOlder,
packaging,
pytestCheckHook,
pytest-timeout,
setuptools,
tomlkit,
}:
buildPythonPackage rec {
pname = "jupyter-packaging";
version = "0.12.3";
disabled = pythonOlder "3.7";
format = "pyproject";
src = fetchPypi {
pname = "jupyter_packaging";
inherit version;
hash = "sha256-nZsrY7l//WeovFORwypCG8QVsmSjLJnk2NjdMdqunPQ=";
};
patches = [
(fetchpatch {
name = "setuptools-68-test-compatibility.patch";
url = "https://github.com/jupyter/jupyter-packaging/commit/e963fb27aa3b58cd70c5ca61ebe68c222d803b7e.patch";
hash = "sha256-NlO07wBCutAJ1DgoT+rQFkuC9Y+DyF1YFlTwWpwsJzo=";
})
];
nativeBuildInputs = [ hatchling ];
propagatedBuildInputs = [
deprecation
packaging
setuptools
tomlkit
];
nativeCheckInputs = [
pytestCheckHook
pytest-timeout
];
pytestFlags = [ "-Wignore::DeprecationWarning" ];
preCheck = ''
export HOME=$(mktemp -d)
'';
disabledTests = [
# disable tests depending on network connection
"test_develop"
"test_install"
# Avoid unmaintained "mocker" fixture library, and calls to dependent "build" module
"test_build"
"test_npm_build"
"test_create_cmdclass"
"test_ensure_with_skip_npm"
];
pythonImportsCheck = [ "jupyter_packaging" ];
meta = with lib; {
description = "Jupyter Packaging Utilities";
homepage = "https://github.com/jupyter/jupyter-packaging";
license = licenses.bsd3;
};
}