diff options
author | OTABI Tomoya <tomoya.otabi@gmail.com> | 2024-03-08 10:52:59 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 10:52:59 +0900 |
commit | 0a4cf33acd837bddab7151e9150c41085b24ff56 (patch) | |
tree | 5534823da6601bc4ae3db0e4acf9989c66035a74 | |
parent | 29af6415a01f573bb12b070db44df1ea14de6c55 (diff) | |
parent | e5693c35e1f7bd52b249e7d35d5cea5655ce2417 (diff) |
Merge pull request #294132 from ViZiD/hurry-filesize
python3Packages.hurry-filesize: init at 0.9
3 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/hurry-filesize/default.nix b/pkgs/development/python-modules/hurry-filesize/default.nix new file mode 100644 index 0000000000000..62bd1f810f9d5 --- /dev/null +++ b/pkgs/development/python-modules/hurry-filesize/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchPypi + +, pythonOlder + +, setuptools +}: + +buildPythonPackage rec { + pname = "hurry-filesize"; + version = "0.9"; + pyproject = true; + + disabled = pythonOlder "3.3"; + + src = fetchPypi { + pname = "hurry.filesize"; + inherit version; + hash = "sha256-9TaDKa2++GrM07yUkFIjQLt5JgRVromxpCwQ9jgBuaY="; + }; + + # project has no repo... + # fix implicit namespaces (PEP 420) warning + patches = [ ./use-pep-420-implicit-namespace-package.patch ]; + + build-system = [ + setuptools + ]; + + pythonImportsCheck = [ "hurry.filesize" ]; + + meta = with lib; { + description = "A simple Python library for human readable file sizes (or anything sized in bytes)"; + homepage = "https://pypi.org/project/hurry.filesize/"; + license = licenses.zpl21; + maintainers = with maintainers; [ vizid ]; + }; +} diff --git a/pkgs/development/python-modules/hurry-filesize/use-pep-420-implicit-namespace-package.patch b/pkgs/development/python-modules/hurry-filesize/use-pep-420-implicit-namespace-package.patch new file mode 100644 index 0000000000000..788c603ac5303 --- /dev/null +++ b/pkgs/development/python-modules/hurry-filesize/use-pep-420-implicit-namespace-package.patch @@ -0,0 +1,24 @@ +diff --git a/setup.py b/setup.py +index 9ec6f2e..607b680 100644 +--- a/setup.py ++++ b/setup.py +@@ -29,7 +29,6 @@ setup( + license='ZPL 2.1', + packages=find_packages('src'), + package_dir= {'':'src'}, +- namespace_packages=['hurry'], + include_package_data=True, + zip_safe=False, + install_requires=[ +diff --git a/src/hurry/__init__.py b/src/hurry/__init__.py +index 2e2033b..e69de29 100644 +--- a/src/hurry/__init__.py ++++ b/src/hurry/__init__.py +@@ -1,7 +0,0 @@ +-# this is a namespace package +-try: +- import pkg_resources +- pkg_resources.declare_namespace(__name__) +-except ImportError: +- import pkgutil +- __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b73c25df3b31c..4f1a8b799378b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5418,6 +5418,8 @@ self: super: with self; { hupper = callPackage ../development/python-modules/hupper { }; + hurry-filesize = callPackage ../development/python-modules/hurry-filesize { }; + huum = callPackage ../development/python-modules/huum { }; hvac = callPackage ../development/python-modules/hvac { }; |