Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Converter.__init__() got an unexpected keyword argument 'omit_if_default' #1129

Open
BoldMonday opened this issue Oct 28, 2024 · 4 comments

Comments

@BoldMonday
Copy link

After updating to fontmake 3.10.0 I'm unable to generate fonts anymore. Here's the traceback:

Traceback (most recent call last):
  File "/Users/paulus/code/fontmake/bin/fontmake", line 5, in <module>
    from fontmake.__main__ import main
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/fontmake/__main__.py", line 30, in <module>
    from fontmake.font_project import INTERPOLATABLE_OUTPUTS, CurveConversion, FontProject
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/fontmake/font_project.py", line 32, in <module>
    import ufoLib2
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/__init__.py", line 5, in <module>
    from ufoLib2.objects import Font
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/objects/__init__.py", line 3, in <module>
    from ufoLib2.objects.anchor import Anchor
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/objects/anchor.py", line 13, in <module>
    class Anchor(AttrDictMixin):
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/serde/__init__.py", line 78, in serde
    serde_submodule = import_module(f"ufoLib2.serde.{fmt}")
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/serde/json.py", line 6, in <module>
    from ufoLib2.converters import structure, unstructure
  File "/Users/paulus/code/fontmake/lib/python3.10/site-packages/ufoLib2/converters.py", line 139, in <module>
    default_converter = Converter(
TypeError: Converter.__init__() got an unexpected keyword argument 'omit_if_default'

Installed packages:

Package           Version
----------------- -----------
appdirs           1.4.4
attrs             24.2.0
booleanOperations 0.9.0
cattrs            22.1.0
cffsubr           0.3.0
compreffor        0.5.6
cu2qu             1.6.7.post1
exceptiongroup    1.0.0rc8
fontmake          3.10.0
fontMath          0.9.4
fonttools         4.54.1
fs                2.4.16
glyphsLib         6.9.2
lxml              4.9.1
openstep-plist    0.3.0
pip               24.3.1
pyclipper         1.3.0.post3
setuptools        58.1.0
six               1.16.0
statmake          0.5.1
ufo2ft            3.3.1
ufoLib2           0.16.0
unicodedata2      15.1.0
@BoldMonday
Copy link
Author

@anthrotype or anyone else who can comment on this?

For the record: this happened after I did pip install --upgrade fontmake.

@anthrotype
Copy link
Member

that's strange. Can you try pip install -U cattrs?

@anthrotype
Copy link
Member

@madig I think ufoLib2 might be depending on some newer cattrs version than is stated in its https://github.com/fonttools/ufoLib2/blob/bbf9d0544e3c342d41d26039c7dc30fd95dbb38b/pyproject.toml#L30

we probably forgot to bump the minimum dependency version in there. I see that the requirements.txt used to test ufoLib2 is using cattrs==24.1.2
https://github.com/fonttools/ufoLib2/blob/bbf9d0544e3c342d41d26039c7dc30fd95dbb38b/requirements.txt#L9

@madig
Copy link
Collaborator

madig commented Oct 31, 2024

Oh. I'll just move the cattrs requirement to >= 24.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants