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

Include locales when installing the package #172

Closed
wants to merge 1 commit into from

Conversation

pedrolucasp
Copy link

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:

  • Installation of the locales within the package installation

Therefore when installing through a package manager, like
Alpine's apk or Arch's pacman, all locales will also be available
@hugovk
Copy link
Collaborator

hugovk commented Oct 21, 2020

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 .tar.gz at https://pypi.org/project/humanize/3.1.0/#files, it contains the locale files:

$ 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 sdist of this change, the contents are identical (except for version number and the new line in setup.py):

image

image

image

@pedrolucasp
Copy link
Author

pedrolucasp commented Oct 21, 2020 via email

@hugovk
Copy link
Collaborator

hugovk commented Oct 22, 2020

Thanks for the links!

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.

I understand python setup.py X (and distutils) is discouraged/deprecated by Python packaging, and only pip install ./pip install -e . (using setuptools) are supported here.

For example, from setuptools in 2017:

setup.py install invokes the egg protocol which was famously deprecated. I'd say it's unsupported to support mixed-method environments. It's difficult enough trying to support namespace packages in just one or the other modes.

First and foremost, I want to support pip install ., pip install -e .. Secondarily, I want to support pure non-pip installs through setup.py install and setup.py develop, although I consider that model (soft) deprecated and will eventually be superseded by pip entirely.


I see at least the Archlinux guidelines include using pip/setuptools.

Please could you try that?

@pedrolucasp
Copy link
Author

pedrolucasp commented Nov 3, 2020 via email

@hugovk
Copy link
Collaborator

hugovk commented Jan 30, 2022

Thanks again for the PR, I'm going to close this because invoking setup.py has been unmainaintained by setuptools for years and we should rather move tooling to use the alternatives.

Here's an explanation by one of the setuptools maintainers, with a summary of some replacements:

@hugovk hugovk closed this Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants