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

Add a font protocol #5759

Merged
merged 2 commits into from
Dec 28, 2021
Merged

Add a font protocol #5759

merged 2 commits into from
Dec 28, 2021

Conversation

jepler
Copy link
Member

@jepler jepler commented Dec 21, 2021

@tekktrik noticed that there was no convenient way to specify that a function takes "any kind of Font", including the built in one and the ones from the adafruit_bitmap_font package. By defining this protocol in our stubs, it's hoped that fontio.FontProtocol can be used instead of an ad-hoc Union[] of several known font types.

image

This fixes the lengthy build-time message

> setuptools_scm-6.3.2-py3.9.egg/setuptools_scm/integration.py:16: RuntimeWarning:
> ERROR: setuptools==44.1.1 is used in combination with setuptools_scm>=6.x
>
> Your build configuration is incomplete and previously worked by accident!
>
>
> This happens as setuptools is unable to replace itself when a activated build dependency requires a more recent setuptools version (it does not respect "setuptools>X" in setup_requires).
>
>
> setuptools>=31 is required for setup.cfg metadata support
> setuptools>=42 is required for pyproject.toml configuration support
>
> Suggested workarounds if applicable:
>  - preinstalling build dependencies like setuptools_scm before running setup.py
>  - installing setuptools_scm using the system package manager to ensure consistency
>  - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, and interesting this is a "no-code" addition to shared-bindings.

@dhalbert dhalbert merged commit 9ef8bce into adafruit:main Dec 28, 2021
@jepler jepler deleted the font-protocol branch December 28, 2021 16:32
@tekktrik
Copy link
Member

Excellent! Let me know if/when it's good to start typing with this then!

@jepler
Copy link
Member Author

jepler commented Dec 28, 2021

I think that when the 7.2.0alpha release is tagged on github, the stubs will be uploaded to pypi as a prerelease. That'll allow use of the new protocol type.

@tekktrik
Copy link
Member

Perfect! Thank you for this!

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

Successfully merging this pull request may close these issues.

3 participants