dioxide 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.

Potentially problematic release.


This version of dioxide might be problematic. Click here for more details.

Files changed (41) hide show
  1. dioxide-0.1.0/.claude/settings.local.json +14 -0
  2. dioxide-0.1.0/.github/ISSUE_TEMPLATE/bug.md +33 -0
  3. dioxide-0.1.0/.github/ISSUE_TEMPLATE/feature.md +32 -0
  4. dioxide-0.1.0/.github/ISSUE_TEMPLATE/story.md +38 -0
  5. dioxide-0.1.0/.github/workflows/build.yml +84 -0
  6. dioxide-0.1.0/.github/workflows/ci.yml +108 -0
  7. dioxide-0.1.0/.github/workflows/python-ci.yml +67 -0
  8. dioxide-0.1.0/.github/workflows/rust-ci.yml +64 -0
  9. dioxide-0.1.0/.gitignore +60 -0
  10. dioxide-0.1.0/.pre-commit-config.yaml +57 -0
  11. dioxide-0.1.0/CLAUDE.md +359 -0
  12. dioxide-0.1.0/CONTRIBUTING.md +166 -0
  13. dioxide-0.1.0/COVERAGE.md +120 -0
  14. dioxide-0.1.0/Cargo.lock +305 -0
  15. dioxide-0.1.0/Cargo.toml +18 -0
  16. dioxide-0.1.0/LICENSE +21 -0
  17. dioxide-0.1.0/PKG-INFO +243 -0
  18. dioxide-0.1.0/README.md +208 -0
  19. dioxide-0.1.0/docs/DEVELOPER_EXPERIENCE.md +366 -0
  20. dioxide-0.1.0/docs/GITHUB_PROJECT_SETUP.md +438 -0
  21. dioxide-0.1.0/docs/SPRINT_READY.md +428 -0
  22. dioxide-0.1.0/docs/design/ADR-001-container-architecture.md +589 -0
  23. dioxide-0.1.0/docs/design/ADR-002-pyo3-binding-strategy.md +745 -0
  24. dioxide-0.1.0/features/basic_container.feature +52 -0
  25. dioxide-0.1.0/features/environment.py +54 -0
  26. dioxide-0.1.0/features/provider_registration.feature +28 -0
  27. dioxide-0.1.0/features/steps/container_steps.py +241 -0
  28. dioxide-0.1.0/features/steps/provider_steps.py +130 -0
  29. dioxide-0.1.0/pyproject.toml +153 -0
  30. dioxide-0.1.0/python/dioxide/__init__.py +14 -0
  31. dioxide-0.1.0/python/dioxide/_rivet_core.pyi +17 -0
  32. dioxide-0.1.0/python/dioxide/container.py +171 -0
  33. dioxide-0.1.0/python/dioxide/decorators.py +61 -0
  34. dioxide-0.1.0/python/dioxide/py.typed +0 -0
  35. dioxide-0.1.0/python/dioxide/scope.py +10 -0
  36. dioxide-0.1.0/rust/src/lib.rs +270 -0
  37. dioxide-0.1.0/tests/__init__.py +1 -0
  38. dioxide-0.1.0/tests/test_component.py +235 -0
  39. dioxide-0.1.0/tests/test_rust_container_edge_cases.py +367 -0
  40. dioxide-0.1.0/tox.ini +70 -0
  41. dioxide-0.1.0/uv.lock +1284 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(cargo clean:*)",
5
+ "Bash(maturin develop:*)",
6
+ "Bash(pytest:*)",
7
+ "Bash(maturin build:*)",
8
+ "Bash(maturin publish)",
9
+ "Bash(maturin publish:*)"
10
+ ],
11
+ "deny": [],
12
+ "ask": []
13
+ }
14
+ }
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in rivet-di
4
+ title: '[BUG] '
5
+ labels: 'type: bug'
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Description
10
+ <!-- Clear and concise description of the bug -->
11
+
12
+ ## Steps to Reproduce
13
+ 1.
14
+ 2.
15
+ 3.
16
+
17
+ ## Expected Behavior
18
+ <!-- What should happen? -->
19
+
20
+ ## Actual Behavior
21
+ <!-- What actually happens? -->
22
+
23
+ ## Environment
24
+ - Python version:
25
+ - rivet-di version:
26
+ - OS:
27
+
28
+ ## Additional Context
29
+ <!-- Stack traces, error messages, screenshots, etc. -->
30
+
31
+ ```python
32
+ # Minimal reproducible example
33
+ ```
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Feature
3
+ about: Propose a new feature for rivet-di
4
+ title: '[FEATURE] '
5
+ labels: 'type: feature'
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Summary
10
+ <!-- Brief description of the feature -->
11
+
12
+ ## Motivation
13
+ <!-- Why is this feature needed? What problem does it solve? -->
14
+
15
+ ## Proposed Solution
16
+ <!-- How should this feature work? -->
17
+
18
+ ## Acceptance Criteria
19
+ <!-- What must be true for this feature to be considered complete? -->
20
+ - [ ]
21
+ - [ ]
22
+ - [ ]
23
+
24
+ ## Additional Context
25
+ <!-- Any additional information, examples, or references -->
26
+
27
+ ## Definition of Done
28
+ - [ ] Implementation complete
29
+ - [ ] Tests pass (unit + integration)
30
+ - [ ] Documentation updated
31
+ - [ ] Type hints added
32
+ - [ ] Passes tox checks
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: User Story
3
+ about: Describe a user story with Gherkin scenarios
4
+ title: '[STORY] '
5
+ labels: 'type: story'
6
+ assignees: ''
7
+ ---
8
+
9
+ ## User Story
10
+ As a **[role]**
11
+ I want **[goal]**
12
+ So that **[benefit]**
13
+
14
+ ## Gherkin Scenarios
15
+
16
+ ### Scenario: [Scenario Name]
17
+ ```gherkin
18
+ Given [context]
19
+ When [action]
20
+ Then [outcome]
21
+ ```
22
+
23
+ ### Scenario: [Another Scenario]
24
+ ```gherkin
25
+ Given [context]
26
+ And [additional context]
27
+ When [action]
28
+ Then [outcome]
29
+ And [additional outcome]
30
+ ```
31
+
32
+ ## Acceptance Criteria
33
+ - [ ]
34
+ - [ ]
35
+ - [ ]
36
+
37
+ ## Technical Notes
38
+ <!-- Implementation considerations, dependencies, blockers -->
@@ -0,0 +1,84 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build-wheels:
11
+ name: Build wheels on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest, windows-latest]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.11'
24
+
25
+ - name: Set up Rust
26
+ uses: dtolnay/rust-toolchain@stable
27
+
28
+ - name: Install maturin
29
+ run: pip install maturin
30
+
31
+ - name: Build wheels
32
+ run: maturin build --release --strip
33
+
34
+ - name: Upload wheels
35
+ uses: actions/upload-artifact@v4
36
+ with:
37
+ name: wheels-${{ matrix.os }}
38
+ path: target/wheels/*.whl
39
+
40
+ build-sdist:
41
+ name: Build source distribution
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+
46
+ - name: Set up Python
47
+ uses: actions/setup-python@v5
48
+ with:
49
+ python-version: '3.11'
50
+
51
+ - name: Install maturin
52
+ run: pip install maturin
53
+
54
+ - name: Build sdist
55
+ run: maturin sdist
56
+
57
+ - name: Upload sdist
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: sdist
61
+ path: target/wheels/*.tar.gz
62
+
63
+ publish:
64
+ name: Publish to PyPI
65
+ needs: [build-wheels, build-sdist]
66
+ runs-on: ubuntu-latest
67
+ if: startsWith(github.ref, 'refs/tags/v')
68
+ environment:
69
+ name: pypi
70
+ url: https://pypi.org/p/rivet-di
71
+ permissions:
72
+ id-token: write
73
+
74
+ steps:
75
+ - name: Download all artifacts
76
+ uses: actions/download-artifact@v4
77
+ with:
78
+ path: dist
79
+ merge-multiple: true
80
+
81
+ - name: Publish to PyPI
82
+ uses: pypa/gh-action-pypi-publish@release/v1
83
+ with:
84
+ packages-dir: dist/
@@ -0,0 +1,108 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: '3.11'
19
+
20
+ - name: Install uv
21
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ uv venv
26
+ uv pip install -e ".[dev]"
27
+
28
+ - name: Run ruff
29
+ run: uv run ruff check python tests
30
+
31
+ - name: Run isort check
32
+ run: uv run isort --check-only python tests
33
+
34
+ - name: Run mypy
35
+ run: uv run mypy python tests
36
+
37
+ test:
38
+ runs-on: ${{ matrix.os }}
39
+ strategy:
40
+ matrix:
41
+ os: [ubuntu-latest, macos-latest, windows-latest]
42
+ python-version: ['3.11', '3.12', '3.13']
43
+
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - name: Set up Python ${{ matrix.python-version }}
48
+ uses: actions/setup-python@v5
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+
52
+ - name: Set up Rust
53
+ uses: actions-rs/toolchain@v1
54
+ with:
55
+ toolchain: stable
56
+ override: true
57
+
58
+ - name: Install uv
59
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
60
+
61
+ - name: Install maturin
62
+ run: uv pip install maturin
63
+
64
+ - name: Build Rust extension
65
+ run: maturin develop
66
+
67
+ - name: Install dependencies
68
+ run: uv pip install -e ".[dev]"
69
+
70
+ - name: Run tests
71
+ run: uv run pytest
72
+
73
+ coverage:
74
+ runs-on: ubuntu-latest
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+
78
+ - name: Set up Python
79
+ uses: actions/setup-python@v5
80
+ with:
81
+ python-version: '3.11'
82
+
83
+ - name: Set up Rust
84
+ uses: actions-rs/toolchain@v1
85
+ with:
86
+ toolchain: stable
87
+ override: true
88
+
89
+ - name: Install uv
90
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
91
+
92
+ - name: Install maturin
93
+ run: uv pip install maturin
94
+
95
+ - name: Build Rust extension
96
+ run: maturin develop
97
+
98
+ - name: Install dependencies
99
+ run: uv pip install -e ".[dev]"
100
+
101
+ - name: Run tests with coverage
102
+ run: uv run pytest --cov=rivet_di --cov-report=xml --cov-report=term-missing
103
+
104
+ - name: Upload coverage to Codecov
105
+ uses: codecov/codecov-action@v3
106
+ with:
107
+ file: ./coverage.xml
108
+ fail_ci_if_error: false
@@ -0,0 +1,67 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test Python Code
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest, windows-latest]
16
+ python-version: ['3.11', '3.12', '3.13']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Set up Rust
27
+ uses: dtolnay/rust-toolchain@stable
28
+
29
+ - name: Cache pip
30
+ uses: actions/cache@v4
31
+ with:
32
+ path: ~/.cache/pip
33
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
34
+ restore-keys: |
35
+ ${{ runner.os }}-pip-
36
+
37
+ - name: Install dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ pip install maturin
41
+ pip install -e .[dev]
42
+
43
+ - name: Build Rust extension
44
+ run: maturin develop
45
+
46
+ - name: Run pytest
47
+ run: pytest --cov=rivet_di --cov-report=xml --cov-report=term
48
+
49
+ - name: Run behave BDD tests
50
+ run: behave
51
+
52
+ - name: Run mypy type checking
53
+ run: mypy python/rivet_di
54
+
55
+ - name: Run ruff linting
56
+ run: ruff check python/rivet_di
57
+
58
+ - name: Check code formatting
59
+ run: ruff format --check python/rivet_di
60
+
61
+ - name: Upload coverage to Codecov
62
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
63
+ uses: codecov/codecov-action@v4
64
+ with:
65
+ file: ./coverage.xml
66
+ flags: unittests
67
+ name: codecov-umbrella
@@ -0,0 +1,64 @@
1
+ name: Rust CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ test:
14
+ name: Test Rust Code
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Rust
20
+ uses: dtolnay/rust-toolchain@stable
21
+ with:
22
+ components: rustfmt, clippy
23
+
24
+ - name: Cache cargo registry
25
+ uses: actions/cache@v4
26
+ with:
27
+ path: ~/.cargo/registry
28
+ key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29
+
30
+ - name: Cache cargo index
31
+ uses: actions/cache@v4
32
+ with:
33
+ path: ~/.cargo/git
34
+ key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
35
+
36
+ - name: Cache cargo build
37
+ uses: actions/cache@v4
38
+ with:
39
+ path: rust/target
40
+ key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
41
+
42
+ - name: Run tests
43
+ run: cd rust && cargo test --verbose
44
+
45
+ - name: Run clippy
46
+ run: cd rust && cargo clippy -- -D warnings
47
+
48
+ - name: Check formatting
49
+ run: cd rust && cargo fmt -- --check
50
+
51
+ security:
52
+ name: Security Audit
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+
57
+ - name: Set up Rust
58
+ uses: dtolnay/rust-toolchain@stable
59
+
60
+ - name: Install cargo-audit
61
+ run: cargo install cargo-audit
62
+
63
+ - name: Run security audit
64
+ run: cd rust && cargo audit
@@ -0,0 +1,60 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ venv/
26
+ ENV/
27
+ env/
28
+ .venv
29
+
30
+ # Testing
31
+ .tox/
32
+ .coverage
33
+ .coverage.*
34
+ htmlcov/
35
+ .pytest_cache/
36
+ .mypy_cache/
37
+ .ruff_cache/
38
+ coverage.xml
39
+ *.cover
40
+ .mutmut-cache
41
+
42
+ # IDEs
43
+ .vscode/
44
+ .idea/
45
+ *.swp
46
+ *.swo
47
+ *~
48
+
49
+ # Rust
50
+ target/
51
+ Cargo.lock
52
+ *.pdb
53
+
54
+ # OS
55
+ .DS_Store
56
+ Thumbs.db
57
+
58
+ # Project-specific
59
+ *.log
60
+ *.profraw
@@ -0,0 +1,57 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-added-large-files
10
+ - id: check-merge-conflict
11
+ - id: mixed-line-ending
12
+
13
+ - repo: https://github.com/astral-sh/ruff-pre-commit
14
+ rev: v0.1.15
15
+ hooks:
16
+ - id: ruff
17
+ args: [--fix, --unsafe-fixes]
18
+ - id: ruff-format
19
+
20
+ - repo: https://github.com/pycqa/isort
21
+ rev: 5.13.2
22
+ hooks:
23
+ - id: isort
24
+ args: [--profile=black, --line-length=120]
25
+
26
+ - repo: https://github.com/pre-commit/mirrors-mypy
27
+ rev: v1.8.0
28
+ hooks:
29
+ - id: mypy
30
+ additional_dependencies: [pytest>=8.0]
31
+ args: [--python-version=3.11]
32
+ exclude: ^features/
33
+
34
+ - repo: local
35
+ hooks:
36
+ - id: cargo-fmt
37
+ name: cargo fmt
38
+ entry: cargo fmt
39
+ language: system
40
+ types: [rust]
41
+ pass_filenames: false
42
+
43
+ - id: cargo-clippy
44
+ name: cargo clippy
45
+ entry: cargo clippy
46
+ language: system
47
+ types: [rust]
48
+ pass_filenames: false
49
+ args: [--all-targets, --all-features, --, -D, warnings, -A, non-local-definitions]
50
+
51
+ - id: pytest-cov
52
+ name: pytest with coverage
53
+ entry: pytest
54
+ language: system
55
+ types: [python]
56
+ pass_filenames: false
57
+ args: [tests/test_component.py, --cov=dioxide, --cov-fail-under=95, --cov-branch, -q]