Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyndnsc: 0.5.1 -> 0.6.1 #120447

Merged
merged 3 commits into from Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkgs/applications/networking/dyndns/dyndnsc/default.nix
Expand Up @@ -2,11 +2,11 @@

python3Packages.buildPythonApplication rec {
pname = "dyndnsc";
version = "0.5.1";
version = "0.6.1";

src = python3Packages.fetchPypi {
inherit pname version;
hash = "sha256-Sy6U0XhIQ9mPmznmWKqoyqE34vaE84fwlivouaF7Dd0=";
sha256 = "13078d29eea2f9a4ca01f05676c3309ead5e341dab047e0d51c46f23d4b7fbb4";
};

postPatch = ''
Expand All @@ -19,9 +19,10 @@ python3Packages.buildPythonApplication rec {
dnspython
netifaces
requests
json-logging
setuptools
];
checkInputs = with python3Packages; [ bottle pytestCheckHook ];
checkInputs = with python3Packages; [ bottle mock pytest-console-scripts pytestCheckHook ];

disabledTests = [
# dnswanip connects to an external server to discover the
Expand Down
49 changes: 49 additions & 0 deletions pkgs/development/python-modules/json-logging/default.nix
@@ -0,0 +1,49 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pytestCheckHook
, wheel
, flask
, sanic
, fastapi
, uvicorn
, requests
}:

buildPythonPackage rec {
pname = "json-logging";
version = "1.3.0";

src = fetchFromGitHub {
owner = "bobbui";
repo = "json-logging-python";
rev = version;
hash = "sha256-0eIhOi30r3ApyVkiBdTQps5tNj7rI+q8TjNWxTnhtMQ=";
};
patches = [
# Fix tests picking up test modules instead of real packages.
(fetchpatch {
url = "https://github.com/bobbui/json-logging-python/commit/6fdb64deb42fe48b0b12bda0442fd5ac5f03107f.patch";
sha256 = "sha256-BLfARsw2FdvY22NCaFfdFgL9wTmEZyVIi3CQpB5qU0Y=";
})
];

# - Quart is not packaged for Nixpkgs.
# - FastAPI is broken, see #112701 and tiangolo/fastapi#2335.
checkInputs = [ wheel flask /*quart*/ sanic /*fastapi*/ uvicorn requests pytestCheckHook ];
disabledTests = [ "quart" "fastapi" ];
disabledTestPaths = [ "tests/test_fastapi.py" ];
# Tests spawn servers and try to connect to them.
__darwinAllowLocalNetworking = true;

meta = with lib; {
description = "Python library to emit logs in JSON format";
longDescription = ''
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.
'';
homepage = "https://github.com/bobbui/json-logging-python";
license = licenses.asl20;
maintainers = with maintainers; [ AluisioASG ];
};
}
41 changes: 41 additions & 0 deletions pkgs/development/python-modules/pytest-console-scripts/default.nix
@@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, python
, mock
, setuptools-scm
}:

buildPythonPackage rec {
pname = "pytest-console-scripts";
version = "1.2.0";

src = fetchPypi {
inherit pname version;
sha256 = "4a2138d7d567bc581fe081b6a5975849a2a36b3925cb0f066d2380103e13741c";
};
postPatch = ''
# setuptools-scm is pinned to <6 because it dropped Python 3.5
# support. That's not something that affects us.
substituteInPlace setup.py --replace "'setuptools_scm<6'" "'setuptools_scm'"
# Patch the shebang of a script generated during test.
substituteInPlace tests/test_run_scripts.py --replace "#!/usr/bin/env python" "#!${python.interpreter}"
AluisioASG marked this conversation as resolved.
Show resolved Hide resolved
'';

SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [ setuptools-scm ];

checkInputs = [ mock pytestCheckHook ];

meta = with lib; {
description = "Pytest plugin for testing console scripts";
longDescription = ''
Pytest-console-scripts is a pytest plugin for running python scripts from within tests.
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).
'';
homepage = "https://github.com/kvas-it/pytest-console-scripts";
license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -3443,6 +3443,8 @@ in {

jsonlines = callPackage ../development/python-modules/jsonlines { };

json-logging = callPackage ../development/python-modules/json-logging { };

jsonmerge = callPackage ../development/python-modules/jsonmerge { };

json-merge-patch = callPackage ../development/python-modules/json-merge-patch { };
Expand Down Expand Up @@ -6259,6 +6261,8 @@ in {

pytest-click = callPackage ../development/python-modules/pytest-click { };

pytest-console-scripts = callPackage ../development/python-modules/pytest-console-scripts { };

pytest-cov = self.pytestcov; # self 2021-01-04
pytestcov = callPackage ../development/python-modules/pytest-cov { };

Expand Down