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

100 lines
1.8 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# nativeBuildInputs
nodejs,
yarn-berry_3,
distutils,
# build-system
hatch-jupyter-builder,
hatchling,
jupyterlab,
# dependencies
jupyter-server,
jupyterlab-server,
notebook-shim,
tornado,
# tests
pytest-jupyter,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "notebook";
version = "7.4.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jupyter";
repo = "notebook";
tag = "v${version}";
hash = "sha256-Xz9EZgYNJjWsN7tcTmwXLwH9VW7GnI0P/oNT0IFpkoE=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "timeout = 300" ""
'';
nativeBuildInputs =
[
nodejs
yarn-berry_3.yarnBerryConfigHook
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
distutils
];
missingHashes = ./missing-hashes.json;
offlineCache = yarn-berry_3.fetchYarnBerryDeps {
inherit src missingHashes;
hash = "sha256-IFLAwEFsI/GL26XAfiLDyW1mG72gcN2TH651x8Nbrtw=";
};
build-system = [
hatch-jupyter-builder
hatchling
jupyterlab
];
dependencies = [
jupyter-server
jupyterlab
jupyterlab-server
notebook-shim
tornado
];
nativeCheckInputs = [
pytest-jupyter
pytestCheckHook
];
pytestFlags = [
"-Wignore::DeprecationWarning"
];
env = {
JUPYTER_PLATFORM_DIRS = 1;
};
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;
meta = {
changelog = "https://github.com/jupyter/notebook/blob/v${version}/CHANGELOG.md";
description = "Web-based notebook environment for interactive computing";
homepage = "https://github.com/jupyter/notebook";
license = lib.licenses.bsd3;
teams = [ lib.teams.jupyter ];
mainProgram = "jupyter-notebook";
};
}