streamcase 0.1.0a1__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.
- streamcase-0.1.0a1/.gitignore +34 -0
- streamcase-0.1.0a1/CHANGELOG.md +62 -0
- streamcase-0.1.0a1/CONTRIBUTING.md +156 -0
- streamcase-0.1.0a1/LICENSE +202 -0
- streamcase-0.1.0a1/NOTICE +9 -0
- streamcase-0.1.0a1/PKG-INFO +146 -0
- streamcase-0.1.0a1/README.md +106 -0
- streamcase-0.1.0a1/SECURITY.md +25 -0
- streamcase-0.1.0a1/pyproject.toml +142 -0
- streamcase-0.1.0a1/scripts/__init__.py +1 -0
- streamcase-0.1.0a1/scripts/check_distribution_hashes.py +89 -0
- streamcase-0.1.0a1/scripts/check_release_tag.py +54 -0
- streamcase-0.1.0a1/scripts/smoke_installed.py +113 -0
- streamcase-0.1.0a1/src/streamcase/__init__.py +23 -0
- streamcase-0.1.0a1/src/streamcase/_cleanup.py +33 -0
- streamcase-0.1.0a1/src/streamcase/_diagnostics.py +108 -0
- streamcase-0.1.0a1/src/streamcase/_directories.py +107 -0
- streamcase-0.1.0a1/src/streamcase/_input_files.py +59 -0
- streamcase-0.1.0a1/src/streamcase/_serialization.py +31 -0
- streamcase-0.1.0a1/src/streamcase/_spark_capture.py +33 -0
- streamcase-0.1.0a1/src/streamcase/_spark_execution.py +95 -0
- streamcase-0.1.0a1/src/streamcase/_spark_lifecycle.py +81 -0
- streamcase-0.1.0a1/src/streamcase/_spark_managed.py +43 -0
- streamcase-0.1.0a1/src/streamcase/_spark_query_options.py +67 -0
- streamcase-0.1.0a1/src/streamcase/_spark_source.py +90 -0
- streamcase-0.1.0a1/src/streamcase/_version.py +3 -0
- streamcase-0.1.0a1/src/streamcase/actions.py +51 -0
- streamcase-0.1.0a1/src/streamcase/assertions.py +153 -0
- streamcase-0.1.0a1/src/streamcase/py.typed +1 -0
- streamcase-0.1.0a1/src/streamcase/results.py +91 -0
- streamcase-0.1.0a1/src/streamcase/scenario.py +58 -0
- streamcase-0.1.0a1/src/streamcase/spark.py +93 -0
- streamcase-0.1.0a1/tests/spark/test_capture.py +115 -0
- streamcase-0.1.0a1/tests/spark/test_environment.py +28 -0
- streamcase-0.1.0a1/tests/spark/test_execution.py +97 -0
- streamcase-0.1.0a1/tests/spark/test_managed_cleanup.py +57 -0
- streamcase-0.1.0a1/tests/spark/test_public_runner.py +93 -0
- streamcase-0.1.0a1/tests/spark/test_quickstart.py +55 -0
- streamcase-0.1.0a1/tests/spark/test_restart.py +250 -0
- streamcase-0.1.0a1/tests/spark/test_restart_guide.py +21 -0
- streamcase-0.1.0a1/tests/spark/test_source.py +56 -0
- streamcase-0.1.0a1/tests/test_actions.py +74 -0
- streamcase-0.1.0a1/tests/test_assertions.py +409 -0
- streamcase-0.1.0a1/tests/test_cleanup.py +78 -0
- streamcase-0.1.0a1/tests/test_directories.py +136 -0
- streamcase-0.1.0a1/tests/test_distribution_hashes.py +77 -0
- streamcase-0.1.0a1/tests/test_input_files.py +197 -0
- streamcase-0.1.0a1/tests/test_package.py +40 -0
- streamcase-0.1.0a1/tests/test_public_spark_runner.py +264 -0
- streamcase-0.1.0a1/tests/test_release_tag.py +44 -0
- streamcase-0.1.0a1/tests/test_results.py +133 -0
- streamcase-0.1.0a1/tests/test_scenario.py +72 -0
- streamcase-0.1.0a1/tests/test_serialization.py +53 -0
- streamcase-0.1.0a1/tests/test_spark_capture.py +61 -0
- streamcase-0.1.0a1/tests/test_spark_execution.py +654 -0
- streamcase-0.1.0a1/tests/test_spark_lifecycle.py +202 -0
- streamcase-0.1.0a1/tests/test_spark_managed.py +223 -0
- streamcase-0.1.0a1/tests/test_spark_query_options.py +83 -0
- streamcase-0.1.0a1/tests/test_spark_source.py +167 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.python-version
|
|
6
|
+
|
|
7
|
+
# Environments
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Build and test output
|
|
12
|
+
build/
|
|
13
|
+
dist/
|
|
14
|
+
.coverage
|
|
15
|
+
coverage.xml
|
|
16
|
+
htmlcov/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
|
|
21
|
+
# IDE and OS files
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
.DS_Store
|
|
25
|
+
Thumbs.db
|
|
26
|
+
|
|
27
|
+
# Local project scratch space
|
|
28
|
+
.tmp/
|
|
29
|
+
|
|
30
|
+
# Spark local output
|
|
31
|
+
metastore_db/
|
|
32
|
+
spark-warehouse/
|
|
33
|
+
derby.log
|
|
34
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes will be documented in this file. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and releases follow
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
No changes yet.
|
|
10
|
+
|
|
11
|
+
## [0.1.0a1] - Candidate (not published)
|
|
12
|
+
|
|
13
|
+
This prerelease is prepared but has no publication date yet. See the
|
|
14
|
+
[first-alpha release notes](docs/releases/0.1.0a1.md) for the tested support
|
|
15
|
+
matrix and known limitations. Add the publication date only after #99 verifies
|
|
16
|
+
the release.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Clean wheel and sdist installation smoke checks for the core package and the
|
|
21
|
+
supported Spark combination.
|
|
22
|
+
- Trusted Publishing release flow with checked tag provenance and SHA-256
|
|
23
|
+
verification across the Actions-artifact transfer to PyPI.
|
|
24
|
+
- Public `Restart` execution that rebuilds the Spark stream and resumes later
|
|
25
|
+
batches with the same checkpoint, query settings, and output capture.
|
|
26
|
+
- A private Spark query lifecycle controller with idempotent stop and
|
|
27
|
+
restart-safe writer configuration.
|
|
28
|
+
- A two-batch public Spark runner quick start and matching integration test.
|
|
29
|
+
- Public `streamcase.spark.run_scenario` API with caller-owned session,
|
|
30
|
+
transformation validation, and optional PySpark installation guidance.
|
|
31
|
+
- Validated Spark query output modes and non-conflicting writer options for the
|
|
32
|
+
private scenario runner.
|
|
33
|
+
- Managed cleanup for runner-owned Spark queries and run directories, preserving
|
|
34
|
+
execution failures when cleanup also fails.
|
|
35
|
+
- Immutable `ScenarioResult` assembly after successful Spark batch execution,
|
|
36
|
+
ready for the existing result assertions.
|
|
37
|
+
- Ordered `Batch` execution with one published input file and a Spark
|
|
38
|
+
`processAllAvailable()` barrier per action.
|
|
39
|
+
- Immutable driver-side capture of Spark `foreachBatch` output, including empty
|
|
40
|
+
output batches and recursively converted nested values.
|
|
41
|
+
- A deterministic Spark JSON file-stream source with explicit schemas and
|
|
42
|
+
runner-owned discovery options.
|
|
43
|
+
- Atomic publication of deterministic JSON Lines files for scenario batches.
|
|
44
|
+
- Isolated runner-owned input, checkpoint, and temporary directory layouts.
|
|
45
|
+
- Dedicated Java 17 and PySpark 4.2 integration-test CI lane.
|
|
46
|
+
- Optional `spark` extra for the supported PySpark 4.2 line and its compatibility
|
|
47
|
+
policy.
|
|
48
|
+
- Immutable `Batch` scenario action and `batch()` convenience constructor.
|
|
49
|
+
- Immutable `Restart` lifecycle action and `restart()` convenience constructor.
|
|
50
|
+
- Immutable ordered `Scenario` model and `scenario()` convenience constructor.
|
|
51
|
+
- Initial package scaffold.
|
|
52
|
+
- Packaging, licensing, governance, and contribution documentation.
|
|
53
|
+
- Issue forms, pull-request template, and automated quality gates.
|
|
54
|
+
- Roadmap for incremental implementation.
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- Restart failures identify the failed transition and retry cleanup of a
|
|
59
|
+
replacement query registered before Spark raises, preserving cleanup errors
|
|
60
|
+
alongside the original failure.
|
|
61
|
+
- Package and distribution metadata now read the version from one source.
|
|
62
|
+
- Release automation now rejects tags that do not match the package version.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Contributing to Streamcase
|
|
2
|
+
|
|
3
|
+
Streamcase uses an issue-first, review-first workflow inspired by established
|
|
4
|
+
Apache projects. The project is not an Apache Software Foundation project.
|
|
5
|
+
|
|
6
|
+
## Before writing code
|
|
7
|
+
|
|
8
|
+
1. Search existing issues and pull requests.
|
|
9
|
+
2. Open an issue describing the problem, proposed behavior, and acceptance
|
|
10
|
+
criteria. Use the
|
|
11
|
+
[design proposal form](https://github.com/SEPURI-SAI-KRISHNA/streamcase/issues/new?template=design.yml)
|
|
12
|
+
for public API, architecture, compatibility, backend, or other consequential
|
|
13
|
+
decisions.
|
|
14
|
+
3. Wait for scope agreement when the change affects public APIs, compatibility,
|
|
15
|
+
security, or architecture.
|
|
16
|
+
4. Create a branch containing the issue number, such as
|
|
17
|
+
`feat/123-watermark-actions` or `fix/456-progress-parsing`.
|
|
18
|
+
|
|
19
|
+
Direct code commits to `main` are not accepted.
|
|
20
|
+
|
|
21
|
+
Significant changes remain labeled `needs-decision` until their contract and
|
|
22
|
+
rationale are recorded publicly. Merging an issue-linked design record accepts
|
|
23
|
+
the decision; implementation continues through separate focused issues and pull
|
|
24
|
+
requests.
|
|
25
|
+
|
|
26
|
+
Maintainers classify incoming work using the
|
|
27
|
+
[issue triage and label guide](docs/maintainers/triage.md). Labels communicate
|
|
28
|
+
scope and state, but do not replace acceptance criteria or review.
|
|
29
|
+
|
|
30
|
+
## Development setup
|
|
31
|
+
|
|
32
|
+
Create and activate a virtual environment, then install development dependencies:
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
python -m venv .venv
|
|
36
|
+
python -m pip install --upgrade pip
|
|
37
|
+
python -m pip install -e ".[dev]"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run the local quality gates:
|
|
41
|
+
|
|
42
|
+
```shell
|
|
43
|
+
ruff format --check .
|
|
44
|
+
ruff check .
|
|
45
|
+
mypy
|
|
46
|
+
pytest -m "not spark"
|
|
47
|
+
python -m build
|
|
48
|
+
python -m twine check dist/*
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use `ruff format .` to apply formatting locally.
|
|
52
|
+
|
|
53
|
+
Spark integration tests require a Java 17 JDK and the optional Spark dependency:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
python -m pip install -e ".[dev,spark]"
|
|
57
|
+
java -version
|
|
58
|
+
python -c "import pyspark; print(pyspark.__version__)"
|
|
59
|
+
pytest -m spark -v
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The separate Spark CI workflow runs the same marked tests in local mode. Keep
|
|
63
|
+
ordinary unit tests backend-independent so the core Python matrix remains fast.
|
|
64
|
+
|
|
65
|
+
## Pull requests
|
|
66
|
+
|
|
67
|
+
- Link the issue with `Closes #123` in the pull-request description.
|
|
68
|
+
- Keep the pull request focused on one problem.
|
|
69
|
+
- Add or update tests for observable behavior.
|
|
70
|
+
- Update user documentation and the changelog when appropriate.
|
|
71
|
+
- Preserve compatibility unless the issue explicitly approves a breaking change.
|
|
72
|
+
- Resolve every review conversation before merge.
|
|
73
|
+
- Do not force-push after review unless necessary; explain rewritten history.
|
|
74
|
+
|
|
75
|
+
All protected-branch checks must pass before merge. A pull request opened by a
|
|
76
|
+
contributor requires approval from a maintainer who is not the author.
|
|
77
|
+
|
|
78
|
+
While the project has only one maintainer, a maintainer-authored pull request
|
|
79
|
+
cannot receive genuine independent approval from that same person. It may merge
|
|
80
|
+
only after the maintainer:
|
|
81
|
+
|
|
82
|
+
1. links a scoped issue and reviews the complete pull-request diff;
|
|
83
|
+
2. confirms every required check passes;
|
|
84
|
+
3. resolves every review conversation and records material decisions publicly;
|
|
85
|
+
4. verifies that every commit carries the required DCO sign-off; and
|
|
86
|
+
5. observes any additional waiting period, including the seven-day public-comment
|
|
87
|
+
period for governance changes.
|
|
88
|
+
|
|
89
|
+
This process is a documented self-review, not an approval. The
|
|
90
|
+
[CODEOWNERS](.github/CODEOWNERS) file records current responsibility and requests
|
|
91
|
+
review where GitHub can do so; it does not bypass branch protection or turn an
|
|
92
|
+
author's review into independent approval.
|
|
93
|
+
|
|
94
|
+
When the project has a second active maintainer who can review without
|
|
95
|
+
deadlocking development, branch protection should require at least one approving
|
|
96
|
+
review and code-owner review. Until then, the issue, pull request, protected
|
|
97
|
+
checks, conversation-resolution, and sign-off requirements remain mandatory.
|
|
98
|
+
|
|
99
|
+
## Commit sign-off
|
|
100
|
+
|
|
101
|
+
Contributors certify the Developer Certificate of Origin 1.1 by signing off each
|
|
102
|
+
commit:
|
|
103
|
+
|
|
104
|
+
```shell
|
|
105
|
+
git commit -s -m "feat: add watermark action"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The sign-off asserts that you have the right to submit the contribution under the
|
|
109
|
+
project license. Read the DCO at <https://developercertificate.org/>.
|
|
110
|
+
|
|
111
|
+
The `DCO sign-off` check validates every non-merge human commit in a pull
|
|
112
|
+
request. Each trailer must use the following form, and its name and email must
|
|
113
|
+
match the commit author's or committer's identity:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
Signed-off-by: Random J Developer <random@developer.example.org>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Amend an unsigned commit with `git commit --amend --signoff`. If more than one
|
|
120
|
+
commit is missing a sign-off, rewrite each affected commit with an interactive
|
|
121
|
+
rebase. Rewriting published commits changes their identifiers, so coordinate
|
|
122
|
+
with other contributors and explain any necessary force-push on the pull
|
|
123
|
+
request. A later remediation commit does not repair an earlier unsigned commit,
|
|
124
|
+
and maintainers cannot override a failed check.
|
|
125
|
+
|
|
126
|
+
Recognized dependency-update bots are exempt because they cannot certify the
|
|
127
|
+
DCO as a person. Repository owners, maintainers, and other human contributors
|
|
128
|
+
are not exempt. GitHub web-based commits must also include a sign-off.
|
|
129
|
+
|
|
130
|
+
A DCO sign-off is a contribution certification. It is not a cryptographic commit
|
|
131
|
+
signature, copyright assignment, or substitute for code review.
|
|
132
|
+
|
|
133
|
+
## Commit messages
|
|
134
|
+
|
|
135
|
+
Use a concise Conventional Commit style where practical:
|
|
136
|
+
|
|
137
|
+
- `feat: add checkpoint restart action`
|
|
138
|
+
- `fix: preserve duplicate output rows`
|
|
139
|
+
- `docs: explain Spark compatibility`
|
|
140
|
+
- `test: cover state-row assertion`
|
|
141
|
+
- `ci: validate Spark 4.x`
|
|
142
|
+
|
|
143
|
+
## Compatibility changes
|
|
144
|
+
|
|
145
|
+
Changes to supported Python or Spark versions require:
|
|
146
|
+
|
|
147
|
+
- a dedicated issue;
|
|
148
|
+
- CI evidence;
|
|
149
|
+
- a changelog entry;
|
|
150
|
+
- documentation updates; and
|
|
151
|
+
- maintainer approval.
|
|
152
|
+
|
|
153
|
+
## Reporting security issues
|
|
154
|
+
|
|
155
|
+
Follow [SECURITY.md](SECURITY.md). Never include an unpatched vulnerability in a
|
|
156
|
+
public issue or pull request.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Sepuri Sai Krishna
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Streamcase
|
|
2
|
+
Copyright 2026 Sepuri Sai Krishna
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0.
|
|
5
|
+
|
|
6
|
+
Apache Spark, Spark, Apache Flink, and Flink are trademarks of the Apache
|
|
7
|
+
Software Foundation. This product is not affiliated with or endorsed by the
|
|
8
|
+
Apache Software Foundation.
|
|
9
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: streamcase
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Deterministic testing for Apache Spark Structured Streaming pipelines
|
|
5
|
+
Project-URL: Homepage, https://github.com/SEPURI-SAI-KRISHNA/streamcase
|
|
6
|
+
Project-URL: Documentation, https://github.com/SEPURI-SAI-KRISHNA/streamcase/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/SEPURI-SAI-KRISHNA/streamcase/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/SEPURI-SAI-KRISHNA/streamcase
|
|
9
|
+
Project-URL: Changelog, https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Security, https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/SECURITY.md
|
|
11
|
+
Author: Sepuri Sai Krishna
|
|
12
|
+
License-Expression: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Keywords: apache-spark,pyspark,pytest,structured-streaming,testing
|
|
16
|
+
Classifier: Development Status :: 3 - Alpha
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Information Technology
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Software Development :: Testing
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build<2,>=1.2; extra == 'dev'
|
|
29
|
+
Requires-Dist: mypy<2,>=1.15; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov<8,>=6; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest<10,>=8.3; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff<1,>=0.11; extra == 'dev'
|
|
33
|
+
Requires-Dist: twine<8,>=7; extra == 'dev'
|
|
34
|
+
Provides-Extra: spark
|
|
35
|
+
Requires-Dist: pyspark<4.3,>=4.2; extra == 'spark'
|
|
36
|
+
Provides-Extra: test
|
|
37
|
+
Requires-Dist: pytest-cov<8,>=6; extra == 'test'
|
|
38
|
+
Requires-Dist: pytest<10,>=8.3; extra == 'test'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# Streamcase
|
|
42
|
+
|
|
43
|
+
[](https://github.com/SEPURI-SAI-KRISHNA/streamcase/actions/workflows/ci.yml)
|
|
44
|
+
[](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/LICENSE)
|
|
45
|
+
|
|
46
|
+
Streamcase is an early-development pytest-oriented toolkit for deterministic Apache Spark
|
|
47
|
+
Structured Streaming tests.
|
|
48
|
+
|
|
49
|
+
> **Status:** the Spark runner, including checkpoint-preserving restart actions,
|
|
50
|
+
> scenario model, results, and assertions are implemented. No release is published yet.
|
|
51
|
+
> The proposed [first-alpha scope](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/ROADMAP.md#first-alpha-candidate-010a1) is
|
|
52
|
+
> narrower than the longer-term roadmap.
|
|
53
|
+
|
|
54
|
+
The [0.1.0a1 candidate notes](docs/releases/0.1.0a1.md) describe the tested
|
|
55
|
+
support matrix and limitations. Publication is tracked separately in #99.
|
|
56
|
+
|
|
57
|
+
## Problem
|
|
58
|
+
|
|
59
|
+
Ordinary DataFrame assertions do not exercise streaming semantics such as
|
|
60
|
+
micro-batch boundaries, late data, watermarks, checkpoint restarts, or state
|
|
61
|
+
growth. Streamcase will make those behaviors explicit and reproducible in Python
|
|
62
|
+
tests while executing against Spark's public Structured Streaming interfaces.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
Until the first PyPI release, install the lightweight backend-independent
|
|
67
|
+
package from this checkout with:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
python -m pip install -e .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Install the approved PySpark line for the Spark runner from this checkout with:
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
python -m pip install -e ".[spark]"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The Spark extra keeps PySpark out of the core dependency set. See the
|
|
80
|
+
[Spark compatibility policy](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/spark-compatibility.md) for the supported
|
|
81
|
+
Python, Java, and Spark combination.
|
|
82
|
+
|
|
83
|
+
## Available today
|
|
84
|
+
|
|
85
|
+
Streamcase can describe immutable logical input batches and checkpoint-preserving
|
|
86
|
+
restart boundaries, represent captured output, and assert row equality, batch
|
|
87
|
+
counts, and unique keys without importing PySpark. The public Spark runner
|
|
88
|
+
executes batches and restarts against a caller-owned session. See the
|
|
89
|
+
[scenario model guide](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/scenario-model.md) and
|
|
90
|
+
[results and assertions guide](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/results-and-assertions.md), plus the
|
|
91
|
+
[two-batch Spark quick start and runner contract](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/spark-runner.md) and
|
|
92
|
+
[checkpoint restart example](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/restart-scenarios.md).
|
|
93
|
+
|
|
94
|
+
## Planned capabilities
|
|
95
|
+
|
|
96
|
+
- progress, watermark, and state-store assertions;
|
|
97
|
+
- pytest fixtures;
|
|
98
|
+
- compatibility testing across supported Spark releases.
|
|
99
|
+
|
|
100
|
+
These items are roadmap goals, not current package features. Each capability has
|
|
101
|
+
its own issue, tests, documentation, and pull request.
|
|
102
|
+
|
|
103
|
+
## Repository status
|
|
104
|
+
|
|
105
|
+
This bootstrap establishes:
|
|
106
|
+
|
|
107
|
+
- Python packaging with a `src` layout;
|
|
108
|
+
- Apache License 2.0 and project governance;
|
|
109
|
+
- issue and pull-request conventions;
|
|
110
|
+
- formatting, linting, type checking, tests, and package validation in CI;
|
|
111
|
+
- security and release policies.
|
|
112
|
+
|
|
113
|
+
See [ROADMAP.md](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/ROADMAP.md) for the planned delivery sequence and
|
|
114
|
+
[docs/architecture.md](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/docs/architecture.md) for the proposed technical shape.
|
|
115
|
+
|
|
116
|
+
## Local checks
|
|
117
|
+
|
|
118
|
+
```shell
|
|
119
|
+
python -m venv .venv
|
|
120
|
+
python -m pip install -e ".[dev]"
|
|
121
|
+
ruff format --check .
|
|
122
|
+
ruff check .
|
|
123
|
+
mypy
|
|
124
|
+
pytest -m "not spark"
|
|
125
|
+
python -m build
|
|
126
|
+
python -m twine check dist/*
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Spark contributors can run the isolated integration suite with the setup in the
|
|
130
|
+
[contribution guide](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/CONTRIBUTING.md#development-setup).
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
All material work starts with a GitHub issue and reaches `main` only through a
|
|
135
|
+
reviewed pull request. Read [CONTRIBUTING.md](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/CONTRIBUTING.md) before making a
|
|
136
|
+
change.
|
|
137
|
+
|
|
138
|
+
## Trademark notice
|
|
139
|
+
|
|
140
|
+
Apache Spark, Spark, Apache Flink, and Flink are trademarks of the Apache Software
|
|
141
|
+
Foundation. Streamcase is independent software and is not endorsed by the Apache
|
|
142
|
+
Software Foundation.
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
Licensed under the [Apache License 2.0](https://github.com/SEPURI-SAI-KRISHNA/streamcase/blob/main/LICENSE).
|