Skip to content

refactor: include package typing in distribution #2

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

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release notes

## v1.0.1

- Fix module typing.

## v1.0.0

Initial release.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "djc_core_html_parser"
version = "1.0.0"
version = "1.0.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
9 changes: 9 additions & 0 deletions djc_core_html_parser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DO NOT MODIFY, ONLY UPDATE THE MODULE NAME WHEN NEEDED!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned here, this file was originally generated by maturin, but maturin skips it when it sees __init__.pyi.

It's possible that this is a bug on maturin's side that maybe it checks only for file name, but NOT for file extension. because I think __init__.pyi should NOT overwrite __init__.py.

Anyway, I thus included this file manually.

# This file is what maturin auto-generates. But it seems maturin omits it when we have a __init__.pyi file.
# So we have to manually include it here.

from .djc_core_html_parser import *

__doc__ = djc_core_html_parser.__doc__
if hasattr(djc_core_html_parser, "__all__"):
__all__ = djc_core_html_parser.__all__
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "djc_core_html_parser"
version = "1.0.0"
version = "1.0.1"
requires-python = ">=3.8, <4.0"
description = "HTML parser used by django-components written in Rust."
keywords = ["django", "components", "html"]
Expand Down Expand Up @@ -37,6 +37,11 @@ Donate = "https://github.com/sponsors/EmilStenstrom"

[tool.maturin]
features = ["pyo3/extension-module"]
include = [
"djc_core_html_parser/__init__.py",
"djc_core_html_parser/__init__.pyi",
"djc_core_html_parser/py.typed",
]

[tool.black]
line-length = 119
Expand Down