git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #100989 from risicle/ris-turion-cassandra-driver
commitba64d090c49bda7be3468abeb5421a97ca2c9a19 authorSandro <sandro.jaeckel@gmail.com> dateSun 31 Jan 2021, 21:21 (6 years ago) parent59b45d604a96e3
4 files changed+149−16
pkgs/development/python-modules/cassandra-driver/default.nix+54−16 pkgs/development/python-modules/geomet/default.nix+37 pkgs/development/python-modules/gremlinpython/default.nix+54 pkgs/top-level/python-packages.nix+4
pkgs/development/python-modules/cassandra-driver/default.nix+54−16
@@ -1,47 +1,85 @@
1−{ lib, buildPythonPackage, fetchPypi, python, pythonOlder
1+{ stdenv, lib, buildPythonPackage, fetchFromGitHub, python, pythonOlder
22, cython
33, eventlet
44, futures
5+, iana-etc
6+, geomet
57, libev
68, mock
79, nose
8−, pytest
10+, pytestCheckHook
911, pytz
1012, pyyaml
1113, scales
1214, six
1315, sure
16+, gremlinpython
17+, gevent
18+, twisted
19+, libredirect
1420}:
1521
1622buildPythonPackage rec {
1723 pname = "cassandra-driver";
1824 version = "3.24.0";
1925
20− src = fetchPypi {
21− inherit pname version;
22− sha256 = "83ec8d9a5827ee44bb1c0601a63696a8a9086beaf0151c8255556299246081bd";
26+ # pypi tarball doesn't include tests
27+ src = fetchFromGitHub {
28+ owner = "datastax";
29+ repo = "python-driver";
30+ rev = version;
31+ sha256 = "1rr69hly5q810xpn8rkzxwzlq55wxxp7kwki9vfri3gh674d2wip";
2332 };
2433
2534 nativeBuildInputs = [ cython ];
2635 buildInputs = [ libev ];
27− propagatedBuildInputs = [ six ]
36+ propagatedBuildInputs = [ six geomet ]
2837 ++ lib.optionals (pythonOlder "3.4") [ futures ];
2938
30− checkInputs = [ eventlet mock nose pytest pytz pyyaml sure ];
31−
32− # ignore test files which try to do socket.getprotocolname('tcp')
33− # as it fails in sandbox mode due to lack of a /etc/protocols file
34− checkPhase = ''
35− pytest tests/unit \
36− --ignore=tests/unit/io/test_libevreactor.py \
37− --ignore=tests/unit/io/test_eventletreactor.py \
38− --ignore=tests/unit/io/test_asyncorereactor.py
39+ # Make /etc/protocols accessible to allow socket.getprotobyname('tcp') in sandbox,
40+ # also /etc/resolv.conf is referenced by some tests
41+ preCheck = (stdenv.lib.optionalString stdenv.isLinux ''
42+ echo "nameserver 127.0.0.1" > resolv.conf
43+ export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
44+ export LD_PRELOAD=${libredirect}/lib/libredirect.so
45+ '') + ''
46+ # increase tolerance for time-based test
47+ substituteInPlace tests/unit/io/utils.py --replace 'delta=.15' 'delta=.3'
48+ '';
49+ postCheck = ''
50+ unset NIX_REDIRECTS LD_PRELOAD
3951 '';
4052
53+ checkInputs = [
54+ pytestCheckHook
55+ eventlet
56+ mock
57+ nose
58+ pytz
59+ pyyaml
60+ sure
61+ scales
62+ gremlinpython
63+ gevent
64+ twisted
65+ ];
66+
67+ pytestFlagsArray = [
68+ "tests/unit"
69+ # requires puresasl
70+ "--ignore=tests/unit/advanced/test_auth.py"
71+ ];
72+ disabledTests = [
73+ # doesn't seem to be intended to be run directly
74+ "_PoolTests"
75+ # attempts to make connection to localhost
76+ "test_connection_initialization"
77+ ];
78+
4179 meta = with lib; {
4280 description = "A Python client driver for Apache Cassandra";
4381 homepage = "http://datastax.github.io/python-driver";
4482 license = licenses.asl20;
45− broken = true; # geomet doesn't exist
83+ maintainers = with maintainers; [ turion ris ];
4684 };
4785}
pkgs/development/python-modules/geomet/default.nixnew file+37
@@ -0,0 +1,37 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, fetchpatch
5+, click
6+, six
7+}:
8+
9+buildPythonPackage rec {
10+ pname = "geomet";
11+ version = "0.2.1";
12+
13+ # pypi tarball doesn't include tests
14+ src = fetchFromGitHub {
15+ owner = "geomet";
16+ repo = "geomet";
17+ rev = version;
18+ sha256 = "0fdi26glsmrsyqk86rnsfcqw79svn2b0ikdv89pq98ihrpwhn85y";
19+ };
20+
21+ patches = [
22+ (fetchpatch {
23+ name = "python-3.8-support.patch";
24+ url = "https://github.com/geomet/geomet/commit/dc4cb4a856d3ad814b57b4b7487d86d9e0f0fad4.patch";
25+ sha256 = "1f1cdfqyp3z01jdjvax77219l3gc75glywqrisqpd2k0m0g7fwh3";
26+ })
27+ ];
28+
29+ propagatedBuildInputs = [ click six ];
30+
31+ meta = with lib; {
32+ homepage = "https://github.com/geomet/geomet";
33+ license = licenses.asl20;
34+ description = "Convert GeoJSON to WKT/WKB (Well-Known Text/Binary), and vice versa.";
35+ maintainers = with maintainers; [ turion ris ];
36+ };
37+}
pkgs/development/python-modules/gremlinpython/default.nixnew file+54
@@ -0,0 +1,54 @@
1+{ stdenv, lib, buildPythonPackage, fetchFromGitHub, python, pythonOlder
2+, pytestCheckHook, pyhamcrest, pytestrunner, pytest
3+, six, isodate, tornado, aenum, radish-bdd, mock
4+}:
5+
6+buildPythonPackage rec {
7+ pname = "gremlinpython";
8+ version = "3.4.8";
9+
10+ # pypi tarball doesn't include tests
11+ src = fetchFromGitHub {
12+ owner = "apache";
13+ repo = "tinkerpop";
14+ rev = version;
15+ sha256 = "0kcyhfxz7z4f8i64gig8q1q9dhy24cprbh63vwsdiwryg74q4chl";
16+ };
17+ sourceRoot = "source/gremlin-python/src/main/jython";
18+ postPatch = ''
19+ substituteInPlace setup.py \
20+ --replace 'tornado>=4.4.1,<6.0' 'tornado' \
21+ --replace 'PyHamcrest>=1.9.0,<2.0.0' 'PyHamcrest' \
22+ --replace 'radish-bdd==0.8.6' 'radish-bdd' \
23+ --replace 'mock>=3.0.5,<4.0.0' 'mock' \
24+ --replace 'pytest>=4.6.4,<5.0.0' 'pytest'
25+ '';
26+
27+ nativeBuildInputs = [ pytestrunner ]; # simply to placate requirements
28+ propagatedBuildInputs = [ six isodate tornado aenum ];
29+
30+ checkInputs = [ pytestCheckHook pyhamcrest radish-bdd mock ];
31+
32+ # disable custom pytest report generation
33+ preCheck = ''
34+ substituteInPlace setup.cfg --replace 'addopts' '#addopts'
35+ '';
36+
37+ # many tests expect a running tinkerpop server
38+ pytestFlagsArray = [
39+ "--ignore=tests/driver/test_client.py"
40+ "--ignore=tests/driver/test_driver_remote_connection.py"
41+ "--ignore=tests/driver/test_driver_remote_connection_threaded.py"
42+ "--ignore=tests/process/test_dsl.py"
43+ "--ignore=tests/structure/io/test_functionalityio.py"
44+ # disabledTests doesn't quite allow us to be precise enough for this
45+ "-k 'not (TestFunctionalGraphSONIO and (test_timestamp or test_datetime or test_uuid))'"
46+ ];
47+
48+ meta = with lib; {
49+ description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";
50+ homepage = "https://tinkerpop.apache.org/";
51+ license = licenses.asl20;
52+ maintainers = with maintainers; [ turion ris ];
53+ };
54+}
pkgs/top-level/python-packages.nix+4
@@ -2526,6 +2526,8 @@ in {
25262526
25272527 geojson-client = callPackage ../development/python-modules/geojson-client { };
25282528
2529+ geomet = callPackage ../development/python-modules/geomet { };
2530+
25292531 geopandas = callPackage ../development/python-modules/geopandas { };
25302532
25312533 geopy = if isPy3k then
@@ -2793,6 +2795,8 @@ in {
27932795
27942796 grequests = callPackage ../development/python-modules/grequests { };
27952797
2798+ gremlinpython = callPackage ../development/python-modules/gremlinpython { };
2799+
27962800 grib-api = disabledIf (!isPy27) (toPythonModule (pkgs.grib-api.override {
27972801 enablePython = true;
27982802 pythonPackages = self;