diff --git a/pkgs/development/python-modules/tinycss/default.nix b/pkgs/development/python-modules/tinycss/default.nix new file mode 100644 index 000000000000..ab6a4183df50 --- /dev/null +++ b/pkgs/development/python-modules/tinycss/default.nix @@ -0,0 +1,35 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, pytest +, python +, cssutils +, isPyPy +}: + +buildPythonPackage rec { + pname = "tinycss"; + version = "0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e"; + }; + + checkInputs = [ pytest ]; + propagatedBuildInputs = [ cssutils ]; + + checkPhase = '' + py.test $out/${python.sitePackages} + ''; + + # Disable Cython tests for PyPy + TINYCSS_SKIP_SPEEDUPS_TESTS = pkgs.lib.optional isPyPy true; + + meta = with pkgs.lib; { + description = "Complete yet simple CSS parser for Python"; + license = licenses.bsd3; + homepage = https://pythonhosted.org/tinycss/; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 57f8c947fcc5..62b77b187bc7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1979,32 +1979,7 @@ in { pytest-sugar = callPackage ../development/python-modules/pytest-sugar { }; - tinycss = buildPythonPackage rec { - name = "tinycss-${version}"; - version = "0.3"; - - src = pkgs.fetchurl { - url = "mirror://pypi/t/tinycss/${name}.tar.gz"; - sha256 = "1pichqra4wk86142hqgvy9s5x6c5k5zhy8l9qxr0620pqk8spbd4"; - }; - - buildInputs = with self; [ pytest ]; - - propagatedBuildInputs = with self; [ cssutils ]; - - checkPhase = '' - py.test $out/${python.sitePackages} - ''; - - # Disable Cython tests for PyPy - TINYCSS_SKIP_SPEEDUPS_TESTS = optional isPyPy true; - - meta = { - description = "Complete yet simple CSS parser for Python"; - license = licenses.bsd3; - homepage = https://pythonhosted.org/tinycss/; - }; - }; + tinycss = callPackage ../development/python-modules/tinycss { }; tinycss2 = callPackage ../development/python-modules/tinycss2 { };