Skip to content

Commit

Permalink
Add hook for humanize to collect package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed May 26, 2021
1 parent af92d6b commit 87fe1bc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/122.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for `humanize <https://pypi.org/project/humanize>`__ to include required metadata.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ boto3==1.12.33
botocore==1.15.33
dash==1.19.0
dash-bootstrap-components==0.12.0
humanize==3.5.0
iminuit==2.4.0
markdown==3.2.1
openpyxl==3.0.3
Expand Down
24 changes: 24 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-humanize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

"""
This modest package contains various common humanization utilities, like turning a number into a fuzzy human
readable duration ("3 minutes ago") or into a human readable size or throughput.
https://pypi.org/project/humanize
This hook was tested against humanize 3.5.0.
"""

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('humanize')
10 changes: 10 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ def test_pendulum(pyi_builder):
""")


@importorskip('humanize')
def test_humanize(pyi_builder):
pyi_builder.test_source("""
import humanize
from datetime import timedelta
print(humanize.naturaldelta(timedelta(seconds=125)))
""")


@importorskip('argon2')
def test_argon2(pyi_builder):
pyi_builder.test_source("""
Expand Down

0 comments on commit 87fe1bc

Please sign in to comment.