FS#65645 - [python-fonttools] optdepends for python-fs should be depends

Attached to Project: Community Packages
Opened by Caleb Maclennan (alerque) - Thursday, 27 February 2020, 20:58 GMT
Last edited by Andrzej Giniewicz (Giniu) - Monday, 09 March 2020, 09:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Andrzej Giniewicz (Giniu)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


The python-fs module is used for more than just optional UFO stuff. It is also required for a number of subcommmands which have nothing to do with UFO. The `fonttools subset` command for example dies with an error about it being required if not present.

Please move python-fs from optdepends to depends.
This task depends upon

Closed by  Andrzej Giniewicz (Giniu)
Monday, 09 March 2020, 09:41 GMT
Reason for closing:  Not a bug
Additional comments about closing:  python-fs is optional, it means that it is required for some functionality, but upstream decided, that it is critical for most use cases. We stick to upstream with it. Reopen if you disagree.
Comment by Caleb Maclennan (alerque) - Thursday, 27 February 2020, 21:05 GMT
The `fontlint` command also requires python-fs. It shouldn't be optional ;-)
Comment by Andrzej Giniewicz (Giniu) - Monday, 02 March 2020, 09:44 GMT
According to upstream (https://github.com/fonttools/fonttools#optional-requirements)

"The fontTools package currently has no (required) external dependencies besides the modules included in the Python Standard Library. However, a few extra dependencies are required by some of its modules, which are needed to unlock optional features."

Seems you need those optional features, but it is not required by other users. I might adjust description that it is not only used by UFO. Do you have some list of things that don't work for you?
Comment by Andrzej Giniewicz (Giniu) - Monday, 02 March 2020, 09:50 GMT
Also, take a look at https://github.com/fonttools/fonttools/search?q=%22import+fs%22&unscoped_q=%22import+fs%22 - can you provide tracebacks? I don't have time to track it right now, but seems like fs should be used only by UFO files, it might be upstream issue, that it is required by your use cases.
Comment by Caleb Maclennan (alerque) - Tuesday, 03 March 2020, 07:00 GMT
Using `psautohint` with both input and output sides being OTF files throws this if python-fs is not present:

+ psautohint build/LibertinusSerif-Regular.otl.otf -o build/LibertinusSerif-Regular.hint.otf --log build/LibertinusSerif-Regular.hint.otf.log
Traceback (most recent call last):
File "/usr/bin/psautohint", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3254, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3237, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'fs<3,>=2.2.0' distribution was not found and is required by fonttools
Makefile:80: *** [build/LibertinusSerif-Regular.hint.otf] Error 1

You can see this by trying to build the AUR package otf-libertinus-git without python-fs installed (note I have it monkey patched in as a dependency there, but I believe the correct place to fix it is here.

Whatever fonttools is doing with it is required for more than just UFO work, and even if this could and maybe should also be looked into upstream it can be fixed in Arch preemptively to provide a fully functional system just by adding the dependency.
Comment by Andrzej Giniewicz (Giniu) - Thursday, 05 March 2020, 23:31 GMT
What package psautohint comes from? Because it does not come from fonttools:

[me@home ~]$ pacman -Ql python-fonttools | grep bin
python-fonttools /usr/bin/
python-fonttools /usr/bin/fonttools
python-fonttools /usr/bin/pyftmerge
python-fonttools /usr/bin/pyftsubset
python-fonttools /usr/bin/ttx
Comment by Andrzej Giniewicz (Giniu) - Thursday, 05 March 2020, 23:34 GMT
Ok, I've checked. This is the package, right?


Notice, that in requirements the psautohint uses optional ufo option: https://github.com/adobe-type-tools/psautohint/blob/master/requirements.txt - it means that this particular package (psautohint) required fonttools AND optional stuff to run ufo and lxml. It means, that python-fs should be a dependency of psautohint - it is psautohint that strictly *requires* it, while for fonttools it still is optional.