Closed TinoDidriksen closed 6 years ago
Totals | |
---|---|
Change from base Build 816: | 0.0% |
Covered Lines: | 1006 |
Relevant Lines: | 2086 |
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.
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).
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.
Sigh: https://github.com/pypa/wheel/issues/92 ... makes absolute paths a mess.
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
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)?
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.
Superseded by https://github.com/apertium/apertium-apy/pull/106
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 https://github.com/pypa/setuptools/issues/130 , and it's even marked wontfix with this comment https://github.com/pypa/setuptools/issues/130#issuecomment-345522681 :
As per https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files if one uses
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.