Merge pull request #63092 from mmahut/togglcli

pythonPackages.toggl-cli: init at 2.1.0 (and its dependencies)
This commit is contained in:
worldofpeace
2019-06-18 14:53:48 -04:00
committed by GitHub
6 changed files with 172 additions and 0 deletions

View File

@@ -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 ];
};
}

View File

@@ -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 ];
};
}

View File

@@ -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 ];
};
}

View File

@@ -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 ];
};
}

View File

@@ -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 ];
};
}