From 446e8c8b19bddbe7f94e5dd95b76829adfc408d7 Mon Sep 17 00:00:00 2001 From: Juro Oravec Date: Sun, 26 Jan 2025 15:10:38 +0100 Subject: [PATCH] refactor: include package typing in distribution --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- djc_core_html_parser/__init__.py | 9 +++++++++ __init__.pyi => djc_core_html_parser/__init__.pyi | 0 py.typed => djc_core_html_parser/py.typed | 0 pyproject.toml | 7 ++++++- 7 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 djc_core_html_parser/__init__.py rename __init__.pyi => djc_core_html_parser/__init__.pyi (100%) rename py.typed => djc_core_html_parser/py.typed (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a9e5e..162cab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release notes +## v1.0.1 + +- Fix module typing. + ## v1.0.0 Initial release. diff --git a/Cargo.lock b/Cargo.lock index aa2ac46..df367fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,7 +22,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "djc_core_html_parser" -version = "1.0.0" +version = "1.0.1" dependencies = [ "pyo3", "quick-xml", diff --git a/Cargo.toml b/Cargo.toml index 7eff0db..b2830b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/djc_core_html_parser/__init__.py b/djc_core_html_parser/__init__.py new file mode 100644 index 0000000..0b84cc2 --- /dev/null +++ b/djc_core_html_parser/__init__.py @@ -0,0 +1,9 @@ +# DO NOT MODIFY, ONLY UPDATE THE MODULE NAME WHEN NEEDED! +# 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__ diff --git a/__init__.pyi b/djc_core_html_parser/__init__.pyi similarity index 100% rename from __init__.pyi rename to djc_core_html_parser/__init__.pyi diff --git a/py.typed b/djc_core_html_parser/py.typed similarity index 100% rename from py.typed rename to djc_core_html_parser/py.typed diff --git a/pyproject.toml b/pyproject.toml index bda53c0..45b8bcb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] @@ -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