Merge pull request #325669 from mweinelt/drop-pynose

python312Packages.pynose: drop due to licensing issues
This commit is contained in:
Martin Weinelt 2024-07-09 17:38:35 +02:00 committed by GitHub
commit 49a4992b8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 995 additions and 312 deletions

View File

@ -6,6 +6,7 @@
, enableSwftools ? false
, swftools
, python3Packages
, pythonOlder
, qtbase
, qtcharts
, makeDesktopItem
@ -81,8 +82,11 @@ python3Packages.buildPythonPackage rec {
twisted
];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = with python3Packages; [
pynose
nose
mock
httmock
];

View File

@ -1,34 +0,0 @@
{
lib,
buildPythonPackage,
fetchPypi,
six,
pynose,
setuptools,
}:
buildPythonPackage rec {
pname = "aadict";
version = "0.2.3";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-p3MorFXbtXNdqZRBhwJRvv4TX2h6twenoXhWE2OydwQ=";
};
build-system = [ setuptools ];
dependencies = [ six ];
nativeCheckInputs = [ pynose ];
pythonImportsCheck = [ "aadict" ];
meta = with lib; {
description = "Auto-attribute dict (and a couple of other useful dict functions)";
homepage = "https://github.com/metagriffin/aadict";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ glittershark ];
};
}

View File

@ -3,7 +3,7 @@
blockdiag,
buildPythonPackage,
fetchFromGitHub,
pynose,
nose,
pytestCheckHook,
pythonOlder,
setuptools,
@ -27,8 +27,11 @@ buildPythonPackage rec {
propagatedBuildInputs = [ blockdiag ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
pytestCheckHook
];

View File

@ -10,7 +10,7 @@
lxml,
parsedatetime,
pyicu,
pynose,
pytestCheckHook,
python-slugify,
pythonOlder,
pytimeparse,
@ -47,15 +47,11 @@ buildPythonPackage rec {
cssselect
glibcLocales
lxml
pynose
pyicu
pytestCheckHook
pytz
];
checkPhase = ''
LC_ALL="en_US.UTF-8" nosetests tests
'';
pythonImportsCheck = [ "agate" ];
meta = with lib; {

View File

@ -2,10 +2,8 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
setuptools,
pynose,
coverage,
pytestCheckHook,
wrapt,
}:
@ -25,14 +23,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [ wrapt ];
nativeCheckInputs = [
pynose
coverage
];
checkPhase = ''
nosetests -e test_specific_test
'';
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "aiounittest" ];

View File

@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
case,
fetchPypi,
pytestCheckHook,
pytest-rerunfailures,
@ -26,7 +25,6 @@ buildPythonPackage rec {
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
case
pytestCheckHook
pytest-rerunfailures
];

View File

@ -1,10 +1,10 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
h5py,
numpy,
pynose,
pytestCheckHook,
pythonOlder,
setuptools,
}:
@ -16,9 +16,11 @@ buildPythonPackage rec {
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-nL/r7+Cl+EPropxr5MhNYB9PQa1N7QSG8biMOwdznBU=";
src = fetchFromGitHub {
owner = "spotify";
repo = "annoy";
rev = "refs/tags/v${version}";
hash = "sha256-oJHW4lULRun2in35pBGOKg44s5kgLH2BKiMOzVu4rf4=";
};
postPatch = ''
@ -32,7 +34,16 @@ buildPythonPackage rec {
nativeCheckInputs = [
numpy
pynose
pytestCheckHook
];
preCheck = ''
rm -rf annoy
'';
disabledTestPaths = [
# network access
"test/accuracy_test.py"
];
pythonImportsCheck = [ "annoy" ];

View File

@ -5,7 +5,7 @@
apricot-select,
numba,
numpy,
pynose,
nose,
pytestCheckHook,
pythonOlder,
scikit-learn,
@ -45,7 +45,7 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
pynose
nose
pytestCheckHook
];

View File

@ -3,7 +3,6 @@
buildPythonPackage,
fetchPypi,
lark,
pynose,
pythonOlder,
setuptools,
}:
@ -20,11 +19,7 @@ buildPythonPackage rec {
hash = "sha256-rI/1n7m9Q36im4mn18UH/QoelXhFuumurGnyiSuNaB4=";
};
# Nose is required during build process, so can not use `nativeCheckInputs`.
buildInputs = [
pynose
setuptools
];
build-system = [ setuptools ];
dependencies = [ lark ];

View File

@ -3,7 +3,6 @@
buildPythonPackage,
fetchPypi,
pytestCheckHook,
case,
psutil,
pythonOlder,
}:
@ -21,7 +20,6 @@ buildPythonPackage rec {
};
nativeCheckInputs = [
case
psutil
pytestCheckHook
];

View File

@ -5,10 +5,11 @@
setuptools,
looseversion,
mmtf-python,
nose,
numpy,
pandas,
pynose,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
@ -23,7 +24,6 @@ buildPythonPackage rec {
hash = "sha256-1c78baBBsDyvAWrNx5mZI/Q75wyXv0DAwAdWm3EwX/I=";
};
pythonRelaxDeps = [ "looseversion" ];
build-system = [ setuptools ];
@ -35,8 +35,12 @@ buildPythonPackage rec {
looseversion
];
# tests rely on nose
# resolved in 0.5.1: https://github.com/BioPandas/biopandas/commit/67aa2f237c70c826cd9ab59d6ae114582da2112f
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
pytestCheckHook
];

View File

@ -7,7 +7,7 @@
fetchpatch,
funcparserlib,
pillow,
pynose,
nose,
pytestCheckHook,
pythonOlder,
reportlab,
@ -48,9 +48,12 @@ buildPythonPackage rec {
webcolors
];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
ephem
pynose
nose
pytestCheckHook
];

View File

@ -1,48 +0,0 @@
{
lib,
buildPythonPackage,
fetchPypi,
pynose,
pythonOlder,
setuptools,
six,
}:
buildPythonPackage rec {
pname = "case";
version = "1.5.3";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "48432b01d91913451c3512c5b90e31b0f348f1074b166a3431085eb70d784fb1";
};
build-system = [
setuptools
];
pythonRemoveDeps = [
# replaced with pynopse for python 3.12 compat
"nose"
];
dependencies = [
pynose
six
];
# No real unittests, only coverage
doCheck = false;
pythonImportsCheck = [ "case" ];
meta = with lib; {
homepage = "https://github.com/celery/case";
description = "Utilities for unittests handling";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}

View File

@ -8,7 +8,6 @@
minidump,
pefile,
pyelftools,
pynose,
pytestCheckHook,
pythonOlder,
pyvex,
@ -60,7 +59,6 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
pynose
pytestCheckHook
];

