pydynox 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.
- pydynox-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- pydynox-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- pydynox-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +30 -0
- pydynox-0.1.0/.github/workflows/ci.yml +127 -0
- pydynox-0.1.0/.github/workflows/codspeed.yml +59 -0
- pydynox-0.1.0/.github/workflows/release.yml +169 -0
- pydynox-0.1.0/.gitignore +82 -0
- pydynox-0.1.0/CONTRIBUTING.md +145 -0
- pydynox-0.1.0/Cargo.lock +2219 -0
- pydynox-0.1.0/Cargo.toml +35 -0
- pydynox-0.1.0/LICENSE +21 -0
- pydynox-0.1.0/PKG-INFO +296 -0
- pydynox-0.1.0/README.md +271 -0
- pydynox-0.1.0/benchmark/__init__.py +1 -0
- pydynox-0.1.0/benchmark/benchmark.py +613 -0
- pydynox-0.1.0/benchmark/conftest.py +127 -0
- pydynox-0.1.0/pyproject.toml +61 -0
- pydynox-0.1.0/python/pydynox/__init__.py +27 -0
- pydynox-0.1.0/python/pydynox/batch_operations.py +77 -0
- pydynox-0.1.0/python/pydynox/client.py +347 -0
- pydynox-0.1.0/python/pydynox/py.typed +1 -0
- pydynox-0.1.0/python/pydynox/query.py +116 -0
- pydynox-0.1.0/python/pydynox/transaction.py +200 -0
- pydynox-0.1.0/src/basic_operations.rs +702 -0
- pydynox-0.1.0/src/batch_operations.rs +308 -0
- pydynox-0.1.0/src/client.rs +557 -0
- pydynox-0.1.0/src/errors.rs +61 -0
- pydynox-0.1.0/src/lib.rs +39 -0
- pydynox-0.1.0/src/serialization.rs +476 -0
- pydynox-0.1.0/src/transaction_operations.rs +343 -0
- pydynox-0.1.0/tests/__init__.py +1 -0
- pydynox-0.1.0/tests/integration/__init__.py +1 -0
- pydynox-0.1.0/tests/integration/conftest.py +97 -0
- pydynox-0.1.0/tests/integration/operations/__init__.py +1 -0
- pydynox-0.1.0/tests/integration/operations/test_batch_get.py +135 -0
- pydynox-0.1.0/tests/integration/operations/test_batch_write.py +161 -0
- pydynox-0.1.0/tests/integration/operations/test_delete_item.py +91 -0
- pydynox-0.1.0/tests/integration/operations/test_get_item.py +58 -0
- pydynox-0.1.0/tests/integration/operations/test_put_item.py +66 -0
- pydynox-0.1.0/tests/integration/operations/test_query.py +220 -0
- pydynox-0.1.0/tests/integration/operations/test_transaction.py +198 -0
- pydynox-0.1.0/tests/integration/operations/test_update_item.py +202 -0
- pydynox-0.1.0/tests/python/__init__.py +1 -0
- pydynox-0.1.0/tests/python/property/__init__.py +1 -0
- pydynox-0.1.0/tests/python/property/test_serialization_props.py +125 -0
- pydynox-0.1.0/uv.lock +1647 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
A clear description of the bug.
|
|
12
|
+
|
|
13
|
+
## Steps to Reproduce
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# Minimal code to reproduce the issue
|
|
17
|
+
from pydynox import DynamoClient
|
|
18
|
+
|
|
19
|
+
client = DynamoClient()
|
|
20
|
+
# ...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Expected Behavior
|
|
24
|
+
|
|
25
|
+
What you expected to happen.
|
|
26
|
+
|
|
27
|
+
## Actual Behavior
|
|
28
|
+
|
|
29
|
+
What actually happened. Include error messages if any.
|
|
30
|
+
|
|
31
|
+
## Environment
|
|
32
|
+
|
|
33
|
+
- **pydynox version**: (e.g., 0.1.0)
|
|
34
|
+
- **Python version**: (e.g., 3.12)
|
|
35
|
+
- **OS**: (e.g., macOS 14, Ubuntu 22.04, Windows 11)
|
|
36
|
+
- **AWS Region**: (if relevant)
|
|
37
|
+
|
|
38
|
+
## Additional Context
|
|
39
|
+
|
|
40
|
+
Any other info that might help (logs, screenshots, etc).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest a new feature or improvement
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
What problem does this feature solve?
|
|
12
|
+
|
|
13
|
+
## Proposed Solution
|
|
14
|
+
|
|
15
|
+
How would you like it to work?
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
# Example of how you'd use this feature
|
|
19
|
+
from pydynox import ...
|
|
20
|
+
|
|
21
|
+
# ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Alternatives Considered
|
|
25
|
+
|
|
26
|
+
Any other solutions you've thought about.
|
|
27
|
+
|
|
28
|
+
## Additional Context
|
|
29
|
+
|
|
30
|
+
Any other info (links, examples from other libraries, etc).
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
name: Lint
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Rust fmt
|
|
20
|
+
run: cargo fmt --all -- --check
|
|
21
|
+
|
|
22
|
+
- name: Rust clippy
|
|
23
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
run: uv python install 3.11
|
|
30
|
+
|
|
31
|
+
- name: Python lint
|
|
32
|
+
run: |
|
|
33
|
+
uv venv
|
|
34
|
+
uv pip install ruff
|
|
35
|
+
uv run ruff check python/ tests/
|
|
36
|
+
|
|
37
|
+
test:
|
|
38
|
+
name: Test (${{ matrix.os }} / py${{ matrix.python }})
|
|
39
|
+
runs-on: ${{ matrix.os }}
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
44
|
+
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Set up Python
|
|
50
|
+
uses: actions/setup-python@v5
|
|
51
|
+
with:
|
|
52
|
+
python-version: ${{ matrix.python }}
|
|
53
|
+
allow-prereleases: true
|
|
54
|
+
|
|
55
|
+
- name: Create venv
|
|
56
|
+
run: python -m venv .venv
|
|
57
|
+
|
|
58
|
+
- name: Build wheel
|
|
59
|
+
uses: PyO3/maturin-action@v1
|
|
60
|
+
with:
|
|
61
|
+
command: build
|
|
62
|
+
args: --release --out dist
|
|
63
|
+
sccache: true
|
|
64
|
+
|
|
65
|
+
- name: Install wheel and dependencies (Unix)
|
|
66
|
+
if: runner.os != 'Windows'
|
|
67
|
+
run: |
|
|
68
|
+
source .venv/bin/activate
|
|
69
|
+
pip install dist/*.whl
|
|
70
|
+
pip install pytest pytest-asyncio hypothesis "moto[dynamodb,server]" boto3 pydantic
|
|
71
|
+
|
|
72
|
+
- name: Install wheel and dependencies (Windows)
|
|
73
|
+
if: runner.os == 'Windows'
|
|
74
|
+
run: |
|
|
75
|
+
.venv\Scripts\activate
|
|
76
|
+
pip install (Get-ChildItem dist\*.whl)
|
|
77
|
+
pip install pytest pytest-asyncio hypothesis "moto[dynamodb,server]" boto3 pydantic
|
|
78
|
+
|
|
79
|
+
- name: Run tests (Unix)
|
|
80
|
+
if: runner.os != 'Windows'
|
|
81
|
+
run: |
|
|
82
|
+
source .venv/bin/activate
|
|
83
|
+
pytest tests/ -v --ignore=tests/benchmark
|
|
84
|
+
|
|
85
|
+
- name: Run tests (Windows)
|
|
86
|
+
if: runner.os == 'Windows'
|
|
87
|
+
run: |
|
|
88
|
+
.venv\Scripts\activate
|
|
89
|
+
pytest tests/ -v --ignore=tests/benchmark
|
|
90
|
+
|
|
91
|
+
coverage:
|
|
92
|
+
name: Coverage
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v4
|
|
96
|
+
|
|
97
|
+
- name: Set up Python
|
|
98
|
+
uses: actions/setup-python@v5
|
|
99
|
+
with:
|
|
100
|
+
python-version: "3.12"
|
|
101
|
+
|
|
102
|
+
- name: Create venv
|
|
103
|
+
run: python -m venv .venv
|
|
104
|
+
|
|
105
|
+
- name: Build wheel
|
|
106
|
+
uses: PyO3/maturin-action@v1
|
|
107
|
+
with:
|
|
108
|
+
command: build
|
|
109
|
+
args: --release --out dist
|
|
110
|
+
sccache: true
|
|
111
|
+
|
|
112
|
+
- name: Install wheel and dependencies
|
|
113
|
+
run: |
|
|
114
|
+
source .venv/bin/activate
|
|
115
|
+
pip install dist/*.whl
|
|
116
|
+
pip install pytest pytest-asyncio pytest-cov hypothesis "moto[dynamodb,server]" boto3 pydantic
|
|
117
|
+
|
|
118
|
+
- name: Run tests with coverage
|
|
119
|
+
run: |
|
|
120
|
+
source .venv/bin/activate
|
|
121
|
+
pytest tests/ -v --cov=pydynox --cov-report=xml --ignore=tests/benchmark
|
|
122
|
+
|
|
123
|
+
- name: Upload coverage
|
|
124
|
+
uses: codecov/codecov-action@v4
|
|
125
|
+
with:
|
|
126
|
+
files: coverage.xml
|
|
127
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: CodSpeed
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
CARGO_TERM_COLOR: always
|
|
16
|
+
UV_FROZEN: "1"
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
codspeed:
|
|
20
|
+
name: Run benchmarks
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Cache cargo
|
|
31
|
+
uses: actions/cache@v4
|
|
32
|
+
with:
|
|
33
|
+
path: |
|
|
34
|
+
~/.cargo/bin/
|
|
35
|
+
~/.cargo/registry/index/
|
|
36
|
+
~/.cargo/registry/cache/
|
|
37
|
+
~/.cargo/git/db/
|
|
38
|
+
target/
|
|
39
|
+
key: ${{ runner.os }}-cargo-codspeed-${{ hashFiles('**/Cargo.lock') }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Python 3.12
|
|
42
|
+
run: uv python install 3.12
|
|
43
|
+
|
|
44
|
+
- name: Build wheel
|
|
45
|
+
run: |
|
|
46
|
+
uv venv --python 3.12
|
|
47
|
+
uv pip install maturin
|
|
48
|
+
uv run maturin build --release --interpreter python3.12
|
|
49
|
+
|
|
50
|
+
- name: Install dependencies and wheel
|
|
51
|
+
run: |
|
|
52
|
+
uv pip install pytest pytest-asyncio pytest-codspeed hypothesis "moto[dynamodb,server]" boto3 pydantic pynamodb
|
|
53
|
+
uv pip install target/wheels/*.whl
|
|
54
|
+
|
|
55
|
+
- name: Run benchmarks
|
|
56
|
+
uses: CodSpeedHQ/action@v4.5.1
|
|
57
|
+
with:
|
|
58
|
+
mode: simulation
|
|
59
|
+
run: uv run pytest benchmark/ --codspeed
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: "Version to release (e.g., 0.1.0)"
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
# build-linux:
|
|
17
|
+
# name: Build Linux (${{ matrix.target }})
|
|
18
|
+
# runs-on: ubuntu-latest
|
|
19
|
+
# strategy:
|
|
20
|
+
# matrix:
|
|
21
|
+
# target: [x86_64, aarch64]
|
|
22
|
+
# steps:
|
|
23
|
+
# - uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
# - name: Build wheels
|
|
26
|
+
# uses: PyO3/maturin-action@v1
|
|
27
|
+
# with:
|
|
28
|
+
# target: ${{ matrix.target }}
|
|
29
|
+
# args: --release --out dist -i python3.11 -i python3.12 -i python3.13 -i python3.14
|
|
30
|
+
# manylinux: 2014
|
|
31
|
+
# sccache: true
|
|
32
|
+
|
|
33
|
+
# - name: Upload wheels
|
|
34
|
+
# uses: actions/upload-artifact@v4
|
|
35
|
+
# with:
|
|
36
|
+
# name: wheels-linux-${{ matrix.target }}
|
|
37
|
+
# path: dist/*.whl
|
|
38
|
+
|
|
39
|
+
# build-musllinux:
|
|
40
|
+
# name: Build musllinux (${{ matrix.target }})
|
|
41
|
+
# runs-on: ubuntu-latest
|
|
42
|
+
# strategy:
|
|
43
|
+
# matrix:
|
|
44
|
+
# target: [x86_64, aarch64]
|
|
45
|
+
# steps:
|
|
46
|
+
# - uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
# - name: Build wheels
|
|
49
|
+
# uses: PyO3/maturin-action@v1
|
|
50
|
+
# with:
|
|
51
|
+
# target: ${{ matrix.target }}
|
|
52
|
+
# args: --release --out dist -i python3.11 -i python3.12 -i python3.13 -i python3.14
|
|
53
|
+
# manylinux: musllinux_1_1
|
|
54
|
+
# sccache: true
|
|
55
|
+
|
|
56
|
+
# - name: Upload wheels
|
|
57
|
+
# uses: actions/upload-artifact@v4
|
|
58
|
+
# with:
|
|
59
|
+
# name: wheels-musllinux-${{ matrix.target }}
|
|
60
|
+
# path: dist/*.whl
|
|
61
|
+
|
|
62
|
+
# build-macos:
|
|
63
|
+
# name: Build macOS (${{ matrix.target }})
|
|
64
|
+
# runs-on: ${{ matrix.runner }}
|
|
65
|
+
# strategy:
|
|
66
|
+
# matrix:
|
|
67
|
+
# include:
|
|
68
|
+
# - runner: macos-13
|
|
69
|
+
# target: x86_64-apple-darwin
|
|
70
|
+
# - runner: macos-14
|
|
71
|
+
# target: aarch64-apple-darwin
|
|
72
|
+
# steps:
|
|
73
|
+
# - uses: actions/checkout@v4
|
|
74
|
+
|
|
75
|
+
# - name: Build wheels
|
|
76
|
+
# uses: PyO3/maturin-action@v1
|
|
77
|
+
# with:
|
|
78
|
+
# target: ${{ matrix.target }}
|
|
79
|
+
# args: --release --out dist -i python3.11 -i python3.12 -i python3.13 -i python3.14
|
|
80
|
+
# sccache: true
|
|
81
|
+
|
|
82
|
+
# - name: Upload wheels
|
|
83
|
+
# uses: actions/upload-artifact@v4
|
|
84
|
+
# with:
|
|
85
|
+
# name: wheels-macos-${{ matrix.target }}
|
|
86
|
+
# path: dist/*.whl
|
|
87
|
+
|
|
88
|
+
# build-windows:
|
|
89
|
+
# name: Build Windows (${{ matrix.target }})
|
|
90
|
+
# runs-on: windows-latest
|
|
91
|
+
# strategy:
|
|
92
|
+
# matrix:
|
|
93
|
+
# target: [x64]
|
|
94
|
+
# steps:
|
|
95
|
+
# - uses: actions/checkout@v4
|
|
96
|
+
|
|
97
|
+
# - name: Build wheels
|
|
98
|
+
# uses: PyO3/maturin-action@v1
|
|
99
|
+
# with:
|
|
100
|
+
# target: ${{ matrix.target }}
|
|
101
|
+
# args: --release --out dist -i python3.11 -i python3.12 -i python3.13 -i python3.14
|
|
102
|
+
# sccache: true
|
|
103
|
+
|
|
104
|
+
# - name: Upload wheels
|
|
105
|
+
# uses: actions/upload-artifact@v4
|
|
106
|
+
# with:
|
|
107
|
+
# name: wheels-windows-${{ matrix.target }}
|
|
108
|
+
# path: dist/*.whl
|
|
109
|
+
|
|
110
|
+
build-sdist:
|
|
111
|
+
name: Build source distribution
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
steps:
|
|
114
|
+
- uses: actions/checkout@v4
|
|
115
|
+
|
|
116
|
+
- name: Build sdist
|
|
117
|
+
uses: PyO3/maturin-action@v1
|
|
118
|
+
with:
|
|
119
|
+
command: sdist
|
|
120
|
+
args: --out dist
|
|
121
|
+
|
|
122
|
+
- name: Upload sdist
|
|
123
|
+
uses: actions/upload-artifact@v4
|
|
124
|
+
with:
|
|
125
|
+
name: wheels-sdist
|
|
126
|
+
path: dist/*.tar.gz
|
|
127
|
+
|
|
128
|
+
publish:
|
|
129
|
+
name: Publish to PyPI
|
|
130
|
+
needs: [build-sdist]
|
|
131
|
+
runs-on: ubuntu-latest
|
|
132
|
+
environment:
|
|
133
|
+
name: pypi
|
|
134
|
+
url: https://pypi.org/p/pydynox
|
|
135
|
+
steps:
|
|
136
|
+
- name: Download all artifacts
|
|
137
|
+
uses: actions/download-artifact@v4
|
|
138
|
+
with:
|
|
139
|
+
pattern: wheels-*
|
|
140
|
+
path: dist
|
|
141
|
+
merge-multiple: true
|
|
142
|
+
|
|
143
|
+
- name: List artifacts
|
|
144
|
+
run: ls -la dist/
|
|
145
|
+
|
|
146
|
+
- name: Publish to PyPI
|
|
147
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
148
|
+
|
|
149
|
+
# github-release:
|
|
150
|
+
# name: Create GitHub Release
|
|
151
|
+
# needs: publish
|
|
152
|
+
# runs-on: ubuntu-latest
|
|
153
|
+
# steps:
|
|
154
|
+
# - uses: actions/checkout@v4
|
|
155
|
+
|
|
156
|
+
# - name: Download all artifacts
|
|
157
|
+
# uses: actions/download-artifact@v4
|
|
158
|
+
# with:
|
|
159
|
+
# pattern: wheels-*
|
|
160
|
+
# path: dist
|
|
161
|
+
# merge-multiple: true
|
|
162
|
+
|
|
163
|
+
# - name: Create Release
|
|
164
|
+
# uses: softprops/action-gh-release@v2
|
|
165
|
+
# with:
|
|
166
|
+
# tag_name: v${{ inputs.version }}
|
|
167
|
+
# name: Release v${{ inputs.version }}
|
|
168
|
+
# files: dist/*
|
|
169
|
+
# generate_release_notes: true
|
pydynox-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Rust
|
|
2
|
+
/target/
|
|
3
|
+
**/*.rs.bk
|
|
4
|
+
|
|
5
|
+
# Python
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Virtual environments
|
|
29
|
+
.env
|
|
30
|
+
.venv/
|
|
31
|
+
env/
|
|
32
|
+
venv/
|
|
33
|
+
ENV/
|
|
34
|
+
.python-version
|
|
35
|
+
|
|
36
|
+
# Testing
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.coverage
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.hypothesis/
|
|
43
|
+
*.cover
|
|
44
|
+
|
|
45
|
+
# IDE - VSCode
|
|
46
|
+
.vscode/
|
|
47
|
+
*.code-workspace
|
|
48
|
+
|
|
49
|
+
# IDE - Kiro
|
|
50
|
+
.kiro/
|
|
51
|
+
|
|
52
|
+
# IDE - JetBrains
|
|
53
|
+
.idea/
|
|
54
|
+
*.iml
|
|
55
|
+
|
|
56
|
+
# IDE - Other
|
|
57
|
+
*.swp
|
|
58
|
+
*.swo
|
|
59
|
+
*~
|
|
60
|
+
.project
|
|
61
|
+
.pydevproject
|
|
62
|
+
.settings/
|
|
63
|
+
|
|
64
|
+
# OS
|
|
65
|
+
.DS_Store
|
|
66
|
+
.DS_Store?
|
|
67
|
+
._*
|
|
68
|
+
.Spotlight-V100
|
|
69
|
+
.Trashes
|
|
70
|
+
ehthumbs.db
|
|
71
|
+
Thumbs.db
|
|
72
|
+
|
|
73
|
+
# maturin
|
|
74
|
+
*.whl
|
|
75
|
+
|
|
76
|
+
# Logs
|
|
77
|
+
*.log
|
|
78
|
+
logs/
|
|
79
|
+
|
|
80
|
+
# Local config
|
|
81
|
+
.env.local
|
|
82
|
+
.env.*.local
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Contributing to pydyno
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in pydyno! This guide will help you get started.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### Requirements
|
|
8
|
+
|
|
9
|
+
- Rust (latest stable)
|
|
10
|
+
- Python 3.9+
|
|
11
|
+
- maturin
|
|
12
|
+
|
|
13
|
+
### Install Rust
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Clone and Setup
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/yourusername/pydyno.git
|
|
23
|
+
cd pydyno
|
|
24
|
+
|
|
25
|
+
# Create virtual environment
|
|
26
|
+
python -m venv .venv
|
|
27
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
28
|
+
|
|
29
|
+
# Install maturin and dev dependencies
|
|
30
|
+
pip install maturin
|
|
31
|
+
pip install -e ".[dev]"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Build Locally
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Build and install in development mode
|
|
38
|
+
maturin develop
|
|
39
|
+
|
|
40
|
+
# Build release version
|
|
41
|
+
maturin build --release
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running Tests
|
|
45
|
+
|
|
46
|
+
### Rust Tests
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cargo test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Python Tests
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Run all Python tests
|
|
56
|
+
pytest
|
|
57
|
+
|
|
58
|
+
# Run specific test file
|
|
59
|
+
pytest tests/python/test_model.py
|
|
60
|
+
|
|
61
|
+
# Run with verbose output
|
|
62
|
+
pytest -v
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Property Tests
|
|
66
|
+
|
|
67
|
+
Property tests use Hypothesis and run many random inputs:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pytest tests/python/property/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Integration Tests
|
|
74
|
+
|
|
75
|
+
Integration tests need moto or localstack:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pytest tests/integration/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Code Style
|
|
82
|
+
|
|
83
|
+
### Rust
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Format code
|
|
87
|
+
cargo fmt
|
|
88
|
+
|
|
89
|
+
# Check for issues
|
|
90
|
+
cargo clippy
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Python
|
|
94
|
+
|
|
95
|
+
Follow PEP 8. Use type hints everywhere.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# Good
|
|
99
|
+
def get_user(user_id: str) -> Optional[User]:
|
|
100
|
+
...
|
|
101
|
+
|
|
102
|
+
# Bad
|
|
103
|
+
def get_user(user_id):
|
|
104
|
+
...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Pull Request Process
|
|
108
|
+
|
|
109
|
+
1. Fork the repo
|
|
110
|
+
2. Create a branch: `git checkout -b my-feature`
|
|
111
|
+
3. Make your changes
|
|
112
|
+
4. Run tests: `cargo test && pytest`
|
|
113
|
+
5. Run formatters: `cargo fmt`
|
|
114
|
+
6. Push and create a PR
|
|
115
|
+
|
|
116
|
+
### PR Checklist
|
|
117
|
+
|
|
118
|
+
- [ ] Tests pass
|
|
119
|
+
- [ ] Code is formatted
|
|
120
|
+
- [ ] New features have tests
|
|
121
|
+
- [ ] Docs updated if API changed
|
|
122
|
+
|
|
123
|
+
## Project Structure
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
pydyno/
|
|
127
|
+
├── src/ # Rust source code
|
|
128
|
+
│ ├── lib.rs # PyO3 module entry
|
|
129
|
+
│ ├── client.rs # DynamoDB client
|
|
130
|
+
│ ├── serialization.rs # Type conversion
|
|
131
|
+
│ └── errors.rs # Error types
|
|
132
|
+
├── python/pydyno/ # Python source code
|
|
133
|
+
│ └── __init__.py # Python API
|
|
134
|
+
├── tests/
|
|
135
|
+
│ ├── python/ # Python unit tests
|
|
136
|
+
│ │ └── property/ # Property-based tests
|
|
137
|
+
│ ├── integration/ # Integration tests
|
|
138
|
+
│ └── rust/ # Rust test notes
|
|
139
|
+
├── Cargo.toml # Rust dependencies
|
|
140
|
+
└── pyproject.toml # Python config
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Questions?
|
|
144
|
+
|
|
145
|
+
Open an issue on GitHub if you have questions or need help.
|