git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #120447 from AluisioASG/aasg/dyndnsc-0.6.1

dyndnsc: 0.5.1 -> 0.6.1

commitc8dff328e51f62760bf646bc345e3aabcfd82046 authorRobert Schütz <dev@schuetz-co.de> dateFri 30 Apr 2021, 17:35 (6 years ago) parentfdd6ca8093ab98
4 files changed+98−3
pkgs/applications/networking/dyndns/dyndnsc/default.nix+4−3 pkgs/development/python-modules/json-logging/default.nix+49 pkgs/development/python-modules/pytest-console-scripts/default.nix+41 pkgs/top-level/python-packages.nix+4
pkgs/applications/networking/dyndns/dyndnsc/default.nix+4−3
@@ -2,11 +2,11 @@
22
33python3Packages.buildPythonApplication rec {
44 pname = "dyndnsc";
5− version = "0.5.1";
5+ version = "0.6.1";
66
77 src = python3Packages.fetchPypi {
88 inherit pname version;
9− hash = "sha256-Sy6U0XhIQ9mPmznmWKqoyqE34vaE84fwlivouaF7Dd0=";
9+ sha256 = "13078d29eea2f9a4ca01f05676c3309ead5e341dab047e0d51c46f23d4b7fbb4";
1010 };
1111
1212 postPatch = ''
@@ -19,9 +19,10 @@ python3Packages.buildPythonApplication rec {
1919 dnspython
2020 netifaces
2121 requests
22+ json-logging
2223 setuptools
2324 ];
24− checkInputs = with python3Packages; [ bottle pytestCheckHook ];
25+ checkInputs = with python3Packages; [ bottle mock pytest-console-scripts pytestCheckHook ];
2526
2627 disabledTests = [
2728 # dnswanip connects to an external server to discover the
pkgs/development/python-modules/json-logging/default.nixnew file+49
@@ -0,0 +1,49 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, fetchpatch
5+, pytestCheckHook
6+, wheel
7+, flask
8+, sanic
9+, fastapi
10+, uvicorn
11+, requests
12+}:
13+
14+buildPythonPackage rec {
15+ pname = "json-logging";
16+ version = "1.3.0";
17+
18+ src = fetchFromGitHub {
19+ owner = "bobbui";
20+ repo = "json-logging-python";
21+ rev = version;
22+ hash = "sha256-0eIhOi30r3ApyVkiBdTQps5tNj7rI+q8TjNWxTnhtMQ=";
23+ };
24+ patches = [
25+ # Fix tests picking up test modules instead of real packages.
26+ (fetchpatch {
27+ url = "https://github.com/bobbui/json-logging-python/commit/6fdb64deb42fe48b0b12bda0442fd5ac5f03107f.patch";
28+ sha256 = "sha256-BLfARsw2FdvY22NCaFfdFgL9wTmEZyVIi3CQpB5qU0Y=";
29+ })
30+ ];
31+
32+ # - Quart is not packaged for Nixpkgs.
33+ # - FastAPI is broken, see #112701 and tiangolo/fastapi#2335.
34+ checkInputs = [ wheel flask /*quart*/ sanic /*fastapi*/ uvicorn requests pytestCheckHook ];
35+ disabledTests = [ "quart" "fastapi" ];
36+ disabledTestPaths = [ "tests/test_fastapi.py" ];
37+ # Tests spawn servers and try to connect to them.
38+ __darwinAllowLocalNetworking = true;
39+
40+ meta = with lib; {
41+ description = "Python library to emit logs in JSON format";
42+ longDescription = ''
43+ Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver.
44+ '';
45+ homepage = "https://github.com/bobbui/json-logging-python";
46+ license = licenses.asl20;
47+ maintainers = with maintainers; [ AluisioASG ];
48+ };
49+}
pkgs/development/python-modules/pytest-console-scripts/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, pytestCheckHook
5+, python
6+, mock
7+, setuptools-scm
8+}:
9+
10+buildPythonPackage rec {
11+ pname = "pytest-console-scripts";
12+ version = "1.2.0";
13+
14+ src = fetchPypi {
15+ inherit pname version;
16+ sha256 = "4a2138d7d567bc581fe081b6a5975849a2a36b3925cb0f066d2380103e13741c";
17+ };
18+ postPatch = ''
19+ # setuptools-scm is pinned to <6 because it dropped Python 3.5
20+ # support. That's not something that affects us.
21+ substituteInPlace setup.py --replace "'setuptools_scm<6'" "'setuptools_scm'"
22+ # Patch the shebang of a script generated during test.
23+ substituteInPlace tests/test_run_scripts.py --replace "#!/usr/bin/env python" "#!${python.interpreter}"
24+ '';
25+
26+ SETUPTOOLS_SCM_PRETEND_VERSION = version;
27+ nativeBuildInputs = [ setuptools-scm ];
28+
29+ checkInputs = [ mock pytestCheckHook ];
30+
31+ meta = with lib; {
32+ description = "Pytest plugin for testing console scripts";
33+ longDescription = ''
34+ Pytest-console-scripts is a pytest plugin for running python scripts from within tests.
35+ It's quite similar to subprocess.run(), but it also has an in-process mode, where the scripts are executed by the interpreter that's running pytest (using some amount of sandboxing).
36+ '';
37+ homepage = "https://github.com/kvas-it/pytest-console-scripts";
38+ license = licenses.mit;
39+ maintainers = with maintainers; [ AluisioASG ];
40+ };
41+}
pkgs/top-level/python-packages.nix+4
@@ -3443,6 +3443,8 @@ in {
34433443
34443444 jsonlines = callPackage ../development/python-modules/jsonlines { };
34453445
3446+ json-logging = callPackage ../development/python-modules/json-logging { };
3447+
34463448 jsonmerge = callPackage ../development/python-modules/jsonmerge { };
34473449
34483450 json-merge-patch = callPackage ../development/python-modules/json-merge-patch { };
@@ -6259,6 +6261,8 @@ in {
62596261
62606262 pytest-click = callPackage ../development/python-modules/pytest-click { };
62616263
6264+ pytest-console-scripts = callPackage ../development/python-modules/pytest-console-scripts { };
6265+
62626266 pytest-cov = self.pytestcov; # self 2021-01-04
62636267 pytestcov = callPackage ../development/python-modules/pytest-cov { };
62646268