-
Notifications
You must be signed in to change notification settings - Fork 148
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
Include locales when installing the package #172
Conversation
Therefore when installing through a package manager, like Alpine's apk or Arch's pacman, all locales will also be available
Thank you for the PR! Please could you help me to understand the actual problem here? What actually happens now and how exactly does this help it? If I check the source $ find humanize-3.1.0 | grep "humanize.[mp]o"
humanize-3.1.0/src/humanize/locale/fa_IR/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/fa_IR/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/fi_FI/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/fi_FI/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/sk_SK/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/sk_SK/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/uk_UA/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/uk_UA/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/id_ID/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/id_ID/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/pt_BR/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/pt_BR/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/ko_KR/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/ko_KR/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/it_IT/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/it_IT/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/pt_PT/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/pt_PT/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/ja_JP/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/ja_JP/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/zh_CN/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/zh_CN/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/nl_NL/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/nl_NL/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/ru_RU/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/ru_RU/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/es_ES/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/es_ES/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/vi_VI/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/vi_VI/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/pl_PL/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/pl_PL/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/fr_FR/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/fr_FR/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/de_DE/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/de_DE/LC_MESSAGES/humanize.po
humanize-3.1.0/src/humanize/locale/tr_TR/LC_MESSAGES/humanize.mo
humanize-3.1.0/src/humanize/locale/tr_TR/LC_MESSAGES/humanize.po When I make an |
Hi Hugo!
On Tue, Oct 20, 2020 at 11:43:56PM -0700, Hugo van Kemenade wrote:
Thank you for the PR!
Please could you help me to understand the actual problem here? What
actually happens now and how exactly does this help it?
Sure thing! When installing the package via package manager, the
recommended way to do that is to run `python setup.py build` and `python
setup.py install` [1][2] you can see this on the Alpine build [3] and the Arch
build [4].
Without the `package_data` line, the locales are not installed within
the contents of the package.
If I check the source `.tar.gz` at
https://pypi.org/project/humanize/3.1.0/#files, it contains the locale
files:
Yes, although they will be only installed within the package if
installed via the pip command. It is *strongly* recommended the
installation of packages via the already installed and available system
package manager, specially if we're talking about things like
containers, where there's no conflict between different versions of a
package, etc.
I hope that made sense, thanks for your time!
…--
[1]: https://wiki.alpinelinux.org/wiki/Python_package_policies#Package_template
[2]: https://wiki.archlinux.org/index.php/Python_package_guidelines#Installation_methods
[3]: https://git.alpinelinux.org/aports/tree/testing/py3-humanize/APKBUILD
[4]: https://github.com/archlinux/svntogit-community/blob/packages/python-humanize/trunk/PKGBUILD
|
Thanks for the links!
I understand For example, from setuptools in 2017:
I see at least the Archlinux guidelines include using Please could you try that? |
On Wed, Oct 21, 2020 at 11:53:14PM -0700, Hugo van Kemenade wrote:
I see at least the [Archlinux
guidelines](https://wiki.archlinux.org/index.php/Python_package_guidelines)
include using `pip`/`setuptools`.
Please could you try that?
And the guidelines states that the recommended way is to use the `python
setup.py` method, as it doesn't add a lot of crap under the hood. Also
it's not my package, but I'll write the original packager to see if he
want to change. In the meantime, wouldn't be better to add support for
users who want to install via the `python setup.py` method? After all,
you already provides that file, this patch only adds one more line...
|
Thanks again for the PR, I'm going to close this because invoking Here's an explanation by one of the setuptools maintainers, with a summary of some replacements: |
Therefore when installing through a package manager, like
Alpine's apk or Arch's pacman, all locales will also be available
Fixes locales being missed when installing the package through a OS package manager
Changes proposed in this pull request: