Merge staging-next into staging

This commit is contained in:
Frederik Rietdijk
2019-07-28 09:10:03 +02:00
86 changed files with 1431 additions and 595 deletions

View File

@@ -11,14 +11,14 @@
, pillow
, scikitimage
, shapely
, pytest
, pytest-astropy
}:
buildPythonPackage rec {
pname = "aplpy";
version = "2.0.3";
doCheck = false; # tests require pytest-astropy
src = fetchPypi {
pname = "APLpy";
inherit version;
@@ -28,7 +28,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [
numpy
astropy
astropy-helpers
matplotlib
reproject
pyavm
@@ -38,11 +37,21 @@ buildPythonPackage rec {
shapely
];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
# Tests must be run in the build directory
checkPhase = ''
cd build/lib
pytest
'';
meta = with lib; {
description = "The Astronomical Plotting Library in Python";
homepage = http://aplpy.github.io;

View File

@@ -3,7 +3,10 @@
, buildPythonPackage
, isPy3k
, numpy
, pytest }:
, pytest
, pytest-astropy
, astropy-helpers
}:
buildPythonPackage rec {
pname = "astropy";
@@ -11,14 +14,30 @@ buildPythonPackage rec {
disabled = !isPy3k; # according to setup.py
doCheck = false; #Some tests are failing. More importantly setup.py hangs on completion. Needs fixing with a proper shellhook.
src = fetchPypi {
inherit pname version;
sha256 = "706c0457789c78285e5464a5a336f5f0b058d646d60f4e5f5ba1f7d5bf424b28";
};
propagatedBuildInputs = [ pytest numpy ]; # yes it really has pytest in install_requires
nativeBuildInputs = [ astropy-helpers ];
propagatedBuildInputs = [ numpy pytest ]; # yes it really has pytest in install_requires
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
# Tests must be run from the build directory. astropy/samp tests
# require a network connection, so we ignore them. For some reason
# pytest --ignore does not work, so we delete the tests instead.
checkPhase = ''
cd build/lib.*
rm -f astropy/samp/tests/*
pytest
'';
meta = {
description = "Astronomy/Astrophysics library for Python";

View File

@@ -0,0 +1,54 @@
diff -ruN astroquery-0.3.9.orig/astroquery/conftest.py astroquery-0.3.9/astroquery/conftest.py
--- astroquery-0.3.9.orig/astroquery/conftest.py 2018-11-27 14:51:16.000000000 +0100
+++ astroquery-0.3.9/astroquery/conftest.py 2019-07-23 18:19:17.000000000 +0200
@@ -5,15 +5,20 @@
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
-from astropy.tests.pytest_plugins import (PYTEST_HEADER_MODULES,
- enable_deprecations_as_exceptions,
- TESTED_VERSIONS)
+from astropy.version import version as astropy_version
-try:
- packagename = os.path.basename(os.path.dirname(__file__))
- TESTED_VERSIONS[packagename] = version.version
-except NameError:
- pass
+if astropy_version < '3.0':
+ # With older versions of Astropy, we actually need to import the pytest
+ # plugins themselves in order to make them discoverable by pytest.
+ from astropy.tests.pytest_plugins import *
+else:
+ # As of Astropy 3.0, the pytest plugins provided by Astropy are
+ # automatically made available when Astropy is installed. This means it's
+ # not necessary to import them here, but we still need to import global
+ # variables that are used for configuration.
+ from astropy.tests.plugins.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS
+
+from astropy.tests.helper import enable_deprecations_as_exceptions
# Add astropy to test header information and remove unused packages.
# Pytest header customisation was introduced in astropy 1.0.
@@ -36,12 +41,17 @@
# The warnings_to_ignore_by_pyver parameter was added in astropy 2.0
enable_deprecations_as_exceptions(modules_to_ignore_on_import=['requests'])
+# add '_testrun' to the version name so that the user-agent indicates that
+# it's being run in a test
+from . import version
+version.version += '_testrun'
+
+
# This is to figure out the affiliated package version, rather than
# using Astropy's
-try:
- from .version import version
-except ImportError:
- version = 'dev'
+from .version import version, astropy_helpers_version
+
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version
+TESTED_VERSIONS['astropy_helpers'] = astropy_helpers_version

View File

@@ -6,21 +6,42 @@
, keyring
, beautifulsoup4
, html5lib
, pytest
, pytest-astropy
, astropy-helpers
}:
buildPythonPackage rec {
pname = "astroquery";
version = "0.3.9";
doCheck = false; # Tests require the pytest-astropy package
src = fetchPypi {
inherit pname version;
sha256 = "0zw3xp2rfc6h2v569iqsyvzhfnzp7bfjb7jrj61is1hrqw1cqjrb";
};
# Fix tests using conftest.py from HEAD in the upstream GitHub
# repository.
patches = [ ./conftest-astropy-3-fix.patch ];
propagatedBuildInputs = [ astropy requests keyring beautifulsoup4 html5lib ];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
# Tests must be run in the build directory. The tests create files
# in $HOME/.astropy so we need to set HOME to $TMPDIR.
checkPhase = ''
cd build/lib
HOME=$TMPDIR pytest
'';
meta = with pkgs.lib; {
description = "Functions and classes to access online data resources";
homepage = "https://astroquery.readthedocs.io/";

View File

@@ -0,0 +1,40 @@
{ lib
, buildPythonPackage
, fetchPypi
, uvicorn
, starlette
, pydantic
, python
, isPy3k
, which
}:
buildPythonPackage rec {
pname = "fastapi";
version = "0.33.0";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1mc8ljfk6xyn2cq725s8hgapp62z5mylzw9akvkhwwz3bh8m5a7f";
};
propagatedBuildInputs = [
uvicorn
starlette
pydantic
];
patches = [ ./setup.py.patch ];
checkPhase = ''
${python.interpreter} -c "from fastapi import FastAPI; app = FastAPI()"
'';
meta = with lib; {
homepage = "https://github.com/tiangolo/fastapi";
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production";
license = licenses.mit;
maintainers = with maintainers; [ wd15 ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index ccc3d2b..77ce446 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ package_data = \
{'': ['*']}
install_requires = \
-['starlette >=0.11.1,<=0.12.0', 'pydantic >=0.30,<=0.30.0']
+['starlette >=0.11.1', 'pydantic >=0.30']
extras_require = \
{'all': ['requests',

View File

@@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchPypi
, ujson
, email_validator
, typing-extensions
, python
, isPy3k
}:
buildPythonPackage rec {
pname = "pydantic";
version = "0.31";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "0x9xc5hpyrlf05dc4bx9f7v51fahxcahkvh0ij8ibay15nwli53d";
};
propagatedBuildInputs = [
ujson
email_validator
typing-extensions
];
checkPhase = ''
${python.interpreter} -c """
from datetime import datetime
from typing import List
from pydantic import BaseModel
class User(BaseModel):
id: int
name = 'John Doe'
signup_ts: datetime = None
friends: List[int] = []
external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
assert user.id is "123"
"""
'';
meta = with lib; {
homepage = "https://github.com/samuelcolvin/pydantic";
description = "Data validation and settings management using Python type hinting";
license = licenses.mit;
maintainers = with maintainers; [ wd15 ];
};
}

View File

@@ -1,18 +1,20 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, pyparsing
, numpy
, cython
, astropy
, astropy-helpers
, pytest
, pytest-astropy
}:
buildPythonPackage rec {
pname = "pyregion";
version = "2.0";
doCheck = false; # tests require pytest-astropy
src = fetchPypi {
inherit pname version;
sha256 = "a8ac5f764b53ec332f6bc43f6f2193ca13e8b7d5a3fb2e20ced6b2ea42a9d094";
@@ -25,6 +27,30 @@ buildPythonPackage rec {
astropy
];
# Upstream patch needed for the test to pass
patches = [
(fetchpatch {
name = "conftest-astropy-3-fix.patch";
url = "https://github.com/astropy/pyregion/pull/136.patch";
sha256 = "13yxjxiqnhjy9gh24hvv6pnwx7qic2mcx3ccr1igjrc3f881d59m";
})
];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
# Tests must be run in the build directory
checkPhase = ''
cd build/lib.*
pytest
'';
meta = with lib; {
description = "Python parser for ds9 region files";
homepage = https://github.com/astropy/pyregion;

View File

@@ -22,14 +22,10 @@ buildPythonPackage rec {
pytest
];
checkInputs = [
pytest
astropy
];
checkPhase = ''
pytest
'';
# The tests requires astropy, which itself requires
# pytest-arraydiff. This causes an infinite recursion if the tests
# are enabled.
doCheck = false;
meta = with lib; {
description = "Pytest plugin to help with comparing array output from tests";

View File

@@ -1,14 +1,17 @@
{ lib
, fetchPypi
, buildPythonPackage
, astropy }:
, astropy
, pytest
, pytest-astropy
, astropy-helpers
, scipy
}:
buildPythonPackage rec {
pname = "radio_beam";
version = "0.3.1";
doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
src = fetchPypi {
inherit pname version;
sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb";
@@ -16,6 +19,21 @@ buildPythonPackage rec {
propagatedBuildInputs = [ astropy ];
nativeBuildInputs = [ astropy-helpers ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
checkInputs = [ pytest pytest-astropy scipy ];
# Tests must be run in the build directory
checkPhase = ''
cd build/lib
pytest
'';
meta = {
description = "Tools for Beam IO and Manipulation";
homepage = http://radio-astro-tools.github.io;

View File

@@ -0,0 +1,24 @@
{ stdenv, fetchPypi, buildPythonPackage, click, redis }:
buildPythonPackage rec {
pname = "rq";
version = "1.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "1fs03g1n1l8k03zwhkhckhsrnnsm3645sqby2nwh5gfij2kcc9sg";
};
# test require a running redis rerver, which is something we can't do yet
doCheck = false;
propagatedBuildInputs = [ click redis ];
meta = with stdenv.lib; {
description = "A simple, lightweight library for creating background jobs, and processing them";
homepage = "https://github.com/nvie/rq/";
maintainers = with maintainers; [ mrmebelman ];
license = licenses.bsd2;
};
}

View File

@@ -0,0 +1,51 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, requests
, pyopenssl
, cryptography
, idna
, mock
, isPy27
, nose
, pytz
, responses
}:
buildPythonPackage rec {
pname = "simple-salesforce";
version = "0.74.3";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "1n960xgrnmv20l31nm0im7pb4nfa83bmx4x4clqrh2jkpzq3ric0";
};
propagatedBuildInputs = [
requests
pyopenssl
cryptography
idna
];
checkInputs = [
nose
pytz
responses
] ++ lib.optionals isPy27 [ mock ];
postPatch = ''
substituteInPlace setup.py \
--replace "mock==1.0.1" "mock"
'';
meta = with lib; {
description = "A very simple Salesforce.com REST API client for Python";
homepage = https://github.com/simple-salesforce/simple-salesforce;
license = licenses.asl20;
maintainers = with maintainers; [ costrouc ];
};
}

View File

@@ -3,20 +3,36 @@
, buildPythonPackage
, astropy
, radio_beam
, pytest }:
, pytest
, pytest-astropy
, astropy-helpers
}:
buildPythonPackage rec {
pname = "spectral-cube";
version = "0.4.4";
doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
src = fetchPypi {
inherit pname version;
sha256 = "9051ede204b1e25b6358b5e0e573b624ec0e208c24eb03a7ed4925b745c93b5e";
};
propagatedBuildInputs = [ astropy radio_beam pytest ];
propagatedBuildInputs = [ astropy radio_beam ];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
# Tests must be run in the build directory
checkPhase = ''
cd build/lib
pytest
'';
meta = {
description = "Library for reading and analyzing astrophysical spectral data cubes";

View File

@@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchPypi
, aiofiles
, graphene
, itsdangerous
, jinja2
, pyyaml
, requests
, ujson
, pytest
, python
, uvicorn
, isPy27
}:
buildPythonPackage rec {
pname = "starlette";
version = "0.12.4";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "1m7qf4g5dn7n36406zbqsag71nmwp2dz91yxpplm7h7wiw2xxw93";
};
propagatedBuildInputs = [
aiofiles
graphene
itsdangerous
jinja2
pyyaml
requests
ujson
uvicorn
];
checkPhase = ''
${python.interpreter} -c """
from starlette.applications import Starlette
app = Starlette(debug=True)
"""
'';
meta = with lib; {
homepage = https://www.starlette.io/;
description = "The little ASGI framework that shines";
license = licenses.bsd3;
maintainers = with maintainers; [ wd15 ];
};
}

View File

@@ -0,0 +1,44 @@
{ lib
, buildPythonPackage
, fetchPypi
, click
, h11
, httptools
, uvloop
, websockets
, wsproto
, isPy27
}:
buildPythonPackage rec {
pname = "uvicorn";
version = "0.8.4";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "1l8rfm30inx9pma893i7sby9h7y910k58841zqaajksn563b882k";
};
propagatedBuildInputs = [
click
h11
httptools
uvloop
websockets
wsproto
];
checkPhase = ''
$out/bin/uvicorn --help
'';
patches = [ ./setup.patch ];
meta = with lib; {
homepage = https://www.uvicorn.org/;
description = "The lightning-fast ASGI server";
license = licenses.bsd3;
maintainers = with maintainers; [ wd15 ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index 802cda4..561abf4 100755
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ env_marker = (
requirements = [
"click==7.*",
- "h11==0.8.*",
+ "h11",
"websockets==7.*",
"httptools==0.0.13 ;" + env_marker,
"uvloop==0.12.* ;" + env_marker,