Please drop booleanOperations dependency or fix its use
Hi all, thank you for maintaining this library!
One of your dependencies, booleanOperations, is old and probably unmaintained. I investigated and you are using it in only one place:
Lib/fontParts/fontshell/glyph.py: booleanOperations.union(contours, self.getPointPen())
getPointPen() ultimately leads to NotImplementedError(), so this piece of code is probably never called. Could you please think about dropping the booleanOperations runtime dependency (possibly along with the code)?
If you decide to keep it, as you wish, but then please fix it. Looking at the https://github.com/typemytype/booleanOperations/blob/master/README.rst you probably want to call the union function on a manager object, not from booleanOperations itself. I would be surprised if the code ran as is.
Have a nice day! Markéta
Hey @MeggyCal, curious; how did this come up for you as an issue?
Hi, I am one of the maintainers of openSUSE Python stack. booleanOperations was failing some tests, so I found out it is suspiciously stale, investigated if it could be dropped (we don't aim to package the world, just the parts which are of use to us) and found out this package is the only one in openSUSE Tumbleweed which depends on it.
My goal is to clear the path for potential removal of booleanOperations from openSUSE Tumbleweed. It is not pressing atm, but generally we try to get rid of failures (preferably by fixing them, but when the upstream is dead we seek other paths).
As one of the maintainers of booleanoperations and FontParts, I can inform you that the package is definitely not unmaintained ;) Its one of the key packages in current type design tools.
There are historical shortcuts in init.py referencing booleanOperations.union.
Can you elaborate on the failing tests? I assume it's due to the test run in py3.6 and py3.7... sorry about that... please make a PR to fix this.
Hi, there are 8 failing tests on Python 3.11+ on all architectures:
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_QTail_reversed_difference
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_QTail_reversed_intersection
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_QTail_reversed_union - ...
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_QTail_reversed_xor - As...
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_Q_difference - Assertio...
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_Q_intersection - Assert...
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_Q_union - AssertionErro...
[ 12s] FAILED tests/test_BooleanGlyph.py::BooleanTests::test_Q_xor - AssertionError:...
All the failures look like this:
[ 12s] _________________ BooleanTests.test_QTail_reversed_difference __________________
[ 12s]
[ 12s] self = <tests.test_BooleanGlyph.BooleanTests testMethod=test_QTail_reversed_difference>
[ 12s]
[ 12s] def test(self):
[ 12s] if VERBOSE:
[ 12s] print("test: '%s' for '%s'" % (glyph.name, booleanMethodName))
[ 12s] testPen = DigestPointPen()
[ 12s] func(*args, outPen=testPen)
[ 12s] expectedPen = DigestPointPen()
[ 12s] expectedGlyph.drawPoints(expectedPen)
[ 12s] > self.assertEqual(testPen.getDigest(), expectedPen.getDigest(), "Glyph name '%s' failed for '%s'." % (glyph.name, booleanMethodName))
[ 12s] E AssertionError: Tuples differ: (('be[710 chars], ((250.0, 100.0), 'curve', True, None), ((168[1018 chars]ath') != (('be[710 chars], ((249.99999999999997, 100.0), 'curve', True,[1044 chars]ath')
[ 12s] E
[ 12s] E First differing element 14:
[ 12s] E ((250.0, 100.0), 'curve', True, None)
[ 12s] E ((249.99999999999997, 100.0), 'curve', True, None)
[ 12s] E
[ 12s] E Diff is 2102 characters long. Set self.maxDiff to None to see it. : Glyph name 'QTail_reversed' failed for 'difference'.
[ 12s]
[ 12s] tests/test_BooleanGlyph.py:50: AssertionError
In test_QTail_reversed_* the obtained value is slightly smaller (as you see), in test_Q_* the obtained value is slightly bigger (400.00000000000006 and so on). There might be some dependencies which are too new, but overall the test results look like precision errors (but it is similar on all architectures).