As we make an effort to support conditions with "minimum" or "maximum"
absent, as well as with "minimum" or "maximum" None, this commit
confirms that the split functions can handle these to some degree also.
Conditions with unbounded values have a "minimum" or "maximum" value of
None.
These tests check that:
a) The public-facing split functions can receive None values without
crashing; and
b) That their internal helper functions correctly translate the None
values to math.inf and -math.inf to express them.
These tests are expected to fail, indicating where a fix is required.
3.10 is out next week, while 3.6 reaches end of life by the end of this year.
It's time to require 3.7 or greater, so we can finally use built-in dataclasses and more.
Fixes https://github.com/fonttools/fonttools/issues/2350
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
and remove BaseDocReader.getSourcePaths as it was broken anyway (it was assuming 'sources'
attribute of DesignSpaceDocument object was a dict, whereas it is now a list of
SourceDescriptor objects
* fix two cases where pathlib.Path objects were not accepted
* make macRes reader accept os.PathLike objects
* use __fspath__ explicitly to support os.PathLike paths
* use __fspath__ explicitly to support os.PathLike paths
* convert tmpdir to str
* only test pathlib.Path on Python 3.6 and up
We know what the default location is before we start reading the masters and there is no guessing.
findDefault() method: default master is at all default values of all axes, or if that fails, the master with the copyInfo flag.
Warn if a location contains an axis that is not defined in the axes element. Otherwise ignore this value, no guessing.
Remove rulesToFeature() function.
* [designspaceLib] WIP: add conditionSets to RuleDescriptor...
the BaseDocReader still needs to be updated to be able to read both
legacy condition-without-conditionset and new-style conditionset
elements.
* test_rules: replace rule.conditions with conditionSets
* Tests: update test.designspace to use conditionset; replace 'with' with 'byname' in sub element
I don't like too much that now 'byname' precedes alphabetically 'name'.
We need to see if ElementTree allows to sort attribute arbitrarily
* Change versionnumber to 4.0 - would that be enough, or should there be seperate major / minor fields?
If we bump the version up to numeral 4, I'd like the check for the with / byname attributes. We can read the old `byname` and only write the new `with`.
Remove support for `initial` in axis attributes.
* WIP - formatversion, with attribute,
* WIP
anything that is not version 4.0 is version 3.0
added some local paths to the test so I can see what it's generating. I can take this out later.
* WIP
read the conditionsets properly. This makes the tests fail no longer.
* WIP
disambiguate axis tags from axis names. Test axes are now called "axisName_x", tags are called "TAGX"
* WIP forgot to push
* WIP
Raise `DesignSpaceDocumentError` when no maximum or minimum are given in a condition.
Add test for such an incomplete rule.
Remove path cruft.
* WIP improved test of raised error.
* WIP because no bot.
* WIP more spaces around percents.
* WIP - don't skip empty subs, just load whatever is there.
* WIP do not permit empty axes in a location when evaluating a rule. Fix some tests.
* WIP missed a str(tempdir), some rule tests.
* WIP proposal for changes to the designspace spec to the `rule` and `sub` elements.
* WIP edits.
* WIP. Typo.