pygrpc-native 0.1.0__tar.gz → 0.2.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.
- pygrpc_native-0.2.0/.github/CODEOWNERS +1 -0
- pygrpc_native-0.2.0/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
- pygrpc_native-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- pygrpc_native-0.2.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- pygrpc_native-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- pygrpc_native-0.2.0/.github/dependabot.yml +20 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/.github/workflows/ci.yml +16 -4
- pygrpc_native-0.2.0/.github/workflows/dco.yml +36 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/.github/workflows/release.yml +8 -8
- pygrpc_native-0.2.0/.github/workflows/stale.yml +37 -0
- pygrpc_native-0.2.0/.pre-commit-config.yaml +28 -0
- pygrpc_native-0.2.0/CODE_OF_CONDUCT.md +128 -0
- pygrpc_native-0.2.0/CONTRIBUTING.md +82 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/Cargo.lock +80 -1
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/Cargo.toml +3 -1
- pygrpc_native-0.2.0/DCO +34 -0
- pygrpc_native-0.2.0/PKG-INFO +241 -0
- pygrpc_native-0.2.0/README.md +226 -0
- pygrpc_native-0.2.0/SECURITY.md +30 -0
- pygrpc_native-0.2.0/benchmarks/README.md +40 -0
- pygrpc_native-0.2.0/benchmarks/echo.py +145 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/pyproject.toml +2 -1
- pygrpc_native-0.2.0/python/pygrpc_native/__init__.py +41 -0
- pygrpc_native-0.2.0/python/pygrpc_native/_native.pyi +68 -0
- pygrpc_native-0.2.0/python/pygrpc_native/_server.py +597 -0
- pygrpc_native-0.2.0/python/pygrpc_native/aio.py +507 -0
- pygrpc_native-0.2.0/python/pygrpc_native/py.typed +0 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/src/lib.rs +305 -51
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/src/server.rs +328 -21
- pygrpc_native-0.2.0/tests/test_add_methods.py +76 -0
- pygrpc_native-0.2.0/tests/test_aio.py +567 -0
- pygrpc_native-0.2.0/tests/test_api.py +120 -0
- pygrpc_native-0.2.0/tests/test_bearer_auth.py +151 -0
- pygrpc_native-0.2.0/tests/test_call_details.py +168 -0
- pygrpc_native-0.2.0/tests/test_delay_stream_headers.py +106 -0
- pygrpc_native-0.2.0/tests/test_fallback.py +150 -0
- pygrpc_native-0.2.0/tests/test_response_metadata.py +111 -0
- pygrpc_native-0.2.0/tests/test_server.py +423 -0
- pygrpc_native-0.2.0/tests/test_stream_try_send.py +74 -0
- pygrpc_native-0.1.0/PKG-INFO +0 -141
- pygrpc_native-0.1.0/README.md +0 -126
- pygrpc_native-0.1.0/pygrpc_native.pyi +0 -31
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/.gitignore +0 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/LICENSE +0 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/tests/test_calls.py +0 -0
- {pygrpc_native-0.1.0 → pygrpc_native-0.2.0}/tests/test_front.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @theminjunchoi
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something doesn't work as documented
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**To reproduce**
|
|
13
|
+
A minimal script or steps that show the problem.
|
|
14
|
+
|
|
15
|
+
**Expected behavior**
|
|
16
|
+
What you expected to happen instead.
|
|
17
|
+
|
|
18
|
+
**Environment**
|
|
19
|
+
- pygrpc-native version:
|
|
20
|
+
- grpcio version (client):
|
|
21
|
+
- Python version:
|
|
22
|
+
- OS and architecture:
|
|
23
|
+
|
|
24
|
+
**Additional context**
|
|
25
|
+
Logs, tracebacks or anything else that helps.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea or an improvement
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**What problem would this solve?**
|
|
10
|
+
A clear and concise description of the problem, e.g. "I can't serve ... because ...".
|
|
11
|
+
|
|
12
|
+
**Describe the solution you'd like**
|
|
13
|
+
What you want to happen.
|
|
14
|
+
|
|
15
|
+
**Describe alternatives you've considered**
|
|
16
|
+
Other solutions or workarounds you've tried.
|
|
17
|
+
|
|
18
|
+
**Additional context**
|
|
19
|
+
Anything else, such as how you use pygrpc-native.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- Thanks for your contribution! Please read CONTRIBUTING.md first.
|
|
2
|
+
Prefix the title with the type of change, e.g. [Bugfix] or [Core].
|
|
3
|
+
If this PR closes an issue, add "Fixes #<number>" below. -->
|
|
4
|
+
|
|
5
|
+
**What this PR does / why we need it**:
|
|
6
|
+
|
|
7
|
+
**How it was tested**:
|
|
8
|
+
|
|
9
|
+
**Special notes for your reviewers**:
|
|
10
|
+
|
|
11
|
+
**If applicable**:
|
|
12
|
+
|
|
13
|
+
- [ ] this PR changes user-facing behavior, and the README is updated
|
|
14
|
+
- [ ] this PR contains tests
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
labels: ["dependencies"]
|
|
8
|
+
- package-ecosystem: "cargo"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
labels: ["dependencies"]
|
|
13
|
+
open-pull-requests-limit: 5
|
|
14
|
+
ignore:
|
|
15
|
+
- dependency-name: "*"
|
|
16
|
+
update-types: ["version-update:semver-patch"]
|
|
17
|
+
groups:
|
|
18
|
+
minor-update:
|
|
19
|
+
applies-to: version-updates
|
|
20
|
+
update-types: ["minor"]
|
|
@@ -9,10 +9,22 @@ permissions:
|
|
|
9
9
|
contents: read
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
# rustfmt and clippy run in the rust job.
|
|
20
|
+
- run: |
|
|
21
|
+
python -m pip install pre-commit
|
|
22
|
+
SKIP=rust-fmt,rust-clippy pre-commit run --all-files --show-diff-on-failure
|
|
23
|
+
|
|
12
24
|
rust:
|
|
13
25
|
runs-on: ubuntu-latest
|
|
14
26
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
28
|
- uses: dtolnay/rust-toolchain@stable
|
|
17
29
|
with:
|
|
18
30
|
components: rustfmt, clippy
|
|
@@ -28,14 +40,14 @@ jobs:
|
|
|
28
40
|
python: ["3.10", "3.13"]
|
|
29
41
|
runs-on: ${{ matrix.os }}
|
|
30
42
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
32
|
-
- uses: actions/setup-python@
|
|
43
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
44
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
33
45
|
with:
|
|
34
46
|
python-version: ${{ matrix.python }}
|
|
35
47
|
- uses: dtolnay/rust-toolchain@stable
|
|
36
48
|
- name: Build and install
|
|
37
49
|
run: |
|
|
38
|
-
python -m pip install maturin pytest grpcio
|
|
50
|
+
python -m pip install maturin pytest grpcio grpcio-tools grpcio-health-checking grpcio-reflection uvloop
|
|
39
51
|
maturin build --release --locked --out dist
|
|
40
52
|
python -m pip install dist/*.whl
|
|
41
53
|
- run: pytest -q tests
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: DCO
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
signoff:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
- name: Check every commit is signed off
|
|
17
|
+
env:
|
|
18
|
+
BASE: ${{ github.event.pull_request.base.sha }}
|
|
19
|
+
HEAD: ${{ github.event.pull_request.head.sha }}
|
|
20
|
+
run: |
|
|
21
|
+
missing=0
|
|
22
|
+
for sha in $(git rev-list --no-merges "$BASE..$HEAD"); do
|
|
23
|
+
author=$(git log -1 --format='%an <%ae>' "$sha")
|
|
24
|
+
# Bots such as Dependabot can't certify the DCO; the DCO app skips them too.
|
|
25
|
+
if [[ "$(git log -1 --format='%an' "$sha")" == *"[bot]" ]]; then
|
|
26
|
+
continue
|
|
27
|
+
fi
|
|
28
|
+
if ! git log -1 --format='%B' "$sha" | grep -qiF "Signed-off-by: $author"; then
|
|
29
|
+
echo "::error::$(git log -1 --format='%h %s' "$sha") has no 'Signed-off-by: $author'"
|
|
30
|
+
missing=1
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
if [ "$missing" -ne 0 ]; then
|
|
34
|
+
echo "Sign off with 'git rebase --signoff $GITHUB_BASE_REF' and force-push. See CONTRIBUTING.md."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
target: x86_64-apple-darwin
|
|
27
27
|
runs-on: ${{ matrix.runner }}
|
|
28
28
|
steps:
|
|
29
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
30
|
- name: Check the tag matches Cargo.toml
|
|
31
31
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
32
32
|
run: |
|
|
@@ -39,16 +39,16 @@ jobs:
|
|
|
39
39
|
args: --release --locked --out dist
|
|
40
40
|
# The oldest Python the abi3 wheel claims; the x86_64 macOS wheel can't
|
|
41
41
|
# run on the arm64 runner, so it is only built.
|
|
42
|
-
- uses: actions/setup-python@
|
|
42
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
43
43
|
if: matrix.target != 'x86_64-apple-darwin'
|
|
44
44
|
with:
|
|
45
45
|
python-version: "3.10"
|
|
46
46
|
- name: Test the wheel
|
|
47
47
|
if: matrix.target != 'x86_64-apple-darwin'
|
|
48
48
|
run: |
|
|
49
|
-
python -m pip install pytest grpcio dist/*.whl
|
|
49
|
+
python -m pip install pytest grpcio grpcio-tools dist/*.whl
|
|
50
50
|
pytest -q tests
|
|
51
|
-
- uses: actions/upload-artifact@
|
|
51
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
52
52
|
with:
|
|
53
53
|
name: wheels-${{ matrix.target }}
|
|
54
54
|
path: dist/*.whl
|
|
@@ -56,12 +56,12 @@ jobs:
|
|
|
56
56
|
sdist:
|
|
57
57
|
runs-on: ubuntu-latest
|
|
58
58
|
steps:
|
|
59
|
-
- uses: actions/checkout@
|
|
59
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
60
60
|
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
61
61
|
with:
|
|
62
62
|
command: sdist
|
|
63
63
|
args: --out dist
|
|
64
|
-
- uses: actions/upload-artifact@
|
|
64
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
65
65
|
with:
|
|
66
66
|
name: sdist
|
|
67
67
|
path: dist/*.tar.gz
|
|
@@ -74,8 +74,8 @@ jobs:
|
|
|
74
74
|
permissions:
|
|
75
75
|
id-token: write
|
|
76
76
|
steps:
|
|
77
|
-
- uses: actions/download-artifact@
|
|
77
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
78
78
|
with:
|
|
79
79
|
merge-multiple: true
|
|
80
80
|
path: dist
|
|
81
|
-
- uses: pypa/gh-action-pypi-publish@
|
|
81
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Close stale issues and PRs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "30 1 * * *"
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
stale:
|
|
12
|
+
permissions:
|
|
13
|
+
issues: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
|
|
18
|
+
with:
|
|
19
|
+
stale-issue-label: stale
|
|
20
|
+
stale-issue-message: >
|
|
21
|
+
This issue has been automatically marked as stale because it has not had activity within 60 days.
|
|
22
|
+
It will be automatically closed if no further activity occurs within 30 days.
|
|
23
|
+
close-issue-message: >
|
|
24
|
+
This issue has been automatically closed due to inactivity.
|
|
25
|
+
Please feel free to reopen if you feel it is still relevant!
|
|
26
|
+
days-before-issue-stale: 60
|
|
27
|
+
days-before-issue-close: 30
|
|
28
|
+
stale-pr-label: stale
|
|
29
|
+
stale-pr-message: >
|
|
30
|
+
This pull request has been automatically marked as stale because it has not had activity within 60 days.
|
|
31
|
+
It will be automatically closed if no further activity occurs within 30 days.
|
|
32
|
+
close-pr-message: >
|
|
33
|
+
This pull request has been automatically closed due to inactivity.
|
|
34
|
+
Please feel free to reopen if you intend to continue working on it!
|
|
35
|
+
days-before-pr-stale: 60
|
|
36
|
+
days-before-pr-close: 30
|
|
37
|
+
operations-per-run: 300
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.11.7
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
- repo: https://github.com/codespell-project/codespell
|
|
9
|
+
rev: v2.4.1
|
|
10
|
+
hooks:
|
|
11
|
+
- id: codespell
|
|
12
|
+
exclude: ^Cargo\.lock$
|
|
13
|
+
# "te" is an HTTP/2 header name.
|
|
14
|
+
args: [--ignore-words-list, te]
|
|
15
|
+
- repo: local
|
|
16
|
+
hooks:
|
|
17
|
+
- id: rust-fmt
|
|
18
|
+
name: rustfmt
|
|
19
|
+
entry: cargo fmt --
|
|
20
|
+
language: system
|
|
21
|
+
types: [rust]
|
|
22
|
+
pass_filenames: false
|
|
23
|
+
- id: rust-clippy
|
|
24
|
+
name: clippy
|
|
25
|
+
entry: cargo clippy --locked --all-targets --no-default-features -- -D warnings
|
|
26
|
+
language: system
|
|
27
|
+
types: [rust]
|
|
28
|
+
pass_filenames: false
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socioeconomic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
mj04300017@gmail.com.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping out! Bug reports, fixes and new features are all welcome.
|
|
4
|
+
|
|
5
|
+
## Before you write code
|
|
6
|
+
|
|
7
|
+
For a new feature or a bug you found, open an issue first so we can agree on
|
|
8
|
+
the approach. Small fixes such as typos can go straight to a pull request.
|
|
9
|
+
|
|
10
|
+
## Development setup
|
|
11
|
+
|
|
12
|
+
You need a Rust toolchain (1.88 or later) and Python 3.10 or later.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git clone https://github.com/<you>/pygrpc-native && cd pygrpc-native
|
|
16
|
+
python -m venv .venv && source .venv/bin/activate
|
|
17
|
+
pip install maturin pytest grpcio grpcio-tools pre-commit
|
|
18
|
+
maturin develop --release
|
|
19
|
+
pre-commit install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Checks
|
|
23
|
+
|
|
24
|
+
CI runs the same checks, so run them before you push:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pre-commit run --all-files # rustfmt, clippy, ruff, codespell
|
|
28
|
+
cargo test --locked --no-default-features # Rust unit tests
|
|
29
|
+
maturin develop --release && pytest tests # Python tests
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
New behavior needs a test, and a bug fix needs a test that fails without it.
|
|
33
|
+
Write tests against the documented behavior rather than the implementation.
|
|
34
|
+
|
|
35
|
+
## Commits
|
|
36
|
+
|
|
37
|
+
Every commit must carry a `Signed-off-by` trailer certifying that you agree
|
|
38
|
+
to the [Developer Certificate of Origin](DCO). `git commit -s` adds it:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git commit -s -m "Describe the change"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If you forgot, `git commit --amend -s` fixes the last commit and
|
|
45
|
+
`git rebase --signoff main` fixes all of them. The DCO check fails on any
|
|
46
|
+
commit without it.
|
|
47
|
+
|
|
48
|
+
## Pull requests
|
|
49
|
+
|
|
50
|
+
- Prefix the title with the type of change, every one that applies:
|
|
51
|
+
`[Bugfix]`, `[Build]`, `[CI]`, `[Core]`, `[Doc]`, `[Misc]`, `[Perf]`,
|
|
52
|
+
`[Test]`. For example, `[Bugfix] Fail a stream cut by close()`.
|
|
53
|
+
- Fill in the PR template: what changed, why, and how you tested it. For
|
|
54
|
+
performance changes, include the numbers and how you measured them.
|
|
55
|
+
- Keep a PR to one change. Split unrelated changes into separate PRs.
|
|
56
|
+
- Address review feedback with new commits on the same branch. PRs are
|
|
57
|
+
squashed on merge, so there is no need to tidy the history.
|
|
58
|
+
|
|
59
|
+
## What a PR needs to merge
|
|
60
|
+
|
|
61
|
+
The DCO, lint, rust and python checks have to pass, and a PR needs one
|
|
62
|
+
approving review with every review thread resolved. `main` keeps a linear
|
|
63
|
+
history: PRs are squash-merged with the PR title as the commit title, and
|
|
64
|
+
force pushes and branch deletion are blocked. Issues and PRs with no activity
|
|
65
|
+
for 60 days are marked stale and closed 30 days later.
|
|
66
|
+
|
|
67
|
+
## Releases
|
|
68
|
+
|
|
69
|
+
Releases follow semantic versioning. Existing users call the low-level API
|
|
70
|
+
directly, so `tests/test_api.py` pins its names, signatures and event tuples;
|
|
71
|
+
change it only together with a breaking release.
|
|
72
|
+
|
|
73
|
+
Before a release:
|
|
74
|
+
|
|
75
|
+
1. Bump the version in `Cargo.toml`.
|
|
76
|
+
2. Build the wheel and run the tests of known downstream projects against it.
|
|
77
|
+
3. Push a `vX.Y.Z` tag. The release workflow builds the wheels and publishes
|
|
78
|
+
them to PyPI.
|
|
79
|
+
|
|
80
|
+
## Reporting security issues
|
|
81
|
+
|
|
82
|
+
Please don't open a public issue. See [SECURITY.md](SECURITY.md).
|
|
@@ -29,6 +29,15 @@ version = "0.22.1"
|
|
|
29
29
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
30
|
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
|
31
31
|
|
|
32
|
+
[[package]]
|
|
33
|
+
name = "block-buffer"
|
|
34
|
+
version = "0.10.4"
|
|
35
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
36
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
37
|
+
dependencies = [
|
|
38
|
+
"generic-array",
|
|
39
|
+
]
|
|
40
|
+
|
|
32
41
|
[[package]]
|
|
33
42
|
name = "bytes"
|
|
34
43
|
version = "1.12.1"
|
|
@@ -41,6 +50,15 @@ version = "1.0.5"
|
|
|
41
50
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
42
51
|
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
43
52
|
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "cpufeatures"
|
|
55
|
+
version = "0.2.17"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"libc",
|
|
60
|
+
]
|
|
61
|
+
|
|
44
62
|
[[package]]
|
|
45
63
|
name = "crc32fast"
|
|
46
64
|
version = "1.5.3"
|
|
@@ -65,6 +83,26 @@ version = "0.8.23"
|
|
|
65
83
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
84
|
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
|
|
67
85
|
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "crypto-common"
|
|
88
|
+
version = "0.1.7"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
91
|
+
dependencies = [
|
|
92
|
+
"generic-array",
|
|
93
|
+
"typenum",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "digest"
|
|
98
|
+
version = "0.10.7"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
101
|
+
dependencies = [
|
|
102
|
+
"block-buffer",
|
|
103
|
+
"crypto-common",
|
|
104
|
+
]
|
|
105
|
+
|
|
68
106
|
[[package]]
|
|
69
107
|
name = "equivalent"
|
|
70
108
|
version = "1.0.3"
|
|
@@ -127,6 +165,16 @@ dependencies = [
|
|
|
127
165
|
"slab",
|
|
128
166
|
]
|
|
129
167
|
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "generic-array"
|
|
170
|
+
version = "0.14.7"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
173
|
+
dependencies = [
|
|
174
|
+
"typenum",
|
|
175
|
+
"version_check",
|
|
176
|
+
]
|
|
177
|
+
|
|
130
178
|
[[package]]
|
|
131
179
|
name = "h2"
|
|
132
180
|
version = "0.4.20"
|
|
@@ -344,7 +392,7 @@ dependencies = [
|
|
|
344
392
|
|
|
345
393
|
[[package]]
|
|
346
394
|
name = "pygrpc_native"
|
|
347
|
-
version = "0.
|
|
395
|
+
version = "0.2.0"
|
|
348
396
|
dependencies = [
|
|
349
397
|
"bytes",
|
|
350
398
|
"crossbeam-channel",
|
|
@@ -357,6 +405,8 @@ dependencies = [
|
|
|
357
405
|
"log",
|
|
358
406
|
"pyo3",
|
|
359
407
|
"pyo3-log",
|
|
408
|
+
"sha2",
|
|
409
|
+
"subtle",
|
|
360
410
|
"tokio",
|
|
361
411
|
"tonic",
|
|
362
412
|
]
|
|
@@ -444,6 +494,17 @@ version = "1.0.23"
|
|
|
444
494
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
445
495
|
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
446
496
|
|
|
497
|
+
[[package]]
|
|
498
|
+
name = "sha2"
|
|
499
|
+
version = "0.10.9"
|
|
500
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
501
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
502
|
+
dependencies = [
|
|
503
|
+
"cfg-if",
|
|
504
|
+
"cpufeatures",
|
|
505
|
+
"digest",
|
|
506
|
+
]
|
|
507
|
+
|
|
447
508
|
[[package]]
|
|
448
509
|
name = "simd-adler32"
|
|
449
510
|
version = "0.3.10"
|
|
@@ -472,6 +533,12 @@ dependencies = [
|
|
|
472
533
|
"windows-sys",
|
|
473
534
|
]
|
|
474
535
|
|
|
536
|
+
[[package]]
|
|
537
|
+
name = "subtle"
|
|
538
|
+
version = "2.6.1"
|
|
539
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
540
|
+
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|
541
|
+
|
|
475
542
|
[[package]]
|
|
476
543
|
name = "syn"
|
|
477
544
|
version = "2.0.119"
|
|
@@ -650,12 +717,24 @@ version = "0.2.5"
|
|
|
650
717
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
651
718
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
|
652
719
|
|
|
720
|
+
[[package]]
|
|
721
|
+
name = "typenum"
|
|
722
|
+
version = "1.20.1"
|
|
723
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
724
|
+
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
725
|
+
|
|
653
726
|
[[package]]
|
|
654
727
|
name = "unicode-ident"
|
|
655
728
|
version = "1.0.27"
|
|
656
729
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
657
730
|
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
658
731
|
|
|
732
|
+
[[package]]
|
|
733
|
+
name = "version_check"
|
|
734
|
+
version = "0.9.5"
|
|
735
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
736
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
737
|
+
|
|
659
738
|
[[package]]
|
|
660
739
|
name = "want"
|
|
661
740
|
version = "0.3.2"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[package]
|
|
4
4
|
name = "pygrpc_native"
|
|
5
|
-
version = "0.
|
|
5
|
+
version = "0.2.0"
|
|
6
6
|
edition = "2021"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
description = "A gRPC server in Rust that hands calls to Python handlers in batches"
|
|
@@ -32,6 +32,8 @@ hyper-util = { version = "0.1", features = ["tokio"] }
|
|
|
32
32
|
log = "0.4"
|
|
33
33
|
pyo3 = { version = "0.29", features = ["abi3-py310"] }
|
|
34
34
|
pyo3-log = "0.13"
|
|
35
|
+
sha2 = "0.10"
|
|
36
|
+
subtle = "2.6"
|
|
35
37
|
tokio = { version = "1", features = ["rt-multi-thread", "net", "sync", "time", "macros"] }
|
|
36
38
|
tonic = { version = "0.14", default-features = false, features = ["server", "gzip"] }
|
|
37
39
|
|