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

86 lines
1.6 KiB
Nix

{
pkgs,
buildPythonPackage,
fetchPypi,
astropy,
requests,
keyring,
beautifulsoup4,
html5lib,
matplotlib,
pillow,
pytest,
pytest-astropy,
pytest-dependency,
pytest-rerunfailures,
pytestCheckHook,
pyvo,
astropy-helpers,
setuptools,
isPy3k,
}:
buildPythonPackage rec {
pname = "astroquery";
version = "0.4.10";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-6s2R6do3jmQXQPvDEjhQ2qg7oJJqb/9MQMy/XcbVpAY=";
};
disabled = !isPy3k;
propagatedBuildInputs = [
astropy
requests
keyring
beautifulsoup4
html5lib
pyvo
];
nativeBuildInputs = [
astropy-helpers
setuptools
];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
nativeCheckInputs = [ pytestCheckHook ];
checkInputs = [
matplotlib
pillow
pytest
pytest-astropy
pytest-dependency
pytest-rerunfailures
];
pytestFlags = [
# DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
"-Wignore::DeprecationWarning"
];
# Tests must be run in the build directory. The tests create files
# in $HOME/.astropy so we need to set HOME to $TMPDIR.
preCheck = ''
export HOME=$TMPDIR
cd build/lib
'';
pythonImportsCheck = [ "astroquery" ];
meta = with pkgs.lib; {
description = "Functions and classes to access online data resources";
homepage = "https://astroquery.readthedocs.io/";
license = licenses.bsd3;
maintainers = [ maintainers.smaret ];
};
}