From 195935f62631f519b15e15b2e1c7ff7cb5b667bd Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sat, 15 Jun 2019 10:30:05 +0200 Subject: [PATCH 1/5] pythonPackages.readchar: init at 2.0.0 --- .../python-modules/readchar/default.nix | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/readchar/default.nix diff --git a/pkgs/development/python-modules/readchar/default.nix b/pkgs/development/python-modules/readchar/default.nix new file mode 100644 index 00000000000..1ed4539dca0 --- /dev/null +++ b/pkgs/development/python-modules/readchar/default.nix @@ -0,0 +1,24 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, flake8, pytest, pytestcov, pexpect }: + +buildPythonPackage rec { + pname = "readchar"; + version = "2.0.0"; + + # Don't use wheels on PyPI + src = fetchFromGitHub { + owner = "magmax"; + repo = "python-${pname}"; + rev = version; + sha256 = "0j1vj4f2j8x5f40rs6h8qplklcxcdbvkkvjpkpmr1xagw05i12bm"; + }; + + nativeBuildInputs = [ flake8 ]; + checkInputs = [ pytest pytestcov pexpect ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/magmax/python-readchar"; + description = "Python library to read characters and key strokes"; + license = licenses.mit; + maintainers = [ maintainers.mmahut ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 828cf517d5c..8c2a45c9148 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4254,6 +4254,8 @@ in { readme_renderer = callPackage ../development/python-modules/readme_renderer { }; + readchar = callPackage ../development/python-modules/readchar { }; + rivet = disabledIf isPy3k (toPythonModule (pkgs.rivet.override { python2 = python; })); From 2088b61ffb7e7738f51f8ce9f4cbb16f70429002 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sat, 15 Jun 2019 10:31:42 +0200 Subject: [PATCH 2/5] pythonPackages.ptable: init at unstable-2019-06-14 The package name has been normalized to ptable from PTable. --- .../python-modules/ptable/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/ptable/default.nix diff --git a/pkgs/development/python-modules/ptable/default.nix b/pkgs/development/python-modules/ptable/default.nix new file mode 100644 index 00000000000..02429f589cf --- /dev/null +++ b/pkgs/development/python-modules/ptable/default.nix @@ -0,0 +1,27 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, nose }: + +buildPythonPackage rec { + pname = "ptable"; + version = "unstable-2019-06-14"; + + # https://github.com/kxxoling/PTable/issues/27 + src = fetchFromGitHub { + owner = "kxxoling"; + repo = "PTable"; + rev = "bcfdb92811ae1f39e1065f31544710bf87d3bc21"; + sha256 = "1cj314rp6irlvr0a2c4xffsm2idsb0hzwr38vzz6z3kbhphcb63i"; + }; + + checkInputs = [ nose ]; + + checkPhase = '' + nosetests --with-coverage --cover-package=prettytable --cover-min-percentage=75 + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/kxxoling/PTable"; + description = "A simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables"; + license = licenses.bsd3; + maintainers = [ maintainers.mmahut ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8c2a45c9148..72b06727f56 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3861,6 +3861,8 @@ in { prompt_toolkit = self.prompt_toolkit; }; + ptable = callPackage ../development/python-modules/ptable { }; + publicsuffix = callPackage ../development/python-modules/publicsuffix {}; py = callPackage ../development/python-modules/py { }; From 57e940205f86da916cddaea9ea7523810a9d7271 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sat, 15 Jun 2019 10:33:28 +0200 Subject: [PATCH 3/5] pythonPackages.validate-email: init at 1.3 The package name has been normalized to validate-email from validate_email. --- .../python-modules/validate-email/default.nix | 22 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/validate-email/default.nix diff --git a/pkgs/development/python-modules/validate-email/default.nix b/pkgs/development/python-modules/validate-email/default.nix new file mode 100644 index 00000000000..ea2c5a8db74 --- /dev/null +++ b/pkgs/development/python-modules/validate-email/default.nix @@ -0,0 +1,22 @@ +{ stdenv, buildPythonPackage, fetchPypi }: + +buildPythonPackage rec { + pname = "validate-email"; + version = "1.3"; + + src = fetchPypi { + inherit version; + pname = "validate_email"; + sha256 = "1bxffaf5yz2cph8ki55vdvdypbwkvn2xr1firlcy62vqbzf1jivq"; + }; + + # No tests + doCheck = false; + + meta = with stdenv.lib; { + homepage = "https://github.com/syrusakbary/validate_email"; + description = "Verify if an email address is valid and really exists"; + license = licenses.lgpl3Plus; + maintainers = [ maintainers.mmahut ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 72b06727f56..c91db0b4ded 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2471,6 +2471,8 @@ in { validictory = callPackage ../development/python-modules/validictory { }; + validate-email = callPackage ../development/python-modules/validate-email { }; + venusian = callPackage ../development/python-modules/venusian { }; chameleon = callPackage ../development/python-modules/chameleon { }; From d624a26c6a158643471a834d3a6d77e904a98c70 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sat, 15 Jun 2019 10:42:30 +0200 Subject: [PATCH 4/5] pythonPackages.inquirer: init at 2.6.3 --- .../python-modules/inquirer/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/inquirer/default.nix diff --git a/pkgs/development/python-modules/inquirer/default.nix b/pkgs/development/python-modules/inquirer/default.nix new file mode 100644 index 00000000000..58e7f61b676 --- /dev/null +++ b/pkgs/development/python-modules/inquirer/default.nix @@ -0,0 +1,32 @@ +{ stdenv, buildPythonPackage, fetchPypi, python-editor, readchar, blessings, pytest, pytestcov, pexpect, pytest-mock }: + +buildPythonPackage rec { + pname = "inquirer"; + version = "2.6.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "01lf51y3bxsxkghbdk9hr42yvihpwi2s5zpxnra3bx41r35msvjz"; + }; + + propagatedBuildInputs = [ python-editor readchar blessings ]; + + # No real changes in 2.0.0...e0edfa3 + postPatch = '' + substituteInPlace setup.py \ + --replace "readchar == 2.0.1" "readchar >= 2.0.0" + ''; + + checkInputs = [ pytest pytestcov pexpect pytest-mock ]; + + checkPhase = '' + pytest --cov-report=term-missing --cov inquirer --no-cov-on-fail tests/unit tests/integration + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/magmax/python-inquirer"; + description = "A collection of common interactive command line user interfaces, based on Inquirer.js"; + license = licenses.mit; + maintainers = [ maintainers.mmahut ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c91db0b4ded..69c1d46f0db 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -508,6 +508,8 @@ in { intelhex = callPackage ../development/python-modules/intelhex { }; + inquirer = callPackage ../development/python-modules/inquirer { }; + jira = callPackage ../development/python-modules/jira { }; jwcrypto = callPackage ../development/python-modules/jwcrypto { }; From 63bb864b34cb863beef0907eb95947f927a20a22 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sun, 16 Jun 2019 14:39:40 +0200 Subject: [PATCH 5/5] python3Packages.toggl-cli: init at 2.1.0 --- .../python-modules/toggl-cli/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/toggl-cli/default.nix diff --git a/pkgs/development/python-modules/toggl-cli/default.nix b/pkgs/development/python-modules/toggl-cli/default.nix new file mode 100644 index 00000000000..2c43ebf2c7e --- /dev/null +++ b/pkgs/development/python-modules/toggl-cli/default.nix @@ -0,0 +1,57 @@ +{ stdenv, buildPythonPackage, fetchPypi, twine, pbr, click, click-completion, validate-email, +pendulum, ptable, requests, inquirer, pythonOlder, pytest, pytestcov, pytest-mock, faker, factory_boy }: + + +buildPythonPackage rec { + pname = "toggl-cli"; + version = "2.1.0"; + + disabled = pythonOlder "3.5"; + + src = fetchPypi { + pname = "togglCli"; + inherit version; + sha256 = "0iirvvb8772569v28d36bnryksm1qkkw48d48fw26j7ka01qq6mm"; + }; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "click-completion==0.5.0" "click-completion>=0.5.0" \ + --replace "pbr==5.1.2" "pbr>=5.1.2" \ + --replace "inquirer==2.5.1" "inquirer>=2.5.1" + ''; + + nativeBuildInputs = [ pbr twine ]; + checkInputs = [ pbr pytest pytestcov pytest-mock faker factory_boy ]; + + preCheck = '' + export TOGGL_API_TOKEN=your_api_token + export TOGGL_PASSWORD=toggl_password + export TOGGL_USERNAME=user@example.com + ''; + + checkPhase = '' + runHook preCheck + pytest -k "not premium and not TestDateTimeType and not TestDateTimeField" tests/unit --maxfail=20 + runHook postCheck + ''; + + propagatedBuildInputs = [ + click + click-completion + validate-email + pendulum + ptable + requests + inquirer + pbr + ]; + + meta = with stdenv.lib; { + homepage = "https://toggl.uhlir.dev/"; + description = "Command line tool and set of Python wrapper classes for interacting with toggl's API"; + license = licenses.mit; + maintainers = [ maintainers.mmahut ]; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 69c1d46f0db..60ade77b04d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -980,6 +980,8 @@ in { tomlkit = callPackage ../development/python-modules/tomlkit { }; + toggl-cli = callPackage ../development/python-modules/toggl-cli { }; + unifi = callPackage ../development/python-modules/unifi { }; uvloop = callPackage ../development/python-modules/uvloop { };