From 09d6b372d60a22eaa9cd9b941b24949bd43dc977 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 15:40:57 -0400 Subject: [PATCH] pythonPackages.fake_factory: refactor move to python-modules --- .../python-modules/fake_factory/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 23 +------------ 2 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 pkgs/development/python-modules/fake_factory/default.nix diff --git a/pkgs/development/python-modules/fake_factory/default.nix b/pkgs/development/python-modules/fake_factory/default.nix new file mode 100644 index 000000000000..26dd14b73adf --- /dev/null +++ b/pkgs/development/python-modules/fake_factory/default.nix @@ -0,0 +1,33 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, python +, six +, dateutil +, ipaddress +, mock +}: + +buildPythonPackage rec { + pname = "fake-factory"; + version = "0.6.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "09sgk0kylsshs64a1xsz3qr187sbnqrbf4z8k3dgsy32lsgyffv2"; + }; + + propagatedBuildInputs = [ six dateutil ipaddress mock ]; + checkPhase = '' + ${python.interpreter} -m unittest faker.tests + ''; + + meta = with stdenv.lib; { + description = "A Python package that generates fake data for you"; + homepage = https://pypi.python.org/pypi/fake-factory; + license = licenses.mit; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 208a2e4cc0f8..a597d4264018 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1754,28 +1754,7 @@ in { faker = callPackage ../development/python-modules/faker { }; - fake_factory = buildPythonPackage rec { - name = "fake-factory-${version}"; - version = "0.6.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/f/fake-factory/${name}.tar.gz"; - sha256 = "09sgk0kylsshs64a1xsz3qr187sbnqrbf4z8k3dgsy32lsgyffv2"; - }; - - propagatedBuildInputs = with self; [ six dateutil ipaddress mock ]; - checkPhase = '' - ${python.interpreter} -m unittest faker.tests - ''; - - meta = { - description = "A Python package that generates fake data for you"; - homepage = https://pypi.python.org/pypi/fake-factory; - license = licenses.mit; - maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.unix; - }; - }; + fake_factory = callPackage ../development/python-modules/fake_factory { }; factory_boy = buildPythonPackage rec { name = "factory_boy-${version}";