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

65 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchPypi,
fetchpatch,
setuptools,
fields,
process-tests,
pytestCheckHook,
tornado,
}:
buildPythonPackage rec {
pname = "aspectlib";
version = "2.0.0";
disabled = pythonOlder "3.7";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-pLRhudoLUxrry5PvzePegIpyxgIm3Y2QLEZ9E/r3zpI=";
};
patches = [
# https://github.com/ionelmc/python-aspectlib/pull/25
(fetchpatch {
name = "darwin-compat.patch";
url = "https://github.com/ionelmc/python-aspectlib/commit/ef2c12304f08723dc8e79d1c59bc32c946d758dc.patch";
hash = "sha256-gtPFtwDsGIMkHTyuoiLk+SAGgB2Wyx/Si9HIdoIsvI8=";
})
];
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [ fields ];
pythonImportsCheck = [
"aspectlib"
"aspectlib.contrib"
"aspectlib.debug"
"aspectlib.test"
];
nativeCheckInputs = [
process-tests
pytestCheckHook
tornado
];
pytestFlags = [ "-Wignore::DeprecationWarning" ];
__darwinAllowLocalNetworking = true;
meta = {
changelog = "https://github.com/ionelmc/python-aspectlib/blob/v${version}/CHANGELOG.rst";
description = "Aspect-oriented programming, monkey-patch and decorators library";
homepage = "https://github.com/ionelmc/python-aspectlib";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ dotlambda ];
};
}