Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: Plural value must be an integer, got float #106

Closed
mtelka opened this issue Apr 2, 2023 · 10 comments · Fixed by #147
Closed

DeprecationWarning: Plural value must be an integer, got float #106

mtelka opened this issue Apr 2, 2023 · 10 comments · Fixed by #147
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mtelka
Copy link

mtelka commented Apr 2, 2023

What did you do?

I ran tests.

What did you expect to happen?

Tests pass without warnings.

What actually happened?

The following warning was reported:

=============================== warnings summary ===============================
tests/test_i18n.py::test_i18n
  $(@D)/src/humanize/i18n.py:133: DeprecationWarning: Plural value must be an integer, got float
    return get_translation().ngettext(message, plural, num)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

What versions are you using?

  • OS: OpenIndiana
  • Python: 3.9.16
  • Humanize: 4.6.0
@hugovk
Copy link
Member

hugovk commented Apr 2, 2023

Thanks for the report, a PR is welcome!

@hugovk hugovk added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 2, 2023
@dansarpong
Copy link
Contributor

Hello, I would like to work on this issue. If you don't mind, could you tell me how to run the test and achieve the same results so that I can my hands on fixing it?

Thanks!

@hugovk
Copy link
Member

hugovk commented Oct 2, 2023

Sure, something like this. Assuming you've already forked and cloned, then:

# First do an editable install
pip install -e ".[tests]"

# Generate translations
scripts/generate-translation-binaries.sh
$ # Then run tests
$ pytest tests/test_i18n.py
================================================================================================ test session starts ================================================================================================
platform darwin -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
rootdir: /Users/hugo/github/humanize
configfile: pyproject.toml
plugins: random-order-1.1.0, anyio-4.0.0, asyncio-0.21.0, flaky-3.7.0, timeout-2.1.0, cov-4.1.0, respx-0.20.1, mock-3.11.1, xdist-3.3.1, hypothesis-6.75.2, lazy-fixture-0.6.3, aiohttp-1.0.4
asyncio: mode=Mode.STRICT
collected 28 items

tests/test_i18n.py ............................                                                                                                                                                               [100%]

================================================================================================= warnings summary ==================================================================================================
tests/test_i18n.py::test_i18n
  /Users/hugo/github/humanize/src/humanize/i18n.py:126: DeprecationWarning: Plural value must be an integer, got float
    return get_translation().ngettext(message, plural, num)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================== 28 passed, 1 warning in 0.04s ===========================================================================================

@dansarpong
Copy link
Contributor

Alright, I believe i can handle this.
Could you assign it to me?

Ps: Could you also kindly add the hacktoberfest label too?
Thanks!

@hugovk
Copy link
Member

hugovk commented Oct 2, 2023

We don't normally assign issues but go ahead. Also the repo already has the Hacktoberfest topic, so we don't need to label it. Thanks!

@dansarpong
Copy link
Contributor

Apologies as this is my first PR, but how do I run the checks required? I didn't find anything related to that from the Contributing docs

@hugovk
Copy link
Member

hugovk commented Oct 3, 2023

For new contributors, I need to click a button to approve the CI run. It's a GitHub default to prevent cryptocoin mining. I've now clicked it! ⏯️

@dansarpong
Copy link
Contributor

Hello @hugovk, is there any guideline I may have overlooked? I have refixed the code and passed the tests, but it hasn't been merged yet so I was wondering if there is something I might have missed. Apologies if I'm being such a bother at the moment.

@hugovk
Copy link
Member

hugovk commented Oct 6, 2023

Hi there, everything looks in place, I just need to find some time to give it a review. Don't worry, I expect we can get it all sorted during October :) Thanks!

@dansarpong
Copy link
Contributor

Alright then.
Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants