diff --git a/pkgs/development/python-modules/astroquery/default.nix b/pkgs/development/python-modules/astroquery/default.nix index 8853b1e9e08d..a022c80b16b9 100644 --- a/pkgs/development/python-modules/astroquery/default.nix +++ b/pkgs/development/python-modules/astroquery/default.nix @@ -6,8 +6,12 @@ , keyring , beautifulsoup4 , html5lib +, matplotlib +, pillow , pytest , pytest-astropy +, pytestCheckHook +, pyvo , astropy-helpers , isPy3k }: @@ -24,21 +28,39 @@ buildPythonPackage rec { disabled = !isPy3k; - propagatedBuildInputs = [ astropy requests keyring beautifulsoup4 html5lib ]; + propagatedBuildInputs = [ + astropy + requests + keyring + beautifulsoup4 + html5lib + pyvo + ]; nativeBuildInputs = [ astropy-helpers ]; - # Tests disabled until pytest-astropy has been updated to include pytest-astropy-header - doCheck = false; - checkInputs = [ pytest pytest-astropy ]; + # Disable automatic update of the astropy-helper module + postPatch = '' + substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" + ''; + + checkInputs = [ + matplotlib + pillow + pytest + pytest-astropy + pytestCheckHook + ]; # Tests must be run in the build directory. The tests create files # in $HOME/.astropy so we need to set HOME to $TMPDIR. - checkPhase = '' + preCheck = '' + export HOME=$TMPDIR cd build/lib - HOME=$TMPDIR pytest ''; + pythonImportsCheck = [ "astroquery" ]; + meta = with pkgs.lib; { description = "Functions and classes to access online data resources"; homepage = "https://astroquery.readthedocs.io/"; diff --git a/pkgs/development/python-modules/pyvo/default.nix b/pkgs/development/python-modules/pyvo/default.nix new file mode 100644 index 000000000000..715cf0196aa4 --- /dev/null +++ b/pkgs/development/python-modules/pyvo/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchPypi +, astropy +, pillow +, pythonOlder +, pytestCheckHook +, pytest-astropy +, requests +, requests-mock +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "pyvo"; + version = "1.3"; + + disabled = pythonOlder "3.8"; # according to setup.cfg + + src = fetchPypi { + inherit pname version; + sha256 = "846a54a05a8ddb47a8c2cc3077434779b0e4ccc1b74a7a5408593cb673307d67"; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + astropy + requests + ]; + + checkInputs = [ + pillow + pytestCheckHook + pytest-astropy + requests-mock + ]; + + disabledTestPaths = [ + # touches network + "pyvo/dal/tests/test_datalink.py" + ]; + + pythonImportsCheck = [ "pyvo" ]; + + meta = with lib; { + description = "Astropy affiliated package for accessing Virtual Observatory data and services"; + homepage = "github.com/astropy/pyvo"; + license = licenses.bsd3; + maintainers = with maintainers; [ smaret ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cb7e2a3de3e7..33ae59a8f0cb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8492,6 +8492,8 @@ in { pyvmomi = callPackage ../development/python-modules/pyvmomi { }; + pyvo = callPackage ../development/python-modules/pyvo { }; + pyvolumio = callPackage ../development/python-modules/pyvolumio { }; pyvoro = callPackage ../development/python-modules/pyvoro { };