nox-chronos 1.0.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.
- nox_chronos-1.0.0/PKG-INFO +5 -0
- nox_chronos-1.0.0/README.md +12 -0
- nox_chronos-1.0.0/nox.json +14 -0
- nox_chronos-1.0.0/pyproject.toml +27 -0
- nox_chronos-1.0.0/src/lib.nox +48 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# nox-chronos
|
|
2
|
+
|
|
3
|
+
Native Python (`CPython 3.15+` `abi3t`, free-threaded `3.15t`) bindings for [chronos](https://github.com/mburakmmm/chronos).
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
import nox_chronos
|
|
7
|
+
|
|
8
|
+
cf = nox_chronos.CronField("minute", 0, 59, [True] * 60, [0, 15, 30, 45], False)
|
|
9
|
+
assert cf.next_at_or_after(16) == 30
|
|
10
|
+
ov = nox_chronos.forbid_overlap()
|
|
11
|
+
assert "*/15 * * * *" in nox_chronos.encode_cron_utc("*/15 * * * *")
|
|
12
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nox_chronos_bridge",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"source": "nox",
|
|
5
|
+
"entry": "src/lib.nox",
|
|
6
|
+
"requires": [
|
|
7
|
+
{
|
|
8
|
+
"alias": "chronos",
|
|
9
|
+
"repo": "https://github.com/mburakmmm/chronos.git",
|
|
10
|
+
"ref": "2e90c87f83b90c4ecd34cb8b7da1fbf3b7e15212",
|
|
11
|
+
"require_signed_commit": false
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["noxpy>=0.7.0a2"]
|
|
3
|
+
build-backend = "noxpy.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nox-chronos"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Native Python bindings (CPython 3.15+ abi3t, free-threaded) for Chronos cron & job policy utilities"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.15"
|
|
12
|
+
|
|
13
|
+
[tool.noxpy]
|
|
14
|
+
module-name = "nox_chronos"
|
|
15
|
+
source = "src/lib.nox"
|
|
16
|
+
backend = "llvm"
|
|
17
|
+
abi = "abi3t"
|
|
18
|
+
free-threaded = true
|
|
19
|
+
generate-stubs = true
|
|
20
|
+
export = "public"
|
|
21
|
+
|
|
22
|
+
[tool.noxpy.publish]
|
|
23
|
+
enabled = true
|
|
24
|
+
repository = "pypi"
|
|
25
|
+
trigger = "release-tag"
|
|
26
|
+
include-sdist = true
|
|
27
|
+
require-attestation = true
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Auto-generated by `noxpy init --from-nox-package` targeting unmodified `chronos` (2e90c87f83b90c4ecd34cb8b7da1fbf3b7e15212).
|
|
2
|
+
|
|
3
|
+
import chronos.cron
|
|
4
|
+
import chronos.job_codec
|
|
5
|
+
import chronos.policy
|
|
6
|
+
|
|
7
|
+
@export("instance_locked")
|
|
8
|
+
class CronField:
|
|
9
|
+
_inner: chronos.cron.CronField
|
|
10
|
+
|
|
11
|
+
def __init__(self, name: str, minimum: int, maximum: int, allowed: list[bool], values: list[int], wildcard: bool) -> None:
|
|
12
|
+
self._inner = chronos.cron.CronField(name, minimum, maximum, allowed, values, wildcard)
|
|
13
|
+
|
|
14
|
+
def contains(self, value: int) -> bool:
|
|
15
|
+
return self._inner.contains(value)
|
|
16
|
+
|
|
17
|
+
def first(self) -> int:
|
|
18
|
+
return self._inner.first()
|
|
19
|
+
|
|
20
|
+
def next_at_or_after(self, value: int) -> int | None:
|
|
21
|
+
return self._inner.next_at_or_after(value)
|
|
22
|
+
|
|
23
|
+
class _Raw_CronField(CronField):
|
|
24
|
+
def __init__(self, inner: chronos.cron.CronField) -> None:
|
|
25
|
+
self._inner = inner
|
|
26
|
+
|
|
27
|
+
@export("instance_locked")
|
|
28
|
+
class OverlapPolicy:
|
|
29
|
+
_inner: chronos.policy.OverlapPolicy
|
|
30
|
+
|
|
31
|
+
def __init__(self, kind: str) -> None:
|
|
32
|
+
self._inner = chronos.policy.OverlapPolicy(kind)
|
|
33
|
+
|
|
34
|
+
class _Raw_OverlapPolicy(OverlapPolicy):
|
|
35
|
+
def __init__(self, inner: chronos.policy.OverlapPolicy) -> None:
|
|
36
|
+
self._inner = inner
|
|
37
|
+
|
|
38
|
+
@export
|
|
39
|
+
def encode_cron_utc(expression: str) -> str:
|
|
40
|
+
return chronos.job_codec.encode_cron_utc(expression)
|
|
41
|
+
|
|
42
|
+
@export
|
|
43
|
+
def forbid_overlap() -> OverlapPolicy:
|
|
44
|
+
return _Raw_OverlapPolicy(chronos.policy.forbid_overlap())
|
|
45
|
+
|
|
46
|
+
@export
|
|
47
|
+
def queue_one_overlap() -> OverlapPolicy:
|
|
48
|
+
return _Raw_OverlapPolicy(chronos.policy.queue_one_overlap())
|