Skip to content

Commit

Permalink
Merge pull request NixOS#159879 from prusnak/cypherpunkpay
Browse files Browse the repository at this point in the history
python3Packages.cypherpunkpay: init at 1.0.15
  • Loading branch information
prusnak authored Apr 15, 2022
2 parents 1a523e4 + da7db62 commit 92d1f76
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 2 deletions.
97 changes: 97 additions & 0 deletions pkgs/development/python-modules/cypherpunkpay/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, APScheduler
, bitstring
, cffi
, ecdsa
, monero
, pypng
, pyqrcode
, pyramid
, pyramid_jinja2
, pysocks
, requests
, tzlocal
, waitress
, yoyo-migrations
, pytestCheckHook
, pytest-cov
, webtest
}:

buildPythonPackage rec {
pname = "cypherpunkpay";
version = "1.0.15";
format = "pyproject";

src = fetchFromGitHub {
owner = "CypherpunkPay";
repo = "CypherpunkPay";
rev = "v${version}";
sha256 = "sha256-W2f4jtEqopDXiXx0pklZrjOmVhpx2kDdTJRPm2Ka0Cg=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace 'monero = "^0.99"' 'monero = ">=0.99"' \
--replace 'pypng = "^0.0.20"' 'pypng = ">=0.0.20"' \
--replace 'tzlocal = "2.1"' 'tzlocal = ">=2.1"'
'';

nativeBuildInputs = [
poetry-core
];

propagatedBuildInputs = [
APScheduler
bitstring
cffi
ecdsa
monero
pypng
pyqrcode
pyramid
pyramid_jinja2
pysocks
requests
tzlocal
waitress
yoyo-migrations
];

checkInputs = [
pytestCheckHook
pytest-cov
webtest
];

disabledTestPaths = [
# performance test
"test/unit/tools/pbkdf2_test.py"
# tests require network connection
"test/network/explorers/bitcoin"
"test/network/net/http_client"
"test/network/prices"
# tests require bitcoind running
"test/network/full_node_clients"
# tests require lnd running
"test/network/ln"
# tests require tor running
"test/network/net/tor_client"
# tests require the full environment running
"test/acceptance/views"
"test/acceptance/views_admin"
"test/acceptance/views_donations"
"test/acceptance/views_dummystore"
];

meta = with lib; {
description = "Modern self-hosted software for accepting Bitcoin";
homepage = "https://cypherpunkpay.org";
license = with licenses; [ mit /* or */ unlicense ];
maintainers = with maintainers; [ prusnak ];
};
}
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/monero/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pycryptodomex
, pysocks
, pynacl
, requests
, six
, varint
, pytestCheckHook
, pytest-cov
, responses
}:

buildPythonPackage rec {
pname = "monero";
version = "1.0.1";

src = fetchFromGitHub {
owner = "monero-ecosystem";
repo = "monero-python";
rev = "v${version}";
sha256 = "sha256-ZjAShIeGVVIKlwgSNPVSN7eaqhKu3wEpDP9wgBMOyZU=";
};

postPatch = ''
substituteInPlace requirements.txt \
--replace 'pynacl~=1.4' 'pynacl>=1.4' \
--replace 'ipaddress' ""
'';

pythonImportsCheck = [ "monero" ];

propagatedBuildInputs = [
pycryptodomex
pynacl
pysocks
requests
six
varint
];

checkInputs = [ pytestCheckHook pytest-cov responses ];

meta = with lib; {
description = "Comprehensive Python module for handling Monero";
homepage = "https://github.com/monero-ecosystem/monero-python";
license = licenses.bsd3;
maintainers = with maintainers; [ prusnak ];
};
}
29 changes: 29 additions & 0 deletions pkgs/development/python-modules/pypng/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "pypng";
version = "0.0.21";
format = "pyproject";

src = fetchFromGitHub {
owner = "drj11";
repo = "pypng";
rev = "${pname}-${version}";
sha256 = "sha256-JU1GCSTm2s6Kczn6aRcF5DizPJVpizNtnAMJxTBi9vo=";
};

pythonImportsCheck = [ "png" ];

checkInputs = [ pytestCheckHook ];

meta = with lib; {
description = "Pure Python library for PNG image encoding/decoding";
homepage = "https://github.com/drj11/pypng";
license = licenses.mit;
maintainers = with maintainers; [ prusnak ];
};
}
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/waitress/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

buildPythonPackage rec {
pname = "waitress";
version = "2.0.0";
version = "2.1.1";

src = fetchPypi {
inherit pname version;
sha256 = "69e1f242c7f80273490d3403c3976f3ac3b26e289856936d1f620ed48f321897";
sha256 = "e2e60576cf14a1539da79f7b7ee1e79a71e64f366a0b47db54a15e971f57bb16";
};

doCheck = false;
Expand Down
30 changes: 30 additions & 0 deletions pkgs/development/python-modules/yoyo-migrations/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, sqlparse
, tabulate
}:

buildPythonPackage rec {
pname = "yoyo-migrations";
version = "7.3.2";

src = fetchPypi {
inherit pname version;
sha256 = "sha256-RIQIKOGgFp9UHnAtWu3KgYWtpoCH57rUhQpvxdced6Q=";
};

propagatedBuildInputs = [ setuptools sqlparse tabulate ];

doCheck = false; # pypi tarball does not contain tests

pythonImportsCheck = [ "yoyo" ];

meta = with lib; {
description = "Database schema migration tool";
homepage = "https://ollycope.com/software/yoyo";
license = licenses.asl20;
maintainers = with maintainers; [ prusnak ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,8 @@ in {

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

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

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

cython = callPackage ../development/python-modules/Cython { };
Expand Down Expand Up @@ -5241,6 +5243,8 @@ in {

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

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

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

mongodict = callPackage ../development/python-modules/mongodict { };
Expand Down Expand Up @@ -7422,6 +7426,8 @@ in {
inherit (pkgs) jq;
};

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

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

pyopencl = callPackage ../development/python-modules/pyopencl {
Expand Down Expand Up @@ -10992,6 +10998,8 @@ in {
phantomjsSupport = false;
};

yoyo-migrations = callPackage ../development/python-modules/yoyo-migrations { };

yt-dlp = callPackage ../tools/misc/yt-dlp { };

yt-dlp-light = callPackage ../tools/misc/yt-dlp {
Expand Down

0 comments on commit 92d1f76

Please sign in to comment.