Skip to content

Commit 7fe3e45

Browse files
Format markdown
CHANGELOG.md 32ms cmd/fcloudevent/README.md 6ms cmd/fhttp/README.md 3ms �[90mCODE-OF-CONDUCT.md�[39m 1ms (unchanged) README.md 14ms src/func_python/README.md 3ms Signed-off-by: Knative Automation <automation@knative.team>
1 parent ab550a0 commit 7fe3e45

5 files changed

Lines changed: 31 additions & 24 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99
## [Unreleased]
1010

1111
### Added
12+
1213
### Changed
14+
1315
### Deprecated
16+
1417
### Removed
18+
1519
### Fixed
20+
1621
### Security
1722

1823
## 0.8.1 - 2026-04-14
@@ -81,5 +86,3 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
8186
### Added
8287

8388
- Initial Implementation of the Python HTTP Functions Middleware
84-
85-

‎README.md‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This middleware is used by Knative Functions to expose a Function written in
44
Python as a network service.
55

66
## Contents
7+
78
```
89
.
910
├── cmd
@@ -43,7 +44,7 @@ library is used when integrate with Functions, and can be useful during dev.
4344
- install dependencies with `poetry install`
4445
- activate the virtual environment managed by poetry via `poetry shell`
4546
Note that in some environments this command may cause collissions with
46-
configured keyboard shortcuts. If there are problems, you can instead
47+
configured keyboard shortcuts. If there are problems, you can instead
4748
source the environment variables directly with:
4849
`source $(poetry env info --path)/bin/activate`
4950
- run the example via `poetry run python cmd/fhttp/main.py`
@@ -54,8 +55,8 @@ library is used when integrate with Functions, and can be useful during dev.
5455
A nice method of development using git worktrees:
5556

5657
p. From a personal fork, create a new worktree for the bug, feature or chore
57-
named appropriately (eg. "feature-a")
58-
`git worktree add feature-a`
58+
named appropriately (eg. "feature-a")
59+
`git worktree add feature-a`
5960

6061
2. Implement the code changes and commit.
6162

@@ -80,35 +81,38 @@ is pushed (which triggers production release).
8081

8182
To test, in a test project ensure the it adds the test package as an
8283
explicit source in pyproject.toml:
84+
8385
```
8486
[[tool.poetry.source]]
8587
name = "test-pypi"
8688
url = "https://test.pypi.org/simple/"
8789
priority = "explicit"
8890
```
91+
8992
Then update the dependency to explicitly pull the new version which is only
90-
available on TestPyPI. For example to test a hypothetical unreleased version
93+
available on TestPyPI. For example to test a hypothetical unreleased version
9194
0.1.2:
95+
9296
```
9397
[tool.poetry.dependencies]
9498
func_python = {version = "0.1.2", source = "test-pypi"}
9599
```
100+
96101
Run `poetry install` to install the unreleased version from Test PyPI
97102

98103
Note: do not check in this change.
99104

100-
101105
## Releasing
102106

103107
NOTE: This process is currently undergoing minor tweaks, and thus contains
104-
several manual steps. Once the process is codified, it can be more highly
108+
several manual steps. Once the process is codified, it can be more highly
105109
automated.
106110

107111
1. Create a new branch "release-x.y" from an up-to-date main
108112
When incrementing, follow Semantic Versioning standard. eg:
109-
- Bug fixes: ++ patch version
110-
- Features: ++ minor version
111-
- Breaking Changes: ++ major version
113+
- Bug fixes: ++ patch version
114+
- Features: ++ minor version
115+
- Breaking Changes: ++ major version
112116

113117
2. Update pyproject.toml with the new version.
114118

@@ -134,17 +138,16 @@ automated.
134138

135139
10. Update the GitHub release's notes to be the changelog section's contents .
136140

137-
138141
### Potential improvements
139142

140143
Update to using the suffix "rcX" so as not to confuse folks pulling tags list
141-
from the git repo. Without this suffix, a simple listing of the latest
144+
from the git repo. Without this suffix, a simple listing of the latest
142145
tags from the repo would show a potentially unreleased version as the latest.
143146

144147
With the use of these release-candidate tags, the use of TestPyPI may be
145148
unnecessary.
146149

147150
Perhaps push the RC tag to the PR's commit and test prior to merging the
148151
PR to main, such that a potentially broken version is not kept in the main
149-
branch's history. For example, if v0.1.2rc1 failed, its commit will not be
152+
branch's history. For example, if v0.1.2rc1 failed, its commit will not be
150153
part of the main branch.

‎cmd/fcloudevent/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@ This directory contains an example CloudEvent function that demonstrates how to
55
This is an example usage of the Functions CloudEvents middleware.
66

77
Run the function
8-
```
8+
9+
````
910
1011
## Start the Function
1112
1213
Run the instanced handler (default):
1314
```bash
1415
poetry run python cmd/fcloudevent/main.py
15-
```
16+
````
1617

1718
Run the static handler:
19+
1820
```bash
1921
poetry run python cmd/fcloudevent/main.py --static
2022
```
2123

2224
Change the listen address (default is [::]:8080):
25+
2326
```bash
2427
LISTEN_ADDRESS=127.0.0.1:8081 poetry run python cmd/fcloudevent/main.py
2528
```
@@ -56,6 +59,5 @@ curl -X POST http://127.0.0.1:8080 \
5659
}'
5760
```
5861

59-
6062
To see the actual middleware which is used when building a Python Function,
6163
see the [Functions Python Scaffolding](https://github.com/knative/func/tree/main/templates/python/cloudevents)

‎cmd/fhttp/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ wraps a function and exposes it as a service. Useful for development.
66
This is an example usage of the Functions HTTP middleware.
77

88
Run the function
9+
910
```
1011
poetry run python cmd/fhttp/main.py
1112
```
1213

1314
Send a HTTP request against it:
15+
1416
```
1517
curl -v -X POST http://127.0.0.1:8080/ \
1618
-H "Content-Type: application/json" \

‎src/func_python/README.md‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Functions Python Middleware
22

3-
An ASGI Application which will serve a Function. The ASGI application
3+
An ASGI Application which will serve a Function. The ASGI application
44
is the middleware.
55

6-
The middleware implements lifecycle events such as "start" and "stop", health
6+
The middleware implements lifecycle events such as "start" and "stop", health
77
checks for readiness and liveness, and a handler for HTTP requests.
88

99
The function is expected to implement "handle", and the middleware will
10-
raise an error if the function does not implement this method. Start and stop
11-
are optional. Readiness and liveness are also optional, with the middleware
10+
raise an error if the function does not implement this method. Start and stop
11+
are optional. Readiness and liveness are also optional, with the middleware
1212
providing default implementations.
1313

1414
Signals are handled by the ASGI server implementation hypercorn and initiate
@@ -17,6 +17,3 @@ shutdown of the service.
1717
## Usage
1818

1919
To see a usage example, refer to cmd/fhttp.
20-
21-
22-

0 commit comments

Comments
 (0)