higuma 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- higuma-0.1.0/.gitattributes +11 -0
- higuma-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +27 -0
- higuma-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +21 -0
- higuma-0.1.0/.github/workflows/ci.yml +40 -0
- higuma-0.1.0/.github/workflows/docs.yml +48 -0
- higuma-0.1.0/.github/workflows/release.yml +97 -0
- higuma-0.1.0/.gitignore +30 -0
- higuma-0.1.0/CHANGELOG.md +35 -0
- higuma-0.1.0/CODE_OF_CONDUCT.md +17 -0
- higuma-0.1.0/CONTRIBUTING.md +49 -0
- higuma-0.1.0/Cargo.lock +964 -0
- higuma-0.1.0/Cargo.toml +30 -0
- higuma-0.1.0/LICENSE +21 -0
- higuma-0.1.0/PKG-INFO +832 -0
- higuma-0.1.0/README.md +795 -0
- higuma-0.1.0/SECURITY.md +29 -0
- higuma-0.1.0/bench/compare.py +103 -0
- higuma-0.1.0/bench/flask_app.py +12 -0
- higuma-0.1.0/bench/higuma_app.py +12 -0
- higuma-0.1.0/docs/CNAME +1 -0
- higuma-0.1.0/docs/api.md +121 -0
- higuma-0.1.0/docs/assets/favicon.svg +9 -0
- higuma-0.1.0/docs/assets/logo.svg +7 -0
- higuma-0.1.0/docs/contributing.md +35 -0
- higuma-0.1.0/docs/deployment.md +57 -0
- higuma-0.1.0/docs/getting-started.md +105 -0
- higuma-0.1.0/docs/guides/middleware-sessions.md +98 -0
- higuma-0.1.0/docs/guides/requests-responses.md +116 -0
- higuma-0.1.0/docs/guides/routing.md +96 -0
- higuma-0.1.0/docs/guides/templates-static.md +79 -0
- higuma-0.1.0/docs/index.md +82 -0
- higuma-0.1.0/docs/javascripts/extra.js +5 -0
- higuma-0.1.0/docs/stylesheets/extra.css +173 -0
- higuma-0.1.0/examples/app.py +34 -0
- higuma-0.1.0/examples/templates/index.html +50 -0
- higuma-0.1.0/mkdocs.yml +102 -0
- higuma-0.1.0/pyproject.toml +64 -0
- higuma-0.1.0/python/higuma/__init__.py +77 -0
- higuma-0.1.0/python/higuma/__main__.py +3 -0
- higuma-0.1.0/python/higuma/app.py +607 -0
- higuma-0.1.0/python/higuma/blueprint.py +66 -0
- higuma-0.1.0/python/higuma/cli.py +63 -0
- higuma-0.1.0/python/higuma/config.py +66 -0
- higuma-0.1.0/python/higuma/exceptions.py +89 -0
- higuma-0.1.0/python/higuma/middleware.py +105 -0
- higuma-0.1.0/python/higuma/py.typed +1 -0
- higuma-0.1.0/python/higuma/request.py +235 -0
- higuma-0.1.0/python/higuma/response.py +295 -0
- higuma-0.1.0/python/higuma/routing.py +111 -0
- higuma-0.1.0/python/higuma/sessions.py +119 -0
- higuma-0.1.0/python/higuma/testing.py +144 -0
- higuma-0.1.0/src/lib.rs +887 -0
- higuma-0.1.0/tests/test_app.py +273 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report reproducible incorrect behavior
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description
|
|
9
|
+
description: What happened, and what did you expect?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
attributes:
|
|
14
|
+
label: Reproduction
|
|
15
|
+
description: Include the smallest runnable example.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
attributes:
|
|
20
|
+
label: higuma version
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: input
|
|
24
|
+
attributes:
|
|
25
|
+
label: Python, Rust, and operating system
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a focused improvement
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
attributes:
|
|
8
|
+
label: Use case
|
|
9
|
+
description: What problem would this solve?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
attributes:
|
|
14
|
+
label: Proposed API
|
|
15
|
+
description: Show how you would like to use the feature.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
attributes:
|
|
20
|
+
label: Alternatives
|
|
21
|
+
description: Describe workarounds or related frameworks you considered.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
17
|
+
python-version: ["3.10", "3.12", "3.13"]
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
|
+
- uses: actions/setup-python@v6
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
cache: pip
|
|
26
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
27
|
+
with:
|
|
28
|
+
components: rustfmt
|
|
29
|
+
- name: Install
|
|
30
|
+
run: python -m pip install -e ".[dev]"
|
|
31
|
+
- name: Rust format
|
|
32
|
+
run: cargo fmt --all -- --check
|
|
33
|
+
- name: Rust check
|
|
34
|
+
run: cargo check
|
|
35
|
+
- name: Rust test
|
|
36
|
+
run: cargo test
|
|
37
|
+
- name: Python lint
|
|
38
|
+
run: python -m ruff check python tests examples
|
|
39
|
+
- name: Test
|
|
40
|
+
run: python -m unittest discover -s tests -v
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- "docs/**"
|
|
8
|
+
- "mkdocs.yml"
|
|
9
|
+
- ".github/workflows/docs.yml"
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pages: write
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
concurrency:
|
|
18
|
+
group: pages
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v5
|
|
26
|
+
- uses: actions/setup-python@v6
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
cache: pip
|
|
30
|
+
- name: Install documentation dependencies
|
|
31
|
+
run: python -m pip install ".[docs]"
|
|
32
|
+
- name: Build documentation
|
|
33
|
+
run: mkdocs build --strict
|
|
34
|
+
- uses: actions/configure-pages@v5
|
|
35
|
+
- uses: actions/upload-pages-artifact@v3
|
|
36
|
+
with:
|
|
37
|
+
path: site
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
environment:
|
|
41
|
+
name: github-pages
|
|
42
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
needs: build
|
|
45
|
+
steps:
|
|
46
|
+
- name: Deploy to GitHub Pages
|
|
47
|
+
id: deployment
|
|
48
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: Build release wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
wheels:
|
|
13
|
+
name: Wheel (${{ matrix.platform.name }})
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
platform:
|
|
17
|
+
- name: linux-x86_64
|
|
18
|
+
runner: ubuntu-22.04
|
|
19
|
+
target: x86_64
|
|
20
|
+
manylinux: auto
|
|
21
|
+
- name: linux-aarch64
|
|
22
|
+
runner: ubuntu-22.04
|
|
23
|
+
target: aarch64
|
|
24
|
+
manylinux: auto
|
|
25
|
+
- name: musllinux-x86_64
|
|
26
|
+
runner: ubuntu-22.04
|
|
27
|
+
target: x86_64
|
|
28
|
+
manylinux: musllinux_1_2
|
|
29
|
+
- name: windows-x64
|
|
30
|
+
runner: windows-latest
|
|
31
|
+
target: x64
|
|
32
|
+
manylinux: auto
|
|
33
|
+
- name: macos-x86_64
|
|
34
|
+
runner: macos-15-intel
|
|
35
|
+
target: x86_64
|
|
36
|
+
manylinux: auto
|
|
37
|
+
- name: macos-aarch64
|
|
38
|
+
runner: macos-latest
|
|
39
|
+
target: aarch64
|
|
40
|
+
manylinux: auto
|
|
41
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v6
|
|
44
|
+
- uses: actions/setup-python@v6
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.10"
|
|
47
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
48
|
+
- uses: PyO3/maturin-action@v1
|
|
49
|
+
with:
|
|
50
|
+
command: build
|
|
51
|
+
target: ${{ matrix.platform.target }}
|
|
52
|
+
args: --release --locked --compatibility pypi --out dist
|
|
53
|
+
manylinux: ${{ matrix.platform.manylinux }}
|
|
54
|
+
- uses: actions/upload-artifact@v7
|
|
55
|
+
with:
|
|
56
|
+
name: wheels-${{ matrix.platform.name }}
|
|
57
|
+
path: dist/*
|
|
58
|
+
if-no-files-found: error
|
|
59
|
+
|
|
60
|
+
source:
|
|
61
|
+
name: Source distribution
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v6
|
|
65
|
+
- uses: actions/setup-python@v6
|
|
66
|
+
with:
|
|
67
|
+
python-version: "3.10"
|
|
68
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
69
|
+
- run: python -m pip install maturin
|
|
70
|
+
- run: maturin sdist --out dist
|
|
71
|
+
- uses: actions/upload-artifact@v7
|
|
72
|
+
with:
|
|
73
|
+
name: source
|
|
74
|
+
path: dist/*
|
|
75
|
+
if-no-files-found: error
|
|
76
|
+
|
|
77
|
+
publish:
|
|
78
|
+
name: Publish to PyPI
|
|
79
|
+
needs: [wheels, source]
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
environment:
|
|
82
|
+
name: pypi
|
|
83
|
+
url: https://pypi.org/p/higuma
|
|
84
|
+
permissions:
|
|
85
|
+
id-token: write
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/download-artifact@v8
|
|
88
|
+
with:
|
|
89
|
+
path: dist
|
|
90
|
+
merge-multiple: true
|
|
91
|
+
- name: List distributions
|
|
92
|
+
run: ls -lh dist
|
|
93
|
+
- name: Publish distributions
|
|
94
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
95
|
+
with:
|
|
96
|
+
packages-dir: dist
|
|
97
|
+
print-hash: true
|
higuma-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyd
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Rust and maturin
|
|
12
|
+
target/
|
|
13
|
+
*.dll
|
|
14
|
+
*.dylib
|
|
15
|
+
*.so
|
|
16
|
+
dist/
|
|
17
|
+
site/
|
|
18
|
+
build/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
|
|
21
|
+
# Editors and operating systems
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
.DS_Store
|
|
25
|
+
Thumbs.db
|
|
26
|
+
|
|
27
|
+
# Local configuration
|
|
28
|
+
.env
|
|
29
|
+
.env.*
|
|
30
|
+
!.env.example
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to higuma are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and the project uses [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Planned
|
|
11
|
+
|
|
12
|
+
- WebSocket support
|
|
13
|
+
- Multipart file uploads
|
|
14
|
+
- Template bytecode caching
|
|
15
|
+
- OpenAPI schema generation
|
|
16
|
+
- Unix multi-process supervisor
|
|
17
|
+
|
|
18
|
+
## [0.1.0] - 2026-07-27
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Rust HTTP core based on axum and Tokio
|
|
23
|
+
- Flask-inspired route decorators and dynamic route converters
|
|
24
|
+
- Request and response objects, JSON, redirects, files, and SSR
|
|
25
|
+
- Automatic HEAD and OPTIONS behavior
|
|
26
|
+
- Error handlers, request hooks, middleware, and lifecycle hooks
|
|
27
|
+
- Blueprint route groups and URL generation
|
|
28
|
+
- Static files with ETag, conditional requests, and byte ranges
|
|
29
|
+
- Signed cookie sessions
|
|
30
|
+
- CORS, security header, and trusted host middleware
|
|
31
|
+
- Async Python handler compatibility
|
|
32
|
+
- In-process test client
|
|
33
|
+
- CLI for running applications and listing routes
|
|
34
|
+
- GitHub Actions CI and release wheel workflow
|
|
35
|
+
- PyPI Trusted Publishing with multi-platform wheels
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
We want higuma to be a respectful, practical, and welcoming project.
|
|
4
|
+
|
|
5
|
+
Participants are expected to:
|
|
6
|
+
|
|
7
|
+
- Discuss ideas and code without personal attacks.
|
|
8
|
+
- Assume good intent while remaining precise about technical concerns.
|
|
9
|
+
- Respect privacy and avoid publishing private information.
|
|
10
|
+
- Accept maintainer decisions made to protect users and the project.
|
|
11
|
+
|
|
12
|
+
Harassment, discrimination, threats, and sustained disruptive behavior are not
|
|
13
|
+
accepted. Maintainers may edit, remove, or reject contributions and may
|
|
14
|
+
temporarily or permanently restrict participation when necessary.
|
|
15
|
+
|
|
16
|
+
Reports should be made privately through the repository's security or maintainer
|
|
17
|
+
contact channel once the repository is published.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing to higuma
|
|
2
|
+
|
|
3
|
+
Thank you for helping improve higuma.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
Requirements:
|
|
8
|
+
|
|
9
|
+
- Python 3.10 or newer
|
|
10
|
+
- Rust stable toolchain
|
|
11
|
+
- A C/C++ linker supported by Rust
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
python -m venv .venv
|
|
15
|
+
.venv/Scripts/activate
|
|
16
|
+
python -m pip install -U pip
|
|
17
|
+
python -m pip install -e ".[dev]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
On macOS or Linux, activate the environment with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
source .venv/bin/activate
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Checks
|
|
27
|
+
|
|
28
|
+
Run all checks before opening a pull request:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
cargo fmt --all -- --check
|
|
32
|
+
cargo check
|
|
33
|
+
python -m ruff check python tests examples
|
|
34
|
+
python -m unittest discover -s tests -v
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Pull requests
|
|
38
|
+
|
|
39
|
+
- Keep changes focused and explain the behavior they change.
|
|
40
|
+
- Add tests for bug fixes and new public behavior.
|
|
41
|
+
- Update README.md and CHANGELOG.md when public APIs change.
|
|
42
|
+
- Avoid claiming benchmark improvements without a reproducible command and environment.
|
|
43
|
+
|
|
44
|
+
## Design principles
|
|
45
|
+
|
|
46
|
+
- Python APIs should be familiar and explicit.
|
|
47
|
+
- Work that does not require Python should stay in Rust when practical.
|
|
48
|
+
- Security-sensitive defaults should be conservative.
|
|
49
|
+
- Backwards compatibility follows Semantic Versioning after 1.0.
|