Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
0cc482b
A fresh start.
ZeroIntensity Jun 21, 2025
4351bf0
Some further resetting.
ZeroIntensity Jun 21, 2025
b5a337e
Outline for the router.
ZeroIntensity Jun 21, 2025
7a2c880
Some fixups.
ZeroIntensity Jun 22, 2025
87c2c1d
Add status codes.
ZeroIntensity Jun 22, 2025
4901c8b
Remove generation artifacts.
ZeroIntensity Jun 22, 2025
dcf35aa
Outline for responses.
ZeroIntensity Jun 22, 2025
d3e2126
Improve docstrings for status codes.
ZeroIntensity Jun 22, 2025
3b66d24
Some improvements to the response API.
ZeroIntensity Jun 22, 2025
ad37e4a
Outline for server running.
ZeroIntensity Jun 22, 2025
47f381b
Some refactoring with the router.
ZeroIntensity Jun 22, 2025
576164f
Add a 'single-handler' app.
ZeroIntensity Jun 22, 2025
926abe1
'handler' -> 'view'
ZeroIntensity Jun 22, 2025
da7e4a4
Add a testing client.
ZeroIntensity Jun 22, 2025
713375a
Fix build to get tests running.
ZeroIntensity Jun 22, 2025
e74eb74
Add a working test.
ZeroIntensity Jun 22, 2025
1e5f881
Add some simple logging with loguru.
ZeroIntensity Jun 22, 2025
778abb0
Improve the module __init__.
ZeroIntensity Jun 22, 2025
cde5782
Move Request to its own file.
ZeroIntensity Jun 22, 2025
a9694d8
Fix missing __all__ in the view.testing module.
ZeroIntensity Jun 22, 2025
a9f9871
Improve and add some missing docstrings.
ZeroIntensity Jun 22, 2025
e7b570d
Outline for ASGI servers.
ZeroIntensity Jun 22, 2025
f48ccf9
Rough implementation of request bodies.
ZeroIntensity Jun 22, 2025
5737187
Outline for streaming responses.
ZeroIntensity Jun 22, 2025
cdd1a1d
Outline for file responses.
ZeroIntensity Jun 22, 2025
e8ce925
Add some missing formalities, such as __all__ or future imports.
ZeroIntensity Jun 22, 2025
257f75f
Stream responses in the ASGI implementation.
ZeroIntensity Jun 22, 2025
5e11a3d
Fix circular references.
ZeroIntensity Jun 22, 2025
ccf5e4e
Fix Method enums being lowercase.
ZeroIntensity Jun 23, 2025
fa1bcd1
Remove unused import.
ZeroIntensity Jun 23, 2025
ee3946a
Make Router a dataclass.
ZeroIntensity Jun 23, 2025
bf3f264
Rough WSGI implementation.
ZeroIntensity Jun 23, 2025
e018d69
Run formatters.
ZeroIntensity Jun 23, 2025
9b452c9
Add descriptions to error messages.
ZeroIntensity Jun 23, 2025
f524fac
Handle errors in single-view apps.
ZeroIntensity Jun 23, 2025
e7b3df7
Improve some testing APIs.
ZeroIntensity Jun 23, 2025
16892d8
Some general fixups.
ZeroIntensity Jun 23, 2025
585d7cb
Run formatter.
ZeroIntensity Jun 23, 2025
1f0d133
Add some new tests.
ZeroIntensity Jun 23, 2025
efed32f
Move headers to their own file.
ZeroIntensity Jun 23, 2025
0a44fa2
Rough implementation of 'magic' server running.
ZeroIntensity Jun 23, 2025
30d66c6
Add some missing docstrings.
ZeroIntensity Jun 23, 2025
c2e082b
Make it possible to directly stream responses in views.
ZeroIntensity Jun 23, 2025
e44bdba
Add some debug type checks.
ZeroIntensity Jun 23, 2025
2366150
Use a tree for routing.
ZeroIntensity Jun 23, 2025
d1dacf0
Store path parameters on the request.
ZeroIntensity Jun 23, 2025
425cfe4
Clean up the gitignore.
ZeroIntensity Jun 23, 2025
2cdf456
Some improvements to status code exceptions.
ZeroIntensity Jun 23, 2025
97360de
Some cleanups.
ZeroIntensity Jun 23, 2025
01d6005
Add a test for path parameters.
ZeroIntensity Jun 24, 2025
8829ad8
Add a test for request methods and manual requests.
ZeroIntensity Jun 24, 2025
4af94c2
Support different methods for the same route.
ZeroIntensity Jun 24, 2025
35eac70
Add docstrings to the request methods.
ZeroIntensity Jun 24, 2025
6735695
Return the traceback from InternalServerError when debugging is enabled.
ZeroIntensity Jun 24, 2025
6204e9b
Add type hints to CIMultiDict creations.
ZeroIntensity Jun 24, 2025
a0c5d95
Add missing docstrings.
ZeroIntensity Jun 24, 2025
9c06fb4
Add a test for path normalization.
ZeroIntensity Jun 24, 2025
b54b75a
Add a __debug__ check.
ZeroIntensity Jun 24, 2025
bbcfb0b
Remove a comment and change a type.
ZeroIntensity Jun 24, 2025
df7e2bc
Eliminate some redundancy in the requests tests.
ZeroIntensity Jun 24, 2025
f4a658e
Support returning tuples from views.
ZeroIntensity Jun 24, 2025
4bea833
Some nonspecific improvements.
ZeroIntensity Jun 24, 2025
edacecd
Remove generation artifacts.
ZeroIntensity Jun 24, 2025
decc47b
Normalize exception message capitalization.
ZeroIntensity Jun 24, 2025
ded0419
Remove unused import.
ZeroIntensity Jun 24, 2025
ade5d1a
Fix status enums.
ZeroIntensity Jun 24, 2025
479e3ef
Add a test for tuple responses.
ZeroIntensity Jun 24, 2025
4c302af
Add a test for streaming responses.
ZeroIntensity Jun 24, 2025
a17475d
Add a test for file responses.
ZeroIntensity Jun 24, 2025
da1bad8
Improve a comment.
ZeroIntensity Jun 24, 2025
2d439d2
Add a sanity check for response tuples.
ZeroIntensity Jun 24, 2025
dead1bd
Add some colors and a sanity check.
ZeroIntensity Jun 24, 2025
62bc8f4
Add a simple test for status codes.
ZeroIntensity Jun 24, 2025
92dc2b7
Fix a docstring.
ZeroIntensity Jun 24, 2025
65bcfef
Add error codes and explanations.
ZeroIntensity Jul 26, 2025
3217995
Use InvalidType in some places.
ZeroIntensity Jul 26, 2025
fb4677e
Simple change to the morals.
ZeroIntensity Jul 26, 2025
45323c3
Improve the __all__ of the HTTP exceptions module.
ZeroIntensity Jul 26, 2025
c8a5643
Improve the docstring of InvalidType.
ZeroIntensity Jul 26, 2025
41aed3b
Add docstrings to Request.
ZeroIntensity Jul 26, 2025
99dfeda
Add __all__ to the headers to module.
ZeroIntensity Jul 26, 2025
6a4251b
Remove the outdated contributing file.
ZeroIntensity Jul 26, 2025
ad4a07e
Remove unused import.
ZeroIntensity Jul 26, 2025
e8a83d3
Fix a missing import.
ZeroIntensity Jul 26, 2025
94fb322
Add some additional logging to the server lifecycle.
ZeroIntensity Jul 26, 2025
6b9bc0e
Add pre-commit.
ZeroIntensity Oct 11, 2025
578a759
Outline for HTML responses.
ZeroIntensity Nov 27, 2025
12e423c
Add support for status codes in HTML responses.
ZeroIntensity Nov 27, 2025
3216949
Run formatter.
ZeroIntensity Nov 27, 2025
e981aac
Let Black pick the imports.
ZeroIntensity Nov 27, 2025
2277bd5
Improve the sample.
ZeroIntensity Nov 27, 2025
463b5e0
Add a bunch of HTML nodes.
ZeroIntensity Nov 29, 2025
b8c7655
Mark global attributes as not required.
ZeroIntensity Nov 29, 2025
2b9e915
Fix some syntax errors.
ZeroIntensity Nov 29, 2025
fcf072d
Fix WSGI server issues.
ZeroIntensity Dec 28, 2025
c813fc3
Temporarily disable the C extension.
ZeroIntensity Dec 28, 2025
3392fbe
Fix default values for DOM nodes.
ZeroIntensity Dec 28, 2025
5da93a6
Add a context variable for the current app.
ZeroIntensity Dec 28, 2025
94284a8
Switch my email.
ZeroIntensity Dec 28, 2025
1dec323
Some basic implementation of in-memory caching.
ZeroIntensity Dec 28, 2025
7e79d0f
Use InvalidType() instead of TypeError() in some places.
ZeroIntensity Dec 28, 2025
2d908d3
Add more custom exception objects.
ZeroIntensity Dec 28, 2025
6f605d0
Run formatter.
ZeroIntensity Dec 28, 2025
1199a24
Support creating routes with the division operator.
ZeroIntensity Dec 28, 2025
0d88b69
Add a test for route division.
ZeroIntensity Dec 28, 2025
83365d2
Fix route division.
ZeroIntensity Dec 28, 2025
8f8b46a
Add a list of all DOM primitives.
ZeroIntensity Dec 28, 2025
e628a1f
Don't include default values in rendered HTML.
ZeroIntensity Dec 28, 2025
38d509d
Add a test for DOM nodes.
ZeroIntensity Dec 28, 2025
85a4baa
Fix the failing tests.
ZeroIntensity Dec 28, 2025
ad594d1
Add a test for the html_response decorator.
ZeroIntensity Dec 28, 2025
4bb13be
Fix caching.
ZeroIntensity Dec 28, 2025
9cb00e5
Add some tests for caching.
ZeroIntensity Dec 28, 2025
ff29a66
Run the formatter.
ZeroIntensity Dec 28, 2025
ddc6f0f
Remove wildcard imports in the __init__.py file.
ZeroIntensity Dec 28, 2025
b2c9e04
Change my email in the __about__.
ZeroIntensity Dec 28, 2025
a22816c
Remove error code system.
ZeroIntensity Dec 28, 2025
a51805f
Split up the DOM code.
ZeroIntensity Dec 28, 2025
f55d124
Update the DOM tests.
ZeroIntensity Dec 28, 2025
d2b6dac
Implement user components in the DOM API.
ZeroIntensity Dec 28, 2025
0405403
Improve internals for the DOM.
ZeroIntensity Dec 28, 2025
7a8e0f0
Update the version to 0.1.0.
ZeroIntensity Dec 28, 2025
452e987
Move components to their own file.
ZeroIntensity Dec 28, 2025
c991ed8
Add a test for components.
ZeroIntensity Dec 28, 2025
91d0357
Add a test for multiple children.
ZeroIntensity Dec 28, 2025
8e3a37c
Fix type hint in the error() decorator.
ZeroIntensity Dec 29, 2025
97595c7
Run isort on the tests.
ZeroIntensity Dec 29, 2025
3c9f354
Add a json() method for bodies.
ZeroIntensity Dec 29, 2025
7fd9574
Move as_bytes() to the private API.
ZeroIntensity Dec 29, 2025
1485845
Add a dedicated exception for server start failures.
ZeroIntensity Dec 29, 2025
143ebeb
Move CachedResponse() to the private API.
ZeroIntensity Dec 29, 2025
a75e94c
Add a test for all error status codes.
ZeroIntensity Dec 29, 2025
bb6d8eb
Add a test for exceptions on the server.
ZeroIntensity Dec 29, 2025
171f49c
Only provide the traceback in debug mode.
ZeroIntensity Dec 29, 2025
2a6e1c4
Remove dead files from old version.
ZeroIntensity Dec 29, 2025
6dc02d7
Add a JSON response object.
ZeroIntensity Dec 29, 2025
8dc0f4d
Add a test for JSON responses.
ZeroIntensity Dec 29, 2025
925617a
Rename StrOrBytesResponse to TextResponse.
ZeroIntensity Dec 29, 2025
3cd739d
Add a component for common HTML boilerplate.
ZeroIntensity Dec 29, 2025
6c3ff65
Add a submodule for running apps.
ZeroIntensity Dec 29, 2025
bcc0250
Add missing TypeAlias annotation.
ZeroIntensity Dec 29, 2025
167dc37
Remove dead CMake file.
ZeroIntensity Dec 29, 2025
4efe92c
Add utilities for reraising exceptions.
ZeroIntensity Dec 29, 2025
5b110ee
Fix declaration with same name.
ZeroIntensity Dec 29, 2025
27ef450
Add __debug__ to instance check condition.
ZeroIntensity Dec 29, 2025
8cecabe
Simple implementation of server-side JavaScript compilation.
ZeroIntensity Dec 29, 2025
f10cae4
Add missing docstring.
ZeroIntensity Dec 29, 2025
a523329
Add missing __all__.
ZeroIntensity Dec 29, 2025
1518aad
Improvements to the page component.
ZeroIntensity Dec 29, 2025
ae22870
Add query string parameters to requests.
ZeroIntensity Dec 29, 2025
3a07441
Fix the test suite.
ZeroIntensity Dec 29, 2025
ffdb6ad
Rename the server test.
ZeroIntensity Dec 29, 2025
bfef342
Add a view.core module.
ZeroIntensity Dec 29, 2025
b3da40b
Run isort.
ZeroIntensity Dec 29, 2025
b0d243f
Use collections.abc imports instead of typing imports.
ZeroIntensity Dec 29, 2025
bf50bc4
Use collections types instead of dict and list where possible.
ZeroIntensity Dec 29, 2025
84d8e72
Add a test for running a server in a subprocess.
ZeroIntensity Dec 29, 2025
60c53ba
Add missing docstring.
ZeroIntensity Dec 29, 2025
ebc9916
Add JavaScript protocol for HTML nodes.
ZeroIntensity Dec 29, 2025
273a7c9
Setup for subrouters.
ZeroIntensity Dec 29, 2025
2d96a18
Janky implementation of static files.
ZeroIntensity Dec 29, 2025
445fb16
Add explicit None.
ZeroIntensity Dec 29, 2025
36d4d09
Disallow path parameters with subrouters.
ZeroIntensity Dec 30, 2025
b9ab6fb
Include the canonical URL in the startup message.
ZeroIntensity Dec 30, 2025
a709030
Clean up internals for static files.
ZeroIntensity Dec 30, 2025
716ea94
Add more type checks.
ZeroIntensity Dec 30, 2025
e60368b
Add a test for static files.
ZeroIntensity Dec 30, 2025
c0c35c9
Swap parameters for InvalidType().
ZeroIntensity Dec 30, 2025
eeff626
Support *args in InvalidType().
ZeroIntensity Dec 30, 2025
5c81ac8
Fix punctuation in comment.
ZeroIntensity Dec 30, 2025
b49e93e
Ensure all files have an __all__.
ZeroIntensity Dec 30, 2025
20d10f6
Add a test for subrouters.
ZeroIntensity Dec 30, 2025
8dbd59f
Eliminate some duplication in the test suite by adding utilities.
ZeroIntensity Dec 30, 2025
ba688d9
Move status_codes to view.core
ZeroIntensity Dec 30, 2025
c7c8e4e
Add a warning message for HTTP errors in tracebacks.
ZeroIntensity Dec 30, 2025
26d2295
Use a note on 3.11+
ZeroIntensity Dec 30, 2025
9715c9d
Remove some dead workflows.
ZeroIntensity Dec 30, 2025
54fd086
Remove workflows from the README.
ZeroIntensity Dec 31, 2025
f3d1cb8
Add WIP note to the README.
ZeroIntensity Dec 31, 2025
726f58b
Update CI for the new stuff.
ZeroIntensity Dec 31, 2025
39b79f1
Remove morals file.
ZeroIntensity Dec 31, 2025
818b1ce
Fix Hatch config.
ZeroIntensity Dec 31, 2025
db274a7
Fix usage of 3.13+ mimetypes function.
ZeroIntensity Dec 31, 2025
22acfe4
Fix Python 3.10.
ZeroIntensity Dec 31, 2025
8011eab
Remove problematic assertion for non-Linux.
ZeroIntensity Dec 31, 2025
b3fbb5d
Don't use the tempfile re-entrantly.
ZeroIntensity Dec 31, 2025
2caab29
Force use of "fork" start method.
ZeroIntensity Dec 31, 2025
23b1c1a
Slap a band-aid on the test.
ZeroIntensity Dec 31, 2025
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
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ body:
description: >
Give a clear description on what's going wrong and how to reproduce it, if possible.

