punctual-scheduler 0.0.1a0__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.
Files changed (39) hide show
  1. punctual_scheduler-0.0.1a0/.github/CODEOWNERS +2 -0
  2. punctual_scheduler-0.0.1a0/.github/dependabot.yml +24 -0
  3. punctual_scheduler-0.0.1a0/.github/pull_request_template.md +20 -0
  4. punctual_scheduler-0.0.1a0/.github/workflows/ci.yml +72 -0
  5. punctual_scheduler-0.0.1a0/.github/workflows/codeql.yml +27 -0
  6. punctual_scheduler-0.0.1a0/.github/workflows/pr-title.yml +34 -0
  7. punctual_scheduler-0.0.1a0/.github/workflows/release.yml +69 -0
  8. punctual_scheduler-0.0.1a0/.gitignore +31 -0
  9. punctual_scheduler-0.0.1a0/.pre-commit-config.yaml +19 -0
  10. punctual_scheduler-0.0.1a0/CONTRIBUTING.md +50 -0
  11. punctual_scheduler-0.0.1a0/LICENSE +202 -0
  12. punctual_scheduler-0.0.1a0/PKG-INFO +123 -0
  13. punctual_scheduler-0.0.1a0/README.md +91 -0
  14. punctual_scheduler-0.0.1a0/docs/DESIGN.md +242 -0
  15. punctual_scheduler-0.0.1a0/docs/IDEAS.md +98 -0
  16. punctual_scheduler-0.0.1a0/examples/punctual.toml +27 -0
  17. punctual_scheduler-0.0.1a0/packaging/README.md +41 -0
  18. punctual_scheduler-0.0.1a0/packaging/launchd/com.github.thejohnmatti.punctual.plist +39 -0
  19. punctual_scheduler-0.0.1a0/packaging/systemd/punctual.service +36 -0
  20. punctual_scheduler-0.0.1a0/pyproject.toml +93 -0
  21. punctual_scheduler-0.0.1a0/src/punctual/__init__.py +10 -0
  22. punctual_scheduler-0.0.1a0/src/punctual/__main__.py +4 -0
  23. punctual_scheduler-0.0.1a0/src/punctual/cli.py +137 -0
  24. punctual_scheduler-0.0.1a0/src/punctual/config.py +164 -0
  25. punctual_scheduler-0.0.1a0/src/punctual/executor.py +154 -0
  26. punctual_scheduler-0.0.1a0/src/punctual/models.py +165 -0
  27. punctual_scheduler-0.0.1a0/src/punctual/process.py +54 -0
  28. punctual_scheduler-0.0.1a0/src/punctual/schedule.py +60 -0
  29. punctual_scheduler-0.0.1a0/src/punctual/scheduler.py +297 -0
  30. punctual_scheduler-0.0.1a0/src/punctual/store.py +214 -0
  31. punctual_scheduler-0.0.1a0/tests/test_cli.py +66 -0
  32. punctual_scheduler-0.0.1a0/tests/test_config.py +130 -0
  33. punctual_scheduler-0.0.1a0/tests/test_executor.py +102 -0
  34. punctual_scheduler-0.0.1a0/tests/test_packaging.py +27 -0
  35. punctual_scheduler-0.0.1a0/tests/test_process.py +24 -0
  36. punctual_scheduler-0.0.1a0/tests/test_recovery.py +120 -0
  37. punctual_scheduler-0.0.1a0/tests/test_schedule.py +58 -0
  38. punctual_scheduler-0.0.1a0/tests/test_scheduler.py +125 -0
  39. punctual_scheduler-0.0.1a0/tests/test_store.py +56 -0
