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

Fix #291, #292 and add unit tests for deserializing Mkdocs/Hugo example configuration #294

Merged
merged 8 commits into from Jun 21, 2023

Conversation

NiklasRosenstein
Copy link
Owner

@NiklasRosenstein NiklasRosenstein commented Jun 10, 2023

Users that use Pydoc-Markdown as a library and implement their own Page subclass like so:

from pydoc_markdown.util.pages import Page

class MyPage(Page["MyPage"]):
  ...

Should update their code to read:

from pydoc_markdown.util.pages import GenericPage

class MyPage(GenericPage["MyPage"]):
  ...

This will avoid Mypy errors like this below:

error: "Page" expects no type arguments, but 1 given  [type-arg]

The type stays compatible with the old semantics at runtime, so this is not a breaking change.

Introducing the GenericPage is the fix for #291.

#292 is fixed by upgrading Databind to ^4.4.0.

NiklasRosenstein and others added 7 commits June 10, 2023 10:15
…y making the `Page` type a concrete subclass of the old `Page` class now called `GenericPage`. This is needed to correctly define a recursive type that Databind can de/serialize. The `Page` type stays backwards compatible at runtime for cases when it is used as a generic (e.g. `class MyPage(Page[MyPage]):`) to not break existing code.
@NiklasRosenstein NiklasRosenstein marked this pull request as ready for review June 21, 2023 15:41
@NiklasRosenstein NiklasRosenstein changed the title Add unit test for deserializing mkdocs config Fix #291, #292 and add unit tests for deserializing Mkdocs/Hugo example configuration Jun 21, 2023
@NiklasRosenstein NiklasRosenstein merged commit 4435326 into develop Jun 21, 2023
8 checks passed
@NiklasRosenstein NiklasRosenstein deleted the nr/fix-291 branch June 21, 2023 15:48
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.

None yet

1 participant