This should only be for *bugs*, not crashes. For that, use the crash template.

value: |
```py
# Add your code here, if needed
Expand Down
36 changes: 0 additions & 36 deletions .github/ISSUE_TEMPLATE/crash.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/discussion.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
value: |
# Feature Proposal

This is where you should propose a *new* feature to view.py. New features should not make breaking changes. This should be for something totally new, such as adding a new function. For general improvements to existing features, make an improvement request.
This is where you should propose a new feature to view.py.
- type: textarea
attributes:
label: "Proposal:"
Expand Down
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/improvement.yml

This file was deleted.

74 changes: 19 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,91 +4,55 @@ on:
push:
tags:
- v*
branches:
- master
paths:
- "src/**"
pull_request:
branches:
- master

concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true

env:
SKBUILD_CMAKE_BUILD_TYPE: "Release"
CIBW_SKIP: >
pp*

jobs:
binary-wheels-standard:
name: Binary wheels for ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
with:
# Fetch all tags
fetch-depth: 0

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64
HATCH_BUILD_HOOKS_ENABLE: "true"

- uses: actions/upload-artifact@v2
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error

binary-wheels-arm:
name: Build Linux wheels for ARM
pure-python-wheel-and-sdist:
name: Build a pure Python wheel and source distribution
runs-on: ubuntu-latest
# Very slow, no need to run on PRs
if: >
github.event_name == 'push'
&&
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Fetch all tags
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Install build dependencies
run: python -m pip install --upgrade build

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: aarch64
HATCH_BUILD_HOOKS_ENABLE: "true"
- name: Build
run: python -m build

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: wheelhouse/*.whl
path: dist/*
if-no-files-found: error

publish:
name: Publish release
needs:
- binary-wheels-standard
- binary-wheels-arm
- pure-python-wheel-and-sdist
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifacts
path: dist

- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
skip_existing: true
user: __token__
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/memory_check.yml

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v2
Expand All @@ -37,11 +37,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Pytest
run: pip install pytest pytest-asyncio

- name: Build view.py
run: pip install .[full]
- name: Install Hatch
run: pip install hatch

- name: Run tests
run: pytest -x
run: hatch test
40 changes: 0 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
# Python
__pycache__/
.venv/
38venv/
39venv/
311venv/

# LSP
.vscode/
compile_flags.txt
pyawaitable.h

# View Configurations
view.toml
view.json
view_config.py

# Testing Files
*.test
test.py
a.py
.coverage
.pytest-cache/
.ruff-cache/
.cache/

# Logs
*.log
vgcore.*
valgrind.txt*

# JavaScript
node_modules/
*.lock
benchmark.py
package-lock.json
client.js
.next/

# Builds
site/
dist/
build/
*.egg-info/
html/dist.css
*.so
a.md
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
language_version: python3.13
Loading