View File

@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
case,
celery,
cron-descriptor,
django-timezone-field,
@ -42,7 +41,6 @@ buildPythonPackage rec {
ephem
pytest-timeout
pytest-django
case
pytestCheckHook
];

View File

@ -5,7 +5,8 @@
beautifulsoup4,
enum-compat,
pyserial,
pynose,
nose,
pythonOlder,
}:
buildPythonPackage rec {
@ -26,7 +27,10 @@ buildPythonPackage rec {
pyserial
];
nativeCheckInputs = [ pynose ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [ nose ];
checkPhase = ''
runHook preCheck

View File

@ -5,7 +5,7 @@
fetchPypi,
jinja2,
mock,
pynose,
nose,
poetry-core,
pythonOlder,
terminaltables,
@ -31,9 +31,12 @@ buildPythonPackage rec {
terminaltables
];
# test rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
mock
pynose
nose
];
checkPhase = ''

View File

@ -5,8 +5,7 @@
setuptools,
flask,
webassets,
flask-script,
pynose,
pytestCheckHook,
}:
buildPythonPackage rec {
@ -31,10 +30,14 @@ buildPythonPackage rec {
propagatedBuildInputs = [
flask
webassets
flask-script
pynose
];
doCheck = false; # tests are broken with webassets 2.0
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "flask_assets" ];
meta = with lib; {
homepage = "https://github.com/miracle2k/flask-assets";
description = "Asset management for Flask, to compress and merge CSS and Javascript files";

View File

@ -1,49 +0,0 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pynose,
setuptools,
}:
buildPythonPackage rec {
version = "0.1.4";
pname = "forbiddenfruit";
pyproject = true;
src = fetchFromGitHub {
owner = "clarete";
repo = "forbiddenfruit";
rev = "refs/tags/${version}";
hash = "sha256-yHIZsVn2UVmWeBNIzWDE6AOwAXZilPqXo+bVtXqGkJk=";
};
build-system = [ setuptools ];
env.FFRUIT_EXTENSION = "true";
pythonImportsCheck = [ "forbiddenfruit" ];
nativeCheckInputs = [ pynose ];
# https://github.com/clarete/forbiddenfruit/pull/47 required to switch to pytest
checkPhase = ''
runHook preCheck
find ./build -name '*.so' -exec mv {} tests/unit \;
nosetests
runHook postCheck
'';
meta = with lib; {
description = "Patch python built-in objects";
homepage = "https://github.com/clarete/forbiddenfruit";
changelog = "https://github.com/clarete/forbiddenfruit/releases/tag/${version}";
license = with licenses; [
mit
gpl3Plus
];
maintainers = with maintainers; [ ];
};
}

View File

@ -5,7 +5,6 @@
cython,
numpy,
oldest-supported-numpy,
pynose,
pytestCheckHook,
setuptools,
}:
@ -20,6 +19,11 @@ buildPythonPackage rec {
hash = "sha256-tHrssWdx4boHNlVyVdgK4CQLCRVr/0NDId5VmzWawtY=";
};
patches = [
# https://github.com/daleroberts/hdmedians/pull/10
./replace-nose.patch
];
postPatch = ''
substituteInPlace setup.py \
--replace-fail "'nose>=1.0'," ""
@ -36,7 +40,6 @@ buildPythonPackage rec {
pythonImportsCheck = [ "hdmedians" ];
nativeCheckInputs = [
pynose
pytestCheckHook
];

View File

@ -0,0 +1,91 @@
diff --git a/hdmedians/tests/test_geomedian.py b/hdmedians/tests/test_geomedian.py
index 0bc37e9..ff5f938 100644
--- a/hdmedians/tests/test_geomedian.py
+++ b/hdmedians/tests/test_geomedian.py
@@ -4,9 +4,9 @@ Tests.
import numpy as np
import hdmedians as hd
+import pytest
from numpy.testing import assert_equal, assert_array_almost_equal
-from nose.tools import assert_true, assert_raises
# shape (6, 25)
DATA1 = np.array([[693, 990, 1281, 2101, 3524, 2577],
@@ -124,10 +124,12 @@ def test_nangeomedian_axis_one_two_good():
def test_nangeomedian_axis_bad():
data = np.array([[1.0, np.nan, 1.0],
[2.0, 1.0, 1.0]])
- assert_raises(IndexError, hd.nangeomedian, data, axis=2)
+ with pytest.raises(IndexError):
+ hd.nangeomedian(data, axis=2)
def test_nangeomedian_all_nan():
data = np.array([[np.nan, np.nan, np.nan],
[np.nan, np.nan, np.nan]])
- assert_raises(ValueError, hd.nangeomedian, data)
+ with pytest.raises(ValueError):
+ hd.nangeomedian(data)
diff --git a/hdmedians/tests/test_medoid.py b/hdmedians/tests/test_medoid.py
index c5e0a7f..4fbdf80 100644
--- a/hdmedians/tests/test_medoid.py
+++ b/hdmedians/tests/test_medoid.py
@@ -4,9 +4,9 @@ Tests.
import numpy as np
import hdmedians as hd
+import pytest
from numpy.testing import assert_equal, assert_array_almost_equal
-from nose.tools import assert_true, assert_raises
# shape (6, 25)
DATA1 = np.array([[693, 990, 1281, 2101, 3524, 2577],
@@ -59,7 +59,7 @@ def test_medoid_in_set_random():
s = [list(x) for x in a.T]
m = hd.medoid(a)
idx = s.index(list(m))
- assert_true(idx > -1)
+ assert(idx > -1)
def test_medoid_noaxis():
@@ -85,7 +85,8 @@ def test_medoid_axis_one():
def test_medoid_axis_bad():
- assert_raises(IndexError, hd.medoid, DATA1, axis=2)
+ with pytest.raises(IndexError):
+ hd.medoid(DATA1, axis=2)
def test_medoid_noaxis_indexonly():
@@ -136,7 +137,8 @@ def test_nanmedoid_two_obs():
def test_nanmedoid_all_nan():
data = np.array([[np.nan, np.nan, np.nan],
[np.nan, np.nan, np.nan]])
- assert_raises(ValueError, hd.nanmedoid, data)
+ with pytest.raises(ValueError):
+ hd.nanmedoid(data)
def test_nanmedoid_axis_zero():
@@ -170,7 +172,8 @@ def test_nanmedoid_axis_one_indexonly():
def test_nanmedoid_axis_bad():
- assert_raises(IndexError, hd.nanmedoid, DATA1, axis=2)
+ with pytest.raises(IndexError):
+ hd.nanmedoid(DATA1, axis=2)
def test_nanmedoid_two_obs():
@@ -184,4 +187,5 @@ def test_nanmedoid_two_obs():
def test_nanmedoid_all_nan():
data = np.array([[np.nan, np.nan, np.nan],
[np.nan, np.nan, np.nan]])
- assert_raises(ValueError, hd.nanmedoid, data)
+ with pytest.raises(ValueError):
+ hd.nanmedoid(data)

View File

@ -2,7 +2,8 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pynose,
pythonOlder,
nose,
setuptools,
}:
@ -22,7 +23,10 @@ buildPythonPackage {
pythonImportsCheck = [ "hkdf" ];
nativeCheckInputs = [ pynose ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [ nose ];
checkPhase = ''
runHook preCheck

View File

@ -4,7 +4,8 @@
cryptography,
fetchPypi,
mock,
pynose,
nose,
pythonOlder,
}:
buildPythonPackage rec {
@ -25,9 +26,11 @@ buildPythonPackage rec {
propagatedBuildInputs = [ cryptography ];
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
mock
pynose
nose
];
meta = with lib; {

View File

@ -5,7 +5,6 @@
mock,
msgpack,
pandas,
pynose,
pytestCheckHook,
python-dateutil,
pytz,
@ -25,6 +24,11 @@ buildPythonPackage rec {
hash = "sha256-WMZH9gQ3Et2G6a7hLrTM+7tUFUZ7yZEKSKqMdMEQiXA=";
};
patches = [
# https://github.com/influxdata/influxdb-python/pull/835
./remove-nose.patch
];
postPatch = ''
for f in influxdb/tests/dataframe_client_test.py influxdb/tests/influxdb08/dataframe_client_test.py; do
substituteInPlace "$f" \
@ -52,7 +56,6 @@ buildPythonPackage rec {
nativeCheckInputs = [
mock
pandas
pynose
pytestCheckHook
requests-mock
];

View File

@ -0,0 +1,713 @@
diff --git a/influxdb/tests/client_test.py b/influxdb/tests/client_test.py
index 115fbc4..5b348c7 100644
--- a/influxdb/tests/client_test.py
+++ b/influxdb/tests/client_test.py
@@ -32,7 +32,6 @@ import requests
import requests.exceptions
import requests_mock
-from nose.tools import raises
from urllib3.connection import HTTPConnection
from influxdb import InfluxDBClient
@@ -383,12 +382,12 @@ class TestInfluxDBClient(unittest.TestCase):
received_data.decode()
)
- @raises(Exception)
def test_write_points_fails(self):
"""Test write points fail for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- with _mocked_session(cli, 'post', 500):
- cli.write_points([])
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'post', 500):
+ cli.write_points([])
def test_write_points_with_precision(self):
"""Test write points with precision for TestInfluxDBClient object."""
@@ -541,12 +540,12 @@ class TestInfluxDBClient(unittest.TestCase):
consistency='boo'
)
- @raises(Exception)
def test_write_points_with_precision_fails(self):
"""Test write points w/precision fail for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- with _mocked_session(cli, 'post', 500):
- cli.write_points_with_precision([])
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'post', 500):
+ cli.write_points_with_precision([])
def test_query(self):
"""Test query method for TestInfluxDBClient object."""
@@ -651,11 +650,11 @@ class TestInfluxDBClient(unittest.TestCase):
[example_object, example_object]
)
- @raises(Exception)
def test_query_fail(self):
"""Test query failed for TestInfluxDBClient object."""
- with _mocked_session(self.cli, 'get', 401):
- self.cli.query('select column_one from foo;')
+ with self.assertRaises(Exception):
+ with _mocked_session(self.cli, 'get', 401):
+ self.cli.query('select column_one from foo;')
def test_ping(self):
"""Test ping querying InfluxDB version."""
@@ -697,11 +696,11 @@ class TestInfluxDBClient(unittest.TestCase):
'create database "123"'
)
- @raises(Exception)
def test_create_database_fails(self):
"""Test create database fail for TestInfluxDBClient object."""
- with _mocked_session(self.cli, 'post', 401):
- self.cli.create_database('new_db')
+ with self.assertRaises(Exception):
+ with _mocked_session(self.cli, 'post', 401):
+ self.cli.create_database('new_db')
def test_drop_database(self):
"""Test drop database for TestInfluxDBClient object."""
@@ -762,12 +761,12 @@ class TestInfluxDBClient(unittest.TestCase):
[{'name': 'new_db_1'}, {'name': 'new_db_2'}]
)
- @raises(Exception)
def test_get_list_database_fails(self):
"""Test get list of dbs fail for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 401):
- cli.get_list_database()
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 401):
+ cli.get_list_database()
def test_get_list_measurements(self):
"""Test get list of measurements for TestInfluxDBClient object."""
@@ -840,12 +839,12 @@ class TestInfluxDBClient(unittest.TestCase):
self.cli.get_list_series(tags={'region': 'us-west'}),
['cpu_load_short,host=server01,region=us-west'])
- @raises(Exception)
def test_get_list_series_fails(self):
"""Test get a list of series from the database but fail."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 401):
- cli.get_list_series()
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 401):
+ cli.get_list_series()
def test_create_retention_policy_default(self):
"""Test create default ret policy for TestInfluxDBClient object."""
@@ -971,12 +970,12 @@ class TestInfluxDBClient(unittest.TestCase):
'alter retention policy "somename" on "db" default'
)
- @raises(Exception)
def test_alter_retention_policy_invalid(self):
"""Test invalid alter ret policy for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- self.cli.alter_retention_policy('somename', 'db')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ self.cli.alter_retention_policy('somename', 'db')
def test_drop_retention_policy(self):
"""Test drop retention policy for TestInfluxDBClient object."""
@@ -994,12 +993,12 @@ class TestInfluxDBClient(unittest.TestCase):
'drop retention policy "somename" on "db"'
)
- @raises(Exception)
def test_drop_retention_policy_fails(self):
"""Test failed drop ret policy for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'delete', 401):
- cli.drop_retention_policy('default', 'db')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'delete', 401):
+ cli.drop_retention_policy('default', 'db')
def test_get_list_retention_policies(self):
"""Test get retention policies for TestInfluxDBClient object."""
@@ -1179,12 +1178,12 @@ class TestInfluxDBClient(unittest.TestCase):
'grant all privileges to "test"'
)
- @raises(Exception)
def test_grant_admin_privileges_invalid(self):
"""Test grant invalid admin privs for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- self.cli.grant_admin_privileges('')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ self.cli.grant_admin_privileges('')
def test_revoke_admin_privileges(self):
"""Test revoke admin privs for TestInfluxDBClient object."""
@@ -1203,12 +1202,12 @@ class TestInfluxDBClient(unittest.TestCase):
'revoke all privileges from "test"'
)
- @raises(Exception)
def test_revoke_admin_privileges_invalid(self):
"""Test revoke invalid admin privs for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- self.cli.revoke_admin_privileges('')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ self.cli.revoke_admin_privileges('')
def test_grant_privilege(self):
"""Test grant privs for TestInfluxDBClient object."""
@@ -1227,12 +1226,12 @@ class TestInfluxDBClient(unittest.TestCase):
'grant read on "testdb" to "test"'
)
- @raises(Exception)
def test_grant_privilege_invalid(self):
"""Test grant invalid privs for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- self.cli.grant_privilege('', 'testdb', 'test')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ self.cli.grant_privilege('', 'testdb', 'test')
def test_revoke_privilege(self):
"""Test revoke privs for TestInfluxDBClient object."""
@@ -1251,12 +1250,12 @@ class TestInfluxDBClient(unittest.TestCase):
'revoke read on "testdb" from "test"'
)
- @raises(Exception)
def test_revoke_privilege_invalid(self):
"""Test revoke invalid privs for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- self.cli.revoke_privilege('', 'testdb', 'test')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ self.cli.revoke_privilege('', 'testdb', 'test')
def test_get_list_privileges(self):
"""Test get list of privs for TestInfluxDBClient object."""
@@ -1278,12 +1277,12 @@ class TestInfluxDBClient(unittest.TestCase):
{'database': 'db3', 'privilege': 'NO PRIVILEGES'}]
)
- @raises(Exception)
def test_get_list_privileges_fails(self):
"""Test failed get list of privs for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 401):
- cli.get_list_privileges('test')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 401):
+ cli.get_list_privileges('test')
def test_get_list_continuous_queries(self):
"""Test getting a list of continuous queries."""
@@ -1333,11 +1332,11 @@ class TestInfluxDBClient(unittest.TestCase):
]
)
- @raises(Exception)
def test_get_list_continuous_queries_fails(self):
"""Test failing to get a list of continuous queries."""
- with _mocked_session(self.cli, 'get', 400):
- self.cli.get_list_continuous_queries()
+ with self.assertRaises(Exception):
+ with _mocked_session(self.cli, 'get', 400):
+ self.cli.get_list_continuous_queries()
def test_create_continuous_query(self):
"""Test continuous query creation."""
@@ -1366,11 +1365,12 @@ class TestInfluxDBClient(unittest.TestCase):
'"6_months"."events" from "events" group by time(10m) end'
)
- @raises(Exception)
def test_create_continuous_query_fails(self):
"""Test failing to create a continuous query."""
- with _mocked_session(self.cli, 'get', 400):
- self.cli.create_continuous_query('cq_name', 'select', 'db_name')
+ with self.assertRaises(Exception):
+ with _mocked_session(self.cli, 'get', 400):
+ self.cli.create_continuous_query('cq_name', 'select',
+ 'db_name')
def test_drop_continuous_query(self):
"""Test dropping a continuous query."""
@@ -1387,11 +1387,11 @@ class TestInfluxDBClient(unittest.TestCase):
'drop continuous query "cq_name" on "db_name"'
)
- @raises(Exception)
def test_drop_continuous_query_fails(self):
"""Test failing to drop a continuous query."""
- with _mocked_session(self.cli, 'get', 400):
- self.cli.drop_continuous_query('cq_name', 'db_name')
+ with self.assertRaises(Exception):
+ with _mocked_session(self.cli, 'get', 400):
+ self.cli.drop_continuous_query('cq_name', 'db_name')
def test_invalid_port_fails(self):
"""Test invalid port fail for TestInfluxDBClient object."""
diff --git a/influxdb/tests/dataframe_client_test.py b/influxdb/tests/dataframe_client_test.py
index 87b8e0d..a8c8416 100644
--- a/influxdb/tests/dataframe_client_test.py
+++ b/influxdb/tests/dataframe_client_test.py
@@ -13,7 +13,6 @@ import unittest
import warnings
import requests_mock
-from nose.tools import raises
from influxdb.tests import skip_if_pypy, using_pypy
from .client_test import _mocked_session
@@ -597,35 +596,35 @@ class TestDataFrameClient(unittest.TestCase):
m.last_request.body,
)
- @raises(TypeError)
def test_write_points_from_dataframe_fails_without_time_index(self):
"""Test failed write points from df without time index."""
dataframe = pd.DataFrame(data=[["1", 1, 1.0], ["2", 2, 2.0]],
columns=["column_one", "column_two",
"column_three"])
- with requests_mock.Mocker() as m:
- m.register_uri(requests_mock.POST,
- "http://localhost:8086/db/db/series",
- status_code=204)
+ with self.assertRaises(TypeError):
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/db/db/series",
+ status_code=204)
- cli = DataFrameClient(database='db')
- cli.write_points(dataframe, "foo")
+ cli = DataFrameClient(database='db')
+ cli.write_points(dataframe, "foo")
- @raises(TypeError)
def test_write_points_from_dataframe_fails_with_series(self):
"""Test failed write points from df with series."""
now = pd.Timestamp('1970-01-01 00:00+00:00')
dataframe = pd.Series(data=[1.0, 2.0],
index=[now, now + timedelta(hours=1)])
- with requests_mock.Mocker() as m:
- m.register_uri(requests_mock.POST,
- "http://localhost:8086/db/db/series",
- status_code=204)
+ with self.assertRaises(TypeError):
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/db/db/series",
+ status_code=204)
- cli = DataFrameClient(database='db')
- cli.write_points(dataframe, "foo")
+ cli = DataFrameClient(database='db')
+ cli.write_points(dataframe, "foo")
def test_create_database(self):
"""Test create database for TestInfluxDBClient object."""
@@ -657,12 +656,12 @@ class TestDataFrameClient(unittest.TestCase):
'create database "123"'
)
- @raises(Exception)
def test_create_database_fails(self):
"""Test create database fail for TestInfluxDBClient object."""
cli = DataFrameClient(database='db')
- with _mocked_session(cli, 'post', 401):
- cli.create_database('new_db')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'post', 401):
+ cli.create_database('new_db')
def test_drop_database(self):
"""Test drop database for TestInfluxDBClient object."""
@@ -709,12 +708,12 @@ class TestDataFrameClient(unittest.TestCase):
'drop database "123"'
)
- @raises(Exception)
def test_get_list_database_fails(self):
"""Test get list of dbs fail for TestInfluxDBClient object."""
cli = DataFrameClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 401):
- cli.get_list_database()
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 401):
+ cli.get_list_database()
def test_get_list_measurements(self):
"""Test get list of measurements for TestInfluxDBClient object."""
@@ -819,12 +818,12 @@ class TestDataFrameClient(unittest.TestCase):
'alter retention policy "somename" on "db" default'
)
- @raises(Exception)
def test_alter_retention_policy_invalid(self):
"""Test invalid alter ret policy for TestInfluxDBClient object."""
cli = DataFrameClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'get', 400):
- cli.alter_retention_policy('somename', 'db')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'get', 400):
+ cli.alter_retention_policy('somename', 'db')
def test_drop_retention_policy(self):
"""Test drop retention policy for TestInfluxDBClient object."""
@@ -843,12 +842,12 @@ class TestDataFrameClient(unittest.TestCase):
'drop retention policy "somename" on "db"'
)
- @raises(Exception)
def test_drop_retention_policy_fails(self):
"""Test failed drop ret policy for TestInfluxDBClient object."""
cli = DataFrameClient('host', 8086, 'username', 'password')
- with _mocked_session(cli, 'delete', 401):
- cli.drop_retention_policy('default', 'db')
+ with self.assertRaises(Exception):
+ with _mocked_session(cli, 'delete', 401):
+ cli.drop_retention_policy('default', 'db')
def test_get_list_retention_policies(self):
"""Test get retention policies for TestInfluxDBClient object."""
diff --git a/influxdb/tests/influxdb08/client_test.py b/influxdb/tests/influxdb08/client_test.py
index 39ab52d..d20a411 100644
--- a/influxdb/tests/influxdb08/client_test.py
+++ b/influxdb/tests/influxdb08/client_test.py
@@ -13,7 +13,6 @@ import requests
import requests.exceptions
import requests_mock
-from nose.tools import raises
from mock import patch
from influxdb.influxdb08 import InfluxDBClient
@@ -131,12 +130,12 @@ class TestInfluxDBClient(unittest.TestCase):
cli.switch_database('another_database')
self.assertEqual(cli._database, 'another_database')
- @raises(FutureWarning)
def test_switch_db_deprecated(self):
"""Test deprecated switch database for TestInfluxDBClient object."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'database')
- cli.switch_db('another_database')
- self.assertEqual(cli._database, 'another_database')
+ with self.assertRaises(FutureWarning):
+ cli.switch_db('another_database')
+ self.assertEqual(cli._database, 'another_database')
def test_switch_user(self):
"""Test switch user for TestInfluxDBClient object."""
@@ -288,12 +287,13 @@ class TestInfluxDBClient(unittest.TestCase):
time_precision='ms'
)
- @raises(Exception)
def test_write_points_fails(self):
"""Test failed write points for TestInfluxDBClient object."""
- with _mocked_session('post', 500):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.write_points([])
+ with self.assertRaises(Exception):
+ with _mocked_session('post', 500):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.write_points([])
def test_write_points_with_precision(self):
"""Test write points with precision."""
@@ -313,12 +313,13 @@ class TestInfluxDBClient(unittest.TestCase):
time_precision='g'
)
- @raises(Exception)
def test_write_points_with_precision_fails(self):
"""Test write points where precision fails."""
- with _mocked_session('post', 500):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.write_points_with_precision([])
+ with self.assertRaises(Exception):
+ with _mocked_session('post', 500):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.write_points_with_precision([])
def test_delete_points(self):
"""Test delete points for TestInfluxDBClient object."""
@@ -333,30 +334,31 @@ class TestInfluxDBClient(unittest.TestCase):
{'u': 'username', 'p': 'password'})
self.assertEqual(kwds['url'], 'http://host:8086/db/db/series/foo')
- @raises(Exception)
def test_delete_points_with_wrong_name(self):
"""Test delete points with wrong name."""
- with _mocked_session('delete', 400):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.delete_points("nonexist")
+ with self.assertRaises(Exception):
+ with _mocked_session('delete', 400):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.delete_points("nonexist")
- @raises(NotImplementedError)
def test_create_scheduled_delete(self):
"""Test create scheduled deletes."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.create_scheduled_delete([])
+ with self.assertRaises(NotImplementedError):
+ cli.create_scheduled_delete([])
- @raises(NotImplementedError)
def test_get_list_scheduled_delete(self):
"""Test get schedule list of deletes TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.get_list_scheduled_delete()
+ with self.assertRaises(NotImplementedError):
+ cli.get_list_scheduled_delete()
- @raises(NotImplementedError)
def test_remove_scheduled_delete(self):
"""Test remove scheduled delete TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.remove_scheduled_delete(1)
+ with self.assertRaises(NotImplementedError):
+ cli.remove_scheduled_delete(1)
def test_query(self):
"""Test query for TestInfluxDBClient object."""
@@ -438,12 +440,13 @@ class TestInfluxDBClient(unittest.TestCase):
[example_object, example_object]
)
- @raises(Exception)
def test_query_fail(self):
"""Test failed query for TestInfluxDBClient."""
- with _mocked_session('get', 401):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.query('select column_one from foo;')
+ with self.assertRaises(Exception):
+ with _mocked_session('get', 401):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.query('select column_one from foo;')
def test_query_bad_precision(self):
"""Test query with bad precision for TestInfluxDBClient."""
@@ -460,12 +463,13 @@ class TestInfluxDBClient(unittest.TestCase):
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
self.assertTrue(cli.create_database('new_db'))
- @raises(Exception)
def test_create_database_fails(self):
"""Test failed create database for TestInfluxDBClient."""
- with _mocked_session('post', 401):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.create_database('new_db')
+ with self.assertRaises(Exception):
+ with _mocked_session('post', 401):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.create_database('new_db')
def test_delete_database(self):
"""Test delete database for TestInfluxDBClient."""
@@ -473,12 +477,13 @@ class TestInfluxDBClient(unittest.TestCase):
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
self.assertTrue(cli.delete_database('old_db'))
- @raises(Exception)
def test_delete_database_fails(self):
"""Test failed delete database for TestInfluxDBClient."""
- with _mocked_session('delete', 401):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.delete_database('old_db')
+ with self.assertRaises(Exception):
+ with _mocked_session('delete', 401):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.delete_database('old_db')
def test_get_list_database(self):
"""Test get list of databases for TestInfluxDBClient."""
@@ -490,23 +495,23 @@ class TestInfluxDBClient(unittest.TestCase):
self.assertEqual(len(cli.get_list_database()), 1)
self.assertEqual(cli.get_list_database()[0]['name'], 'a_db')
- @raises(Exception)
def test_get_list_database_fails(self):
"""Test failed get list of databases for TestInfluxDBClient."""
- with _mocked_session('get', 401):
- cli = InfluxDBClient('host', 8086, 'username', 'password')
- cli.get_list_database()
+ with self.assertRaises(Exception):
+ with _mocked_session('get', 401):
+ cli = InfluxDBClient('host', 8086, 'username', 'password')
+ cli.get_list_database()
- @raises(FutureWarning)
def test_get_database_list_deprecated(self):
"""Test deprecated get database list for TestInfluxDBClient."""
data = [
{"name": "a_db"}
]
- with _mocked_session('get', 200, data):
- cli = InfluxDBClient('host', 8086, 'username', 'password')
- self.assertEqual(len(cli.get_database_list()), 1)
- self.assertEqual(cli.get_database_list()[0]['name'], 'a_db')
+ with self.assertRaises(FutureWarning):
+ with _mocked_session('get', 200, data):
+ cli = InfluxDBClient('host', 8086, 'username', 'password')
+ self.assertEqual(len(cli.get_database_list()), 1)
+ self.assertEqual(cli.get_database_list()[0]['name'], 'a_db')
def test_delete_series(self):
"""Test delete series for TestInfluxDBClient."""
@@ -514,12 +519,13 @@ class TestInfluxDBClient(unittest.TestCase):
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
cli.delete_series('old_series')
- @raises(Exception)
def test_delete_series_fails(self):
"""Test failed delete series for TestInfluxDBClient."""
- with _mocked_session('delete', 401):
- cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.delete_series('old_series')
+ with self.assertRaises(Exception):
+ with _mocked_session('delete', 401):
+ cli = InfluxDBClient('host', 8086, 'username',
+ 'password', 'db')
+ cli.delete_series('old_series')
def test_get_series_list(self):
"""Test get list of series for TestInfluxDBClient."""
@@ -662,29 +668,30 @@ class TestInfluxDBClient(unittest.TestCase):
}
)
- @raises(NotImplementedError)
def test_get_list_database_admins(self):
"""Test get list of database admins for TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.get_list_database_admins()
+ with self.assertRaises(NotImplementedError):
+ cli.get_list_database_admins()
- @raises(NotImplementedError)
def test_add_database_admin(self):
"""Test add database admins for TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.add_database_admin('admin', 'admin_secret_password')
+ with self.assertRaises(NotImplementedError):
+ cli.add_database_admin('admin', 'admin_secret_password')
- @raises(NotImplementedError)
def test_update_database_admin_password(self):
"""Test update database admin pass for TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.update_database_admin_password('admin', 'admin_secret_password')
+ with self.assertRaises(NotImplementedError):
+ cli.update_database_admin_password('admin',
+ 'admin_secret_password')
- @raises(NotImplementedError)
def test_delete_database_admin(self):
"""Test delete database admin for TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.delete_database_admin('admin')
+ with self.assertRaises(NotImplementedError):
+ cli.delete_database_admin('admin')
def test_get_database_users(self):
"""Test get database users for TestInfluxDBClient."""
@@ -842,11 +849,11 @@ class TestInfluxDBClient(unittest.TestCase):
self.assertIsNone(m.last_request.body)
- @raises(NotImplementedError)
def test_update_permission(self):
"""Test update permission for TestInfluxDBClient."""
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
- cli.update_permission('admin', [])
+ with self.assertRaises(NotImplementedError):
+ cli.update_permission('admin', [])
@mock.patch('requests.Session.request')
def test_request_retry(self, mock_request):
diff --git a/influxdb/tests/influxdb08/dataframe_client_test.py b/influxdb/tests/influxdb08/dataframe_client_test.py
index 0a766af..104ae6b 100644
--- a/influxdb/tests/influxdb08/dataframe_client_test.py
+++ b/influxdb/tests/influxdb08/dataframe_client_test.py
@@ -10,8 +10,6 @@ import warnings
import requests_mock
-from nose.tools import raises
-
from influxdb.tests import skip_if_pypy, using_pypy
from .client_test import _mocked_session
@@ -191,33 +189,33 @@ class TestDataFrameClient(unittest.TestCase):
cli.write_points({"foo": dataframe}, time_precision='u')
self.assertListEqual(json.loads(m.last_request.body), points_us)
- @raises(TypeError)
def test_write_points_from_dataframe_fails_without_time_index(self):
"""Test write points from dataframe that fails without time index."""
dataframe = pd.DataFrame(data=[["1", 1, 1.0], ["2", 2, 2.0]],
columns=["column_one", "column_two",
"column_three"])
- with requests_mock.Mocker() as m:
- m.register_uri(requests_mock.POST,
- "http://localhost:8086/db/db/series")
+ with self.assertRaises(TypeError):
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/db/db/series")
- cli = DataFrameClient(database='db')
- cli.write_points({"foo": dataframe})
+ cli = DataFrameClient(database='db')
+ cli.write_points({"foo": dataframe})
- @raises(TypeError)
def test_write_points_from_dataframe_fails_with_series(self):
"""Test failed write points from dataframe with series."""
now = pd.Timestamp('1970-01-01 00:00+00:00')
dataframe = pd.Series(data=[1.0, 2.0],
index=[now, now + timedelta(hours=1)])
- with requests_mock.Mocker() as m:
- m.register_uri(requests_mock.POST,
- "http://localhost:8086/db/db/series")
+ with self.assertRaises(TypeError):
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/db/db/series")
- cli = DataFrameClient(database='db')
- cli.write_points({"foo": dataframe})
+ cli = DataFrameClient(database='db')
+ cli.write_points({"foo": dataframe})
def test_query_into_dataframe(self):
"""Test query into a dataframe."""

View File

@ -2,8 +2,8 @@
lib,
buildPythonPackage,
fetchPypi,
fetchpatch,
setuptools,
pynose,
pytestCheckHook,
}:
@ -18,20 +18,17 @@ buildPythonPackage rec {
hash = "sha256-6y4RbnXs751NIo/cZq9UJpr6JqtEYwQuM3hbiHxii6g=";
};
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [
pynose
pytestCheckHook
patches = [
(fetchpatch {
name = "ipython_genutils-denose.patch";
url = "https://build.opensuse.org/public/source/devel:languages:python:jupyter/python-ipython_genutils/denose.patch?rev=9";
hash = "sha256-At0aq6rLw/L64Own069m0p/WQm7iDa24fm0SPLLRBdE=";
})
];
preCheck = ''
substituteInPlace ipython_genutils/tests/test_path.py \
--replace-fail "setUp" "setup_method" \
--replace-fail "tearDown" "teardown_method" \
--replace-fail "assert_equals" "assert_equal" \
--replace-fail "assert_not_equals" "assert_not_equal"
'';
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "ipython_genutils" ];

View File

@ -5,7 +5,6 @@
six,
eventlet,
gevent,
pynose,
mock,
coverage,
openjdk8_headless,
@ -25,7 +24,6 @@ buildPythonPackage rec {
buildInputs = [
eventlet
gevent
pynose
mock
coverage
openjdk8_headless

View File

@ -7,7 +7,6 @@
backports-zoneinfo,
boto3,
buildPythonPackage,
case,
confluent-kafka,
fetchPypi,
hypothesis,
@ -16,7 +15,7 @@
pycurl,
pymongo,
#, pyro4
pytest7CheckHook,
pytestCheckHook,
pythonOlder,
pyyaml,
redis,
@ -46,7 +45,7 @@ buildPythonPackage rec {
++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]
++ lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ];
passthru.optional-dependencies = {
optional-dependencies = {
msgpack = [ msgpack ];
yaml = [ pyyaml ];
redis = [ redis ];
@ -71,10 +70,9 @@ buildPythonPackage rec {
};
nativeCheckInputs = [
case
hypothesis
pytest7CheckHook
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
pytestCheckHook
] ++ lib.flatten (lib.attrValues optional-dependencies);
pythonImportsCheck = [ "kombu" ];

View File

@ -4,7 +4,8 @@
fetchPypi,
setuptools,
pbr,
pynose,
nose,
pythonOlder,
}:
buildPythonPackage rec {
@ -22,7 +23,10 @@ buildPythonPackage rec {
setuptools
];
nativeCheckInputs = [ pynose ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [ nose ];
checkPhase = ''
runHook preCheck

View File

@ -3,7 +3,7 @@
blockdiag,
fetchFromGitHub,
buildPythonPackage,
pynose,
nose,
pytestCheckHook,
setuptools,
pythonOlder,
@ -27,8 +27,11 @@ buildPythonPackage rec {
dependencies = [ blockdiag ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
pytestCheckHook
];

View File

@ -4,7 +4,7 @@
fetchpatch,
isPy27,
libopus,
pynose,
pytestCheckHook,
lib,
stdenv,
substituteAll,
@ -46,7 +46,11 @@ buildPythonPackage rec {
build-system = [ setuptools ];
nativeCheckInputs = [ pynose ];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [
"tests/{decoder,encoder,hl_decoder,hl_encoder}.py"
];
meta = with lib; {
description = "Python bindings to the libopus, IETF low-delay audio codec";

View File

@ -3,10 +3,9 @@
buildPythonPackage,
fetchpatch,
fetchPypi,
nose,
parameterized,
pytestCheckHook,
pynose,
python,
pythonOlder,
setuptools,
}:
@ -39,9 +38,12 @@ buildPythonPackage rec {
build-system = [ setuptools ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
nose
parameterized
pynose
pytestCheckHook
];

View File

@ -6,7 +6,6 @@
arrow,
delorean,
pendulum,
pynose,
pytestCheckHook,
pytz,
udatetime,
@ -30,12 +29,16 @@ buildPythonPackage rec {
arrow
delorean
pendulum
pynose
pytestCheckHook
pytz
udatetime
];
disabledTestPaths = [
# depens on nose
"tests/test_has_been.py"
];
pythonImportsCheck = [ "pycron" ];
meta = with lib; {

View File

@ -2,11 +2,12 @@
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
numpy,
scipy,
sympy,
setuptools,
pynose,
nose,
cython,
}:
@ -28,8 +29,11 @@ buildPythonPackage rec {
sympy
];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
cython
];

View File

@ -3,7 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
mock,
pynose,
nose,
pexpect,
pyserial,
pytestCheckHook,
@ -39,19 +39,16 @@ buildPythonPackage rec {
dependencies = [ pyserial ];
passthru.optional-dependencies.GATTTOOL = [ pexpect ];
optional-dependencies.GATTTOOL = [ pexpect ];
nativeBuildInputs = [
# For cross compilation the doCheck is false and therefor the
# nativeCheckInputs not included. We have to include nose here, since
# setup.py requires nose unconditionally.
pynose
];
# tests require nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
mock
nose
pytestCheckHook
] ++ passthru.optional-dependencies.GATTTOOL;
] ++ optional-dependencies.GATTTOOL;
pythonImportsCheck = [ "pygatt" ];

View File

@ -3,7 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
mock,
pynose,
nose,
pyserial,
pytestCheckHook,
pythonOlder,
@ -30,9 +30,11 @@ buildPythonPackage rec {
propagatedBuildInputs = [ pyserial ];
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
mock
pynose
nose
pytestCheckHook
];

View File

@ -1,31 +0,0 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
}:
buildPythonPackage rec {
pname = "pynose";
version = "1.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "mdmintz";
repo = "pynose";
rev = "refs/tags/v${version}";
hash = "sha256-Oi+vwInqgsdZfr5abJUa4zkTktpEuG0m89d1O8Oot0Q=";
};
nativeBuildInputs = [ setuptools ];
# has no tests
doCheck = false;
meta = with lib; {
description = "pynose fixes nose to extend unittest and make testing easier";
homepage = "https://github.com/mdmintz/pynose";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View File

@ -6,7 +6,6 @@
pytest,
jinja2,
matplotlib,
pynose,
pillow,
pytest7CheckHook,
}:
@ -28,7 +27,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [
jinja2
matplotlib
pynose
pillow
];

View File

@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
pynose,
pytestCheckHook,
python-dateutil,
pythonOlder,
@ -28,7 +27,6 @@ buildPythonPackage rec {
dependencies = [ python-dateutil ];
nativeCheckInputs = [
pynose
pytestCheckHook
simplejson
];

View File

@ -2,7 +2,7 @@
lib,
buildPythonPackage,
fetchPypi,
pynose,
nose,
pythonOlder,
setuptools,
}:
@ -21,7 +21,10 @@ buildPythonPackage rec {
build-system = [ setuptools ];
nativeCheckInputs = [ pynose ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [ nose ];
pythonImportsCheck = [ "pytimeparse" ];

View File

@ -3,7 +3,7 @@
blockdiag,
buildPythonPackage,
fetchFromGitHub,
pynose,
nose,
pytestCheckHook,
pythonOlder,
setuptools,
@ -27,8 +27,11 @@ buildPythonPackage rec {
dependencies = [ blockdiag ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
pytestCheckHook
];

View File

@ -2,7 +2,8 @@
buildPythonPackage,
fetchFromGitHub,
lib,
pynose,
pythonOlder,
nose,
setuptools,
sphinx,
sphinx-rtd-theme,
@ -24,8 +25,11 @@ buildPythonPackage rec {
dependencies = [ sphinx-rtd-theme ];
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
sphinx
];

View File

@ -1,10 +1,10 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
setuptools,
pynose,
mock,
pytestCheckHook,
}:
buildPythonPackage rec {
@ -12,21 +12,21 @@ buildPythonPackage rec {
version = "4.0.1";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-mXY9qBv+qNr2s9ItEarMsBqND1LqUh2qs351ikyn0Sg=";
src = fetchFromGitHub {
owner = "jsocol";
repo = "pystatsd";
rev = "refs/tags/v${version}";
hash = "sha256-g830TjFERKUguFKlZeaOhCTlaUs0wcDg4bMdRDr3smw=";
};
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [
pynose
mock
pytestCheckHook
];
checkPhase = ''
nosetests -sv
'';
pytestFlagsArray = [ "statsd/tests.py" ];
meta = with lib; {
maintainers = with maintainers; [ domenkozar ];

View File

@ -2,11 +2,11 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
setuptools,
lxml,
matplotlib,
pytestCheckHook,
pynose,
nose,
}:
buildPythonPackage rec {
@ -21,16 +21,15 @@ buildPythonPackage rec {
hash = "sha256-ITvZx+3HMbTyaRmCb7tR0LKqCxGjqDdV9/2taziUD0c=";
};
nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];
propagatedBuildInputs = [
lxml
matplotlib
];
dependencies = [ lxml ];
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pytestCheckHook
pynose
nose
];
pythonImportsCheck = [ "svgutils" ];

View File

@ -3,7 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
pynose,
nose,
mock,
}:
@ -24,8 +24,11 @@ buildPythonPackage rec {
--replace-fail "assertEquals" "assertEqual"
'';
# tests rely on nose
doCheck = pythonOlder "3.12";
nativeCheckInputs = [
pynose
nose
mock
];

View File

@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
case,
fetchPypi,
pytestCheckHook,
pythonOlder,
@ -20,7 +19,6 @@ buildPythonPackage rec {
};
nativeCheckInputs = [
case
pytestCheckHook
];

View File

@ -2,7 +2,7 @@
lib,
buildPythonPackage,
fetchPypi,
pynose,
nose,
setuptools,
pythonOlder,
}:
@ -21,7 +21,10 @@ buildPythonPackage rec {
build-system = [ setuptools ];
nativeCheckInputs = [ pynose ];
# tests rely on nose, archived in 2020
doCheck = pythonOlder "3.12";
nativeCheckInputs = [ nose ];
checkPhase = ''
runHook preCheck

View File

@ -35,8 +35,10 @@ python3Packages.buildPythonApplication rec {
pexpect
];
doCheck = python3Packages.pythonOlder "3.12";
nativeCheckInputs = with python3Packages; [
pynose
nose
];
# Remove standard module argparse from requirements

View File

@ -33,6 +33,7 @@ in
### Deprecated aliases - for backward compatibility
mapAliases ({
aadict = throw "aadict was removed, it was introduced as a dependency for a package that never manifested and has been an unused leaf package ever since"; # added 2024-07-08
abodepy = jaraco-abode; # added 2023-02-01
acebinf = throw "acebinf has been removed because it is abandoned and broken."; # Added 2023-05-19
adafruit-nrfutil = throw "adafruit-nrfutil has been promoted to a top-level attribute name: `pkgs.adafruit-nrfutil`."; # Added 2023-11-19
@ -86,6 +87,7 @@ mapAliases ({
cacheyou = throw "cacheyou has been removed, as it was no longer used for the only consumer pdm"; # added 2023-12-21
cadquery = throw "cadquery was removed, because it was disabled on all python version since 3.8 and marked as broken"; # added 2024-05-13
carrot = throw "carrot has been removed, as its development was discontinued in 2012"; # added 2022-01-18
case = throw "case has been removed, since it is an unused leaf package with a dependency on the nose test framework"; # added 2024-07-08
cchardet = faust-cchardet; # added 2023-03-02
cepa = throw "cepa has been removed, as onionshare switched back to stem"; # added 2024-05-07
class-registry = phx-class-registry; # added 2021-10-05
@ -190,6 +192,7 @@ mapAliases ({
flufl_bounce = flufl-bounce; # added 2023-11-03
flufl_i18n = flufl-i18n; # added 2023-11-03
flufl_lock = flufl-lock; # added 2023-11-03
forbiddenfruit = throw "forbiddenfruit has been removed, because it was unmaintained and relied on the nose test framework"; # added 2024-07-08
FormEncode = formencode; # added 2023-02-19
foundationdb51 = throw "foundationdb51 is no longer maintained, use foundationdb71 instead"; # added 2023-06-06
foundationdb52 = throw "foundationdb52 is no longer maintained, use foundationdb71 instead"; # added 2023-06-06
@ -387,6 +390,7 @@ mapAliases ({
pymssql = throw "pymssql has been abandoned upstream."; # added 2020-05-04
PyMVGLive = pymvglive; # added 2023-02-19
pymyq = python-myq; # added 2023-10-20
pynose = throw "pynose was removed, because it violates the license of nose, by redistributing modified LGPL code under MIT.";
python-myq = throw "python-myq has been removed, as the service provider has decided to block its API requests"; # added 2023-12-07
pyqt4 = throw "pyqt4 has been removed, because it depended on the long EOL qt4"; # added 2022-06-09
pyqt5_sip = pyqt5-sip; # added 2024-01-07

View File

@ -25,8 +25,6 @@ self: super: with self; {
a2wsgi = callPackage ../development/python-modules/a2wsgi { };
aadict = callPackage ../development/python-modules/aadict { };
aafigure = callPackage ../development/python-modules/aafigure { };
aardwolf = callPackage ../development/python-modules/aardwolf { };
@ -1964,8 +1962,6 @@ self: super: with self; {
casbin = callPackage ../development/python-modules/casbin { };
case = callPackage ../development/python-modules/case { };
cashaddress = callPackage ../development/python-modules/cashaddress { };
cashews = callPackage ../development/python-modules/cashews { };
@ -4562,8 +4558,6 @@ self: super: with self; {
foolscap = callPackage ../development/python-modules/foolscap { };
forbiddenfruit = callPackage ../development/python-modules/forbiddenfruit { };
fordpass = callPackage ../development/python-modules/fordpass { };
forecast-solar = callPackage ../development/python-modules/forecast-solar { };
@ -10153,8 +10147,6 @@ self: super: with self; {
pynobo = callPackage ../development/python-modules/pynobo { };
pynose = callPackage ../development/python-modules/pynose { };
pynotifier = callPackage ../development/python-modules/pynotifier { };
pynuki = callPackage ../development/python-modules/pynuki { };