Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ __pycache__/
# Build and distribution
build/
dist/
*.whl
# *.whl
*.tar.gz
wheelhouse/

Expand Down Expand Up @@ -170,6 +170,7 @@ tests/*/
!*.css
!*.js
!*.json
!*.whl

# Allow specific directories content
!**/templates/**
Expand Down
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Cargo.toml (in root directory)
[package]
name = "haske-core"
version = "0.1.0"
edition = "2021"

# Explicitly tell Cargo where to find source files
[lib]
name = "_haske_core"
path = "src/lib.rs" # Explicit path
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.20.0", features = ["extension-module"] }
16 changes: 11 additions & 5 deletions haske-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
name = "haske-core"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
# The importable Python module will be named `_haske_core` and the dynamic lib type is cdylib
name = "_haske_core"
crate-type = ["cdylib", "rlib"]
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module"] }
pyo3 = { version = "0.21", features = ["extension-module", "auto-initialize"] }
regex = "1.7.0"
serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.91"
Expand All @@ -23,8 +25,8 @@ zstd = "0.12.0"
bytes = "1.4.0"
parking_lot = "0.12.1"
constant_time_eq = "0.2.5"
moka = "0.10.0" # Added moka dependency
sha1 = "0.10.5" # Added sha1 dependency
moka = "0.10.0"
sha1 = "0.10.5"

# Optional SIMD support
[features]
Expand All @@ -36,4 +38,8 @@ version = "0.9.0"
optional = true

[build-dependencies]
pyo3-build-config = "0.18.0"
pyo3-build-config = "0.18.0"

[profile.release]
strip = "symbols"
lto = true
2 changes: 1 addition & 1 deletion haske-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod compress;
mod ws;

#[pymodule]
fn _haske_core(m: &Bound<'_, PyModule>) -> PyResult<()> {
fn _haske_core(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
// Register classes
m.add_class::<router::HaskeApp>()?;
m.add_class::<cache::HaskeCache>()?;
Expand Down
7 changes: 5 additions & 2 deletions haske-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ version = "0.1.0"
edition = "2021"

[lib]
name = "_haske_core"
crate-type = ["cdylib", "rlib"]
name = "_haske_core" # This must match the #[pymodule] name
crate-type = ["cdylib"]
path = "src/lib.rs" # 👈 this line ensures Cargo finds the module


[dependencies]
pyo3 = { version = "0.21", features = ["extension-module", "auto-initialize"] }
Expand All @@ -14,3 +16,4 @@ haske-core = { path = "../haske-core" }
[profile.release]
strip = "symbols"
lto = true

Binary file removed haske-python/_haske_core.pyd
Binary file not shown.
Binary file not shown.
Binary file added haske-python/haske-0.1.0-py3-none-any.whl
Binary file not shown.
2 changes: 2 additions & 0 deletions haske-python/haske/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
from .routing import Route, PathConverter, IntConverter, FloatConverter, UUIDConverter, PathConverterRegistry, convert_path
from .cli import cli

from _haske_core import *

__version__ = "0.1.0"
__all__ = [
"Haske", "Request", "Response", "JSONResponse", "HTMLResponse", "RedirectResponse",
Expand Down
Binary file modified haske-python/haske/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed haske-python/haske/_haske_core.pyd
Binary file not shown.
Loading