@@ -0,0 +1,2 @@
1
+ # Default owner for everything in the repo.
2
+ * @TheJohnMatti
@@ -0,0 +1,24 @@
1
+ version: 2
2
+ updates:
3
+ # GitHub Actions in .github/workflows/*
4
+ - package-ecosystem: github-actions
5
+ directory: "/"
6
+ schedule:
7
+ interval: monthly
8
+ groups:
9
+ actions:
10
+ patterns: ["*"]
11
+ commit-message:
12
+ prefix: ci
13
+
14
+ # Python deps (pyproject). Runtime set is deliberately tiny (DESIGN D7); this
15
+ # mostly tracks the dev toolchain.
16
+ - package-ecosystem: pip
17
+ directory: "/"
18
+ schedule:
19
+ interval: monthly
20
+ groups:
21
+ python:
22
+ patterns: ["*"]
23
+ commit-message:
24
+ prefix: build
@@ -0,0 +1,20 @@
1
+ <!--
2
+ Title must be a Conventional Commit, e.g. `feat(scheduler): catch-up on restart`
3
+ (enforced by the `conventional-title` check). It becomes the squash-merge subject.
4
+ -->
5
+
6
+ ## What
7
+
8
+ <!-- One or two sentences. What does this change and why. -->
9
+
10
+ ## Design
11
+
12
+ <!-- Link the DESIGN.md entry (D#/O#) this implements or changes. If this makes a
13
+ new non-obvious choice, add an entry in the same PR. -->
14
+
15
+ ## Checklist
16
+
17
+ - [ ] `docs/DESIGN.md` updated (or N/A — no design decision here)
18
+ - [ ] Tests cover the new behaviour
19
+ - [ ] `ruff check` / `ruff format` / `mypy` / `pytest` pass locally
20
+ - [ ] No new runtime dependency (or: justified below, per DESIGN D7)
@@ -0,0 +1,72 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ # One in-flight run per branch / PR; new pushes cancel the stale run.
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 0 # hatch-vcs reads the version from git history + tags
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ cache: pip
27
+ - run: pip install -e ".[dev]"
28
+ - run: ruff check .
29
+ - run: ruff format --check .
30
+
31
+ typecheck:
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ with:
36
+ fetch-depth: 0 # hatch-vcs reads the version from git history + tags
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.12"
40
+ cache: pip
41
+ - run: pip install -e ".[dev]"
42
+ - run: mypy
43
+
44
+ audit:
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ fetch-depth: 0 # hatch-vcs reads the version from git history + tags
50
+ - uses: actions/setup-python@v5
51
+ with:
52
+ python-version: "3.12"
53
+ cache: pip
54
+ - run: pip install -e .
55
+ - run: pipx run pip-audit
56
+
57
+ test:
58
+ runs-on: ubuntu-latest
59
+ strategy:
60
+ fail-fast: false
61
+ matrix:
62
+ python: ["3.12", "3.13"]
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ with:
66
+ fetch-depth: 0 # hatch-vcs reads the version from git history + tags
67
+ - uses: actions/setup-python@v5
68
+ with:
69
+ python-version: ${{ matrix.python }}
70
+ cache: pip
71
+ - run: pip install -e ".[dev]"
72
+ - run: pytest -q --cov --cov-report=term-missing
@@ -0,0 +1,27 @@
1
+ name: codeql
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: "0 6 * * 1" # Mondays 06:00 UTC
10
+
11
+ concurrency:
12
+ group: codeql-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ analyze:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ security-events: write
20
+ contents: read
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: github/codeql-action/init@v3
24
+ with:
25
+ languages: python
26
+ queries: security-and-quality
27
+ - uses: github/codeql-action/analyze@v3
@@ -0,0 +1,34 @@
1
+ name: pr-title
2
+
3
+ # Asserts the PR title is a valid Conventional Commit, so the squash-merge
4
+ # subject line (and an eventual generated changelog) stays clean.
5
+
6
+ on:
7
+ pull_request:
8
+ types: [opened, edited, reopened, synchronize]
9
+
10
+ permissions:
11
+ pull-requests: read
12
+
13
+ jobs:
14
+ conventional-title:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: amannn/action-semantic-pull-request@v5
18
+ env:
19
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20
+ with:
21
+ # keep in sync with the types used in commit history
22
+ types: |
23
+ feat
24
+ fix
25
+ chore
26
+ docs
27
+ refactor
28
+ test
29
+ perf
30
+ ci
31
+ build
32
+ requireScope: false
33
+ # No subject-case rule: Dependabot ("Bump …") and other bots
34
+ # capitalise, and fighting that isn't worth the friction.
@@ -0,0 +1,69 @@
1
+ name: release
2
+
3
+ # Cut a release by pushing a tag: git tag v0.0.1 && git push origin v0.0.1
4
+ # Builds sdist + wheel, publishes to PyPI via OIDC trusted publishing (no token),
5
+ # and creates a GitHub Release with the artifacts attached.
6
+ #
7
+ # One-time setup on PyPI (cannot be done from CI): add a "pending publisher" at
8
+ # https://pypi.org/manage/account/publishing/ —
9
+ # PyPI Project Name: punctual-scheduler
10
+ # Owner: TheJohnMatti
11
+ # Repository name: punctual
12
+ # Workflow name: release.yml
13
+ # Environment name: pypi
14
+ # The matching `pypi` GitHub environment (tag-only deploy policy) already exists.
15
+
16
+ on:
17
+ push:
18
+ tags: ["v*"]
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ jobs:
24
+ build:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ with:
29
+ fetch-depth: 0 # hatch-vcs needs full history + tags for the version
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ - run: pipx run build
34
+ - run: pipx run twine check dist/*
35
+ - uses: actions/upload-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+
40
+ pypi:
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment:
44
+ name: pypi
45
+ url: https://pypi.org/p/punctual-scheduler
46
+ permissions:
47
+ id-token: write # OIDC token for trusted publishing
48
+ contents: read
49
+ steps:
50
+ - uses: actions/download-artifact@v4
51
+ with:
52
+ name: dist
53
+ path: dist/
54
+ - uses: pypa/gh-action-pypi-publish@release/v1
55
+
56
+ github-release:
57
+ needs: pypi
58
+ runs-on: ubuntu-latest
59
+ permissions:
60
+ contents: write
61
+ steps:
62
+ - uses: actions/download-artifact@v4
63
+ with:
64
+ name: dist
65
+ path: dist/
66
+ - uses: softprops/action-gh-release@v2
67
+ with:
68
+ files: dist/*
69
+ generate_release_notes: true
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .mypy_cache/
8
+ .coverage
9
+ .coverage.*
10
+ htmlcov/
11
+ coverage.xml
12
+ build/
13
+ dist/
14
+ .venv/
15
+ venv/
16
+
17
+ # punctual runtime state (never commit a state DB)
18
+ *.db
19
+ *.db-wal
20
+ *.db-shm
21
+ punctual.toml.local
22
+ state/
23
+
24
+ # editors / OS
25
+ .idea/
26
+ .vscode/
27
+ *.swp
28
+ .DS_Store
29
+
30
+ # uv (not committed — dev envs resolve from pyproject; revisit if we adopt `uv sync` in CI)
31
+ uv.lock
@@ -0,0 +1,19 @@
1
+ # Fast, deterministic hooks only. Type-checking (mypy) runs in CI, not here —
2
+ # it is slow and environment-sensitive. `pre-commit install` to enable.
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v5.0.0
6
+ hooks:
7
+ - id: check-toml
8
+ - id: check-yaml
9
+ - id: check-merge-conflict
10
+ - id: check-added-large-files
11
+ - id: end-of-file-fixer
12
+ - id: trailing-whitespace
13
+
14
+ - repo: https://github.com/astral-sh/ruff-pre-commit
15
+ rev: v0.16.5
16
+ hooks:
17
+ - id: ruff-check
18
+ args: [--fix]
19
+ - id: ruff-format
@@ -0,0 +1,50 @@
1
+ # Contributing
2
+
3
+ ## Dev setup
4
+
5
+ The environment is [uv](https://docs.astral.sh/uv/)-managed.
6
+
7
+ ```console
8
+ uv pip install -e ".[dev]"
9
+ uv run pre-commit install # ruff + hygiene hooks on every commit
10
+ ```
11
+
12
+ ## Checks (all run in CI)
13
+
14
+ | Command | What |
15
+ |---|---|
16
+ | `ruff check .` | lint |
17
+ | `ruff format --check .` | formatting |
18
+ | `mypy` | strict type-checking (`src/` only) |
19
+ | `pytest -q` | tests, on 3.12 and 3.13 |
20
+
21
+ `pre-commit run --all-files` covers the first two plus file hygiene.
22
+
23
+ ## Pull requests
24
+
25
+ - PR titles must be [Conventional Commits](https://www.conventionalcommits.org/)
26
+ (`feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`, `perf:`, `ci:`,
27
+ `build:`) — enforced by the `pr-title` check. The title becomes the
28
+ squash-merge subject.
29
+ - Every non-obvious design choice gets an entry in [`docs/DESIGN.md`](docs/DESIGN.md).
30
+ - Keep the runtime dependency set minimal (currently `click` + `croniter` — see
31
+ DESIGN D7).
32
+
33
+ ## Releasing
34
+
35
+ Fully tag-driven — `hatch-vcs` derives the version from the tag, so there is no
36
+ version to bump anywhere.
37
+
38
+ ```console
39
+ git tag v0.1.0 # -> package version 0.1.0
40
+ git push origin v0.1.0
41
+ ```
42
+
43
+ The `release` workflow builds the sdist + wheel, publishes to PyPI via OIDC
44
+ trusted publishing (no API token), and opens a GitHub Release. Between tags,
45
+ local builds get a dev version like `0.1.dev7+g1a2b3c4`.
46
+
47
+ One-time PyPI setup (not yet done): add a pending publisher at
48
+ <https://pypi.org/manage/account/publishing/> — project `punctual-scheduler`,
49
+ owner `TheJohnMatti`, repo `punctual`, workflow `release.yml`, environment
50
+ `pypi`.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.5
2
+ Name: punctual-scheduler
3
+ Version: 0.0.1a0
4
+ Summary: The reliability layer cron never had: retries, catch-up, dependencies, observability, exactly-once. One process, zero infra.
5
+ Project-URL: Homepage, https://github.com/TheJohnMatti/punctual
6
+ Project-URL: Source, https://github.com/TheJohnMatti/punctual
7
+ Project-URL: Issues, https://github.com/TheJohnMatti/punctual/issues
8
+ Author: John Matti
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: cron,daemon,jobs,reliability,scheduler,sre
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: click>=8.1
22
+ Requires-Dist: croniter>=3.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: hypothesis>=6; extra == 'dev'
25
+ Requires-Dist: mypy>=1.11; extra == 'dev'
26
+ Requires-Dist: pre-commit>=3.8; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
28
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
29
+ Requires-Dist: pytest>=8; extra == 'dev'
30
+ Requires-Dist: ruff>=0.6; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # punctual
34
+
35
+ **The reliability layer `cron` never had.** One long-running process, zero
36
+ infrastructure, a config file that reads like a crontab — plus the five things
37
+ every team ends up bolting onto cron by hand:
38
+
39
+ | | `cron` | `punctual` |
40
+ |---|---|---|
41
+ | Retries / backoff | ✗ | ✓ |
42
+ | Catch-up after downtime | ✗ (silently skips) | ✓ (per-job policy) |
43
+ | Dependencies between jobs | ✗ | ✓ (`after = [...]`, no DAG file) |
44
+ | "Did the 3am job run?" | ✗ | ✓ (durable run history, metrics, traces) |
45
+ | Exactly-once under overlap/restart | ✗ | ✓ (claim-before-run) |
46
+
47
+ Not Airflow. Airflow (and Dagster, Temporal, …) assume a database, a scheduler
48
+ process, a web server, a worker pool, and that you'll rewrite your jobs as DAGs.
49
+ That's right at 500 jobs and 12 engineers. `punctual` is for the machine with
50
+ 6 scripts on it — which is most machines.
51
+
52
+ > Status: **pre-alpha, under active design.** See [`docs/DESIGN.md`](docs/DESIGN.md)
53
+ > for the decisions made so far and the ones still open.
54
+
55
+ ## The shape of it
56
+
57
+ ```toml
58
+ # punctual.toml
59
+ [job.scrape]
60
+ schedule = "*/10 * * * *"
61
+ command = "python -m sniper.scrape"
62
+ on_missed = "skip" # skip | run_latest | run_each
63
+
64
+ [job.retrain]
65
+ schedule = "0 8 * * 1"
66
+ command = "python -m sniper.retrain"
67
+ after = ["scrape"] # dependency edge
68
+ timeout = "45m"
69
+ retries = { max = 3, backoff = "exponential" }
70
+ on_fail = "ntfy://my-topic" # page after retries are exhausted
71
+ ```
72
+
73
+ ```console
74
+ $ punctual run # start the daemon (put this under systemd/launchd)
75
+ $ punctual plan # next 24h of fires, timezone/DST-aware
76
+ $ punctual history retrain # every run: when, how long, exit code, output
77
+ $ punctual why retrain # explain the last scheduling decision (coming)
78
+ $ punctual tui # live dashboard (coming)
79
+ ```
80
+
81
+ ## Quickstart
82
+
83
+ ```console
84
+ $ uv tool install git+https://github.com/TheJohnMatti/punctual # or: pipx install …
85
+
86
+ $ mkdir -p ~/.config/punctual && cat > ~/.config/punctual/punctual.toml <<'EOF'
87
+ [job.heartbeat]
88
+ schedule = "* * * * * */30" # every 30s — 6-field cron: seconds go LAST
89
+ command = "date -u +%FT%TZ"
90
+
91
+ [job.backup]
92
+ schedule = "0 3 * * *" # 03:00 daily
93
+ command = "restic backup /home/me"
94
+ EOF
95
+
96
+ $ punctual -c ~/.config/punctual/punctual.toml validate
97
+ $ punctual -c ~/.config/punctual/punctual.toml run # Ctrl-C drains, then exits
98
+ # ...in another shell:
99
+ $ punctual -c ~/.config/punctual/punctual.toml history
100
+ 09-01 14:30 heartbeat succeeded 0.0s exit 0
101
+ 09-01 14:30 backup succeeded 12.4s exit 0
102
+ ```
103
+
104
+ State lives in `~/.local/state/punctual/punctual.db` (override with `$PUNCTUAL_DB`).
105
+ To keep it running, install a service — see [`packaging/`](packaging/).
106
+
107
+ > **What works today (M1 slice 1):** scheduling from now, subprocess execution
108
+ > with output capture, timeouts, durable history. **Not yet:** catch-up after
109
+ > downtime, retries, `why` / `tui`. See [`docs/DESIGN.md`](docs/DESIGN.md).
110
+
111
+ ## Design principles
112
+
113
+ 1. **A missed run is an incident, not a shrug.** cron's original sin is silence.
114
+ 2. **Zero infra to start.** Embedded SQLite. No server, no broker, no web app.
115
+ 3. **Crontab-shaped.** If you can write a crontab you can write a `punctual.toml`.
116
+ 4. **Exactly-once is at-least-once + idempotency.** We're honest about that and
117
+ build the idempotency in.
118
+ 5. **Grows, doesn't bloat.** Single node → leader-elected cluster → durable
119
+ in-process steps, same core.
120
+
121
+ ## License
122
+
123
+ Apache-2.0.