Bug 231392 - print/py-psautohint: Update to 1.9.1
Summary: print/py-psautohint: Update to 1.9.1
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Steve Wills
URL:
Keywords: needs-qa
Depends on: 237672
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-16 08:05 UTC by Ting-Wei Lan
Modified: 2019-07-15 04:48 UTC (History)
3 users (show)

See Also:


Attachments
Update print/py-psautohint to 1.8.1 (1.88 KB, text/plain)
2018-09-16 08:05 UTC, Ting-Wei Lan
no flags Details
Update print/py-psautohint to 1.8.1 (1.22 KB, patch)
2018-09-16 08:07 UTC, Ting-Wei Lan
no flags Details | Diff
Update print/py-psautohint to 1.8.1, version 2 (1.34 KB, patch)
2018-10-28 06:06 UTC, Ting-Wei Lan
no flags Details | Diff
Update print/py-psautohint to 1.9.1 (1.28 KB, patch)
2018-12-29 16:59 UTC, Ting-Wei Lan
no flags Details | Diff
patch to use new py-fonttools-lxml-ufo package as dep (782 bytes, patch)
2019-07-03 19:14 UTC, Steve Wills
swills: maintainer-approval? (lantw44)
Details | Diff
ps-autohint and other py-fonttools deps change (8.56 KB, patch)
2019-07-03 19:43 UTC, Steve Wills
swills: maintainer-approval? (lantw44)
Details | Diff
Convert fonttools options into metaports (18.18 KB, patch)
2019-07-04 12:12 UTC, Ting-Wei Lan
no flags Details | Diff
Add a USES=fonttools macro to handle optional features (3.01 KB, patch)
2019-07-14 17:11 UTC, Ting-Wei Lan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2018-09-16 08:05:41 UTC
Created attachment 197132 [details]
Update print/py-psautohint to 1.8.1

This update adds a new dependency, ufoLib, which is still not in ports. You can find the print/py-ufoLib port made by me on this bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228027.

cantarell-fonts can be built successfully with this version of PSAutoHint.
Comment 1 Ting-Wei Lan 2018-09-16 08:07:27 UTC
Created attachment 197133 [details]
Update print/py-psautohint to 1.8.1

Sorry, I should upload a patch file instead of a shar file.
Comment 2 Ting-Wei Lan 2018-10-28 06:06:17 UTC
Created attachment 198711 [details]
Update print/py-psautohint to 1.8.1, version 2
Comment 3 Ting-Wei Lan 2018-10-28 06:06:49 UTC
The new patch uses PY_FLAVOR instead of FLAVOR.
Comment 4 Ting-Wei Lan 2018-12-29 16:59:10 UTC
Created attachment 200609 [details]
Update print/py-psautohint to 1.9.1
Comment 5 commit-hook freebsd_committer 2019-01-31 12:47:15 UTC
A commit references this bug:

Author: swills
Date: Thu Jan 31 12:46:25 UTC 2019
New revision: 491712
URL: https://svnweb.freebsd.org/changeset/ports/491712

Log:
  print/py-psautohint: update to 1.8.1

  PR:		231392
  Submitted by:	Ting-Wei Lan <lantw44@gmail.com> (maintainer)

Changes:
  head/print/py-psautohint/Makefile
  head/print/py-psautohint/distinfo
Comment 6 Steve Wills freebsd_committer 2019-01-31 12:48:42 UTC
Committed, thanks!
Comment 7 Ting-Wei Lan 2019-03-03 04:20:12 UTC
(In reply to Steve Wills from comment #6)
Please revert the commit. PSAutoHint 1.9.1 depends on ufo feature of print/py-fonttools, and ufo feature depends on devel/py-fs ≥ 2.2.0. It is safe to update PSAutoHint to 1.8.1, but it is not to update it to 1.9.1 until devel/py-fs is updated.

$ psautohint --version
Traceback (most recent call last):
  File "/usr/local/bin/psautohint", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'fs<3,>=2.2.0' distribution was not found and is required by fonttools
Comment 8 Steve Wills freebsd_committer 2019-07-03 19:14:40 UTC
Created attachment 205504 [details]
patch to use new py-fonttools-lxml-ufo package as dep

So now that the other port is committed, we can use it as a dep and hopefully have this solved. How does this look to you? I know it creates a conflict, perhaps we can switch other ports to this new package if needed?
Comment 9 Steve Wills freebsd_committer 2019-07-03 19:43:39 UTC
Created attachment 205505 [details]
ps-autohint and other py-fonttools deps change

Here's a version that changes the deps for all the ports that I think are related for this. I think this should allow using everything properly and avoid any package conflicts. Does this look right to you?
Comment 10 Ting-Wei Lan 2019-07-04 12:12:48 UTC
Created attachment 205520 [details]
Convert fonttools options into metaports

I still prefer converting each fonttools option into a separate package, which I already proposed in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237672#c10. It not only makes it easier to track dependencies on optional features but also avoids pulling in unnecessary dependencies when they are not required.

I am not sure whether making these extra ports which install no file is acceptable in ports. I can't get them to pass portlint, but it seems to work fine with portmaster. I haven't tested them in poudriere.
Comment 11 Ting-Wei Lan 2019-07-04 12:26:57 UTC
(In reply to Steve Wills from comment #8)
I don't like the way of introducing a slave port conflicting with the master port. I know we can modify all ports depending on py-fonttools to use py-fonttools-lxml-ufo instead, but the problem will occur again once there is a person who adds a new port depending on py-fonttools. Besides, switching all ports to use py-fonttools-lxml-ufo defeats the idea of avoiding unnecessary dependencies, which is the reason why the maintainer of fonttools doesn't want to enable all options by default. Not all ports currently using fonttools require both lxml and ufo features, and we will have to move all ports to another slave port if there is a port requiring an optional feature which isn't enabled in the current slave port.
Comment 12 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-07-04 18:32:24 UTC
(In reply to Ting-Wei Lan from comment #10)

I do not have time to test the metaport patch. But I believe it's getting things much more complicated.

Can we go back to my original proposal -- adding the dependencies directly to py-psautohint.
It would look like:

# py-psautohint requires fonttools[lxml]
# See LXML option of print/py-fonttools
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}lxml>=4.0<5:devel/py-lxml@${PY_FLAVOR} \
                ${PY_TYPING}
.if ${PYTHON_REL} < 3400
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}singledispatch>=3.4.0.3:devel/py-singledispatch@${PY_FLAVOR}
.endif

# py-psautohint requires fonttools[ufo]
# See UFO option of print/py-fonttools
RUN_DEPENDS+=   ${PY_ENUM34} \
                ${PYTHON_PKGNAMEPREFIX}fs2>=2.2.0<3:devel/py-fs2@${PY_FLAVOR}

Though it's slightly different to your idea (psautohint -> fonttools -> lxml/ufo) logically, but it has identical dependencies.
And the comment is clear enough for anyone to check if the dependencies are correct.
At last, fonttools rarely changes the dependencies. That means it won't take much effort to keep it correct and up-to-date.
Comment 13 Steve Wills freebsd_committer 2019-07-04 21:35:12 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #12)
I don't think we should add the dependencies to py-psautohint. I do not think they belong there since they are used by py-fonttools, not py-psautohint.
Comment 14 Ting-Wei Lan 2019-07-05 10:10:10 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #12)
psautohint isn't the only port requiring extra features from fonttools. I know it rarely changes, but it doesn't means it won't change. When it changes, it has to be propagated to all ports which copied these dependency lines from fonttools. It should be done in the same commit as the fonttools update to prevent possible breakage. If the person who updates fonttools doesn't know he or she should update copies in other ports as well, these copies may eventually become outdated.

I don't like having duplicate code in a project, but it is OK for me to accept your proposal if you agree to update all ports using extra features from fonttools whenever dependencies of options change. It is not an ideal solution, but I can accept it as long as you don't ask me to keep them in sync by myself and don't leave them outdated. I can add comments to the Makefile of fonttools, so you don't have to search the entire ports tree to find these copies.

The ideal way to resolve the problem is probably adding a USES macro for fonttools, so we will have neither code copies nor many metaports.
Comment 15 Steve Wills freebsd_committer 2019-07-06 03:30:37 UTC
(In reply to Ting-Wei Lan from comment #14)
Hmm, I'm not sure fonttools has enough consumers to justify a USES file, but maybe. Could you propose a patch?
Comment 16 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-07-07 17:17:33 UTC
(In reply to Ting-Wei Lan from comment #14)

Yes, I'll maintain the fonttools dependencies and update them when necessary.
Comment 17 Steve Wills freebsd_committer 2019-07-07 19:38:59 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #16)
Please do not add deps to py-psautohint that belong in py-fonttools. IMHO, the deps of a package should be only the things it imports, not transitive dependencies.
Comment 18 Ting-Wei Lan 2019-07-14 17:11:50 UTC
Created attachment 205770 [details]
Add a USES=fonttools macro to handle optional features
Comment 19 Steve Wills freebsd_committer 2019-07-14 18:17:51 UTC
(In reply to Ting-Wei Lan from comment #18)
Thanks for the proposed patch! I think this doesn't look like the best approach because it moves where we put the incorrect dependency from the ports themselves to the framework.
Comment 20 Ting-Wei Lan 2019-07-15 04:48:21 UTC
(In reply to Steve Wills from comment #19)
Yes, but at least it avoids having duplicate code in ports. So we are going back to making a metaport for each fonttools feature?