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

WIP issue #84 #104

Closed
wants to merge 1 commit into from
Closed

WIP issue #84 #104

wants to merge 1 commit into from

Conversation

TinoDidriksen
Copy link
Member

Install step install_data puts the extra files into /usr/apertium_apy instead of /usr/lib/python3.6/dist-packages/apertium_apy or /usr/share/apertium-apy

It's a known bug pypa/setuptools#130 , and it's even marked wontfix with this comment pypa/setuptools#130 (comment) :

the plan to deprecate easy_install and setuptools' mechanisms for installing packages

As per https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files if one uses

    package_data={
        'apertium_apy': ['README.md', 'COPYING', 'langNames.db'],
    },

then those files are included, but they must first exist in the apertium_apy folder (which the make step can make sure they do).

How to include tools/ is left as an exercise to the reader - meaning, I don't see why they make sense in the Python folder, and I don't want to fight this absurdity of a tool.

@TinoDidriksen TinoDidriksen requested a review from sushain97 April 5, 2018 07:57
@coveralls
Copy link

Pull Request Test Coverage Report for Build 817

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 43.325%

Totals Coverage Status
Change from base Build 816: 0.0%
Covered Lines: 1006
Relevant Lines: 2086

💛 - Coveralls

@sushain97
Copy link
Member

I'm not sure I understand what the problem is with them going into /usr/apertium_apy? No matter where they go, if someone uses the new apertium-apy console script, they'll have to give it the full path and putting it in dist_packages means the path is now dependent on your Python version which sounds awful. We can give it an absolute path so it installs to /usr/share/apertium_apy, that's easy.

@TinoDidriksen
Copy link
Member Author

A package is absolutely not allowed to create folders directly under /usr. And if created under /usr/share, it must be dash apertium-apy instead of underscore apertium_apy. If that's what you prefer, sure make that happen.

I thought langNames.db was automatically searched for in the script paths? If not, that should be done.

Also, README.md and COPYING will be included as part of the packaging itself - they don't even need to be installed by the source. A whole folder for a single file feels excessive, and it's against the setuptools ethos to install anything outside the Python folder (asides from bin).

@apertium apertium deleted a comment from coveralls Apr 5, 2018
@apertium apertium deleted a comment from coveralls Apr 5, 2018
@apertium apertium deleted a comment from coveralls Apr 5, 2018
@sushain97
Copy link
Member

sushain97 commented Apr 5, 2018

I thought langNames.db was automatically searched for in the script paths? If not, that should be done.

It's not. A new issue for that makes sense.

A package is absolutely not allowed to create folders directly under /usr. And if created under /usr/share, it must be dash apertium-apy instead of underscore apertium_apy. If that's what you prefer, sure make that happen.

Yeah, let's do this. I prefer it instead of a bunch of hacks. Working on it.

@sushain97
Copy link
Member

sushain97 commented Apr 5, 2018

Sigh: pypa/wheel#92 ... makes absolute paths a mess.

@sushain97
Copy link
Member

Hmm, it never installs directly to /usr for me:

$ ls -R /usr/local/apertium*
/usr/local/apertium_apy:
COPYING      README.md    langNames.db tools

/usr/local/apertium_apy/tools:
apertium-recaptcha-test.html serverlist-example           sysvinit
apertium-viewer.html         systemd                      upstart

/usr/local/apertium_apy/tools/systemd:
README      apy.service

/usr/local/apertium_apy/tools/sysvinit:
apy.sh

/usr/local/apertium_apy/tools/upstart:
apertium                  apertium-all.conf         apertium-apy-gateway.conf apertium-apy.conf         apertium-html-tools.conf

@sushain97
Copy link
Member

I'm not entirely opposed to the solution in this PR but I don't want to regress to not including tools. Can we just cp -r it and then include the stuff in the package_data list using * (well, four entries since there's no globstar)?

@sushain97
Copy link
Member

sushain97 commented Apr 5, 2018

Since people seem to use /usr/local/share, I'm fine just making it share/apertium-apy and then if it gets installed to /usr/local/share/apertium-apy or /usr/share/apertium-apy, whatever. Let me know if you're okay with this and I'll send the PR.

@TinoDidriksen
Copy link
Member Author

Superseded by #106

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.

3 participants