opening_hours_py 1.2.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.
- opening_hours_py-1.2.0/.github/codecov.yml +6 -0
- opening_hours_py-1.2.0/.github/pull_request_template.md +7 -0
- opening_hours_py-1.2.0/.github/workflows/checks.yml +131 -0
- opening_hours_py-1.2.0/.github/workflows/deploy-docs.yml +37 -0
- opening_hours_py-1.2.0/.github/workflows/deploy-pypi.yml +208 -0
- opening_hours_py-1.2.0/.github/workflows/deploy-rust.yml +35 -0
- opening_hours_py-1.2.0/.gitignore +9 -0
- opening_hours_py-1.2.0/.gitmodules +3 -0
- opening_hours_py-1.2.0/.rustfmt.toml +1 -0
- opening_hours_py-1.2.0/CHANGELOG.md +219 -0
- opening_hours_py-1.2.0/Cargo.lock +2044 -0
- opening_hours_py-1.2.0/Cargo.toml +71 -0
- opening_hours_py-1.2.0/LICENSE-APACHE +201 -0
- opening_hours_py-1.2.0/LICENSE-MIT +25 -0
- opening_hours_py-1.2.0/PKG-INFO +118 -0
- opening_hours_py-1.2.0/README.md +126 -0
- opening_hours_py-1.2.0/compact-calendar/Cargo.toml +14 -0
- opening_hours_py-1.2.0/compact-calendar/README.md +43 -0
- opening_hours_py-1.2.0/compact-calendar/src/lib.rs +810 -0
- opening_hours_py-1.2.0/opening-hours/benches/benchmarks.rs +97 -0
- opening_hours_py-1.2.0/opening-hours/build.rs +112 -0
- opening_hours_py-1.2.0/opening-hours/data/holidays_public.txt +122288 -0
- opening_hours_py-1.2.0/opening-hours/data/holidays_school.txt +1078 -0
- opening_hours_py-1.2.0/opening-hours/data/templates/countries.rs.jinja +80 -0
- opening_hours_py-1.2.0/opening-hours/src/bin/schedule.rs +52 -0
- opening_hours_py-1.2.0/opening-hours/src/context.rs +111 -0
- opening_hours_py-1.2.0/opening-hours/src/filter/date_filter.rs +553 -0
- opening_hours_py-1.2.0/opening-hours/src/filter/mod.rs +2 -0
- opening_hours_py-1.2.0/opening-hours/src/filter/time_filter.rs +163 -0
- opening_hours_py-1.2.0/opening-hours/src/lib.rs +21 -0
- opening_hours_py-1.2.0/opening-hours/src/localization/coordinates.rs +55 -0
- opening_hours_py-1.2.0/opening-hours/src/localization/country/generated.rs +783 -0
- opening_hours_py-1.2.0/opening-hours/src/localization/country/mod.rs +123 -0
- opening_hours_py-1.2.0/opening-hours/src/localization/localize.rs +165 -0
- opening_hours_py-1.2.0/opening-hours/src/localization/mod.rs +7 -0
- opening_hours_py-1.2.0/opening-hours/src/opening_hours.rs +486 -0
- opening_hours_py-1.2.0/opening-hours/src/schedule.rs +360 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/country.rs +22 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/data/sample.txt +204 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/holiday_selector.rs +49 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/issues.rs +123 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/localization.rs +106 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/mod.rs +72 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/month_selector.rs +152 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/next_change.rs +115 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/parser.rs +94 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/regression.rs +277 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/rules.rs +146 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/schedule.rs +108 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/stats.rs +34 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/time_selector.rs +150 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/week_selector.rs +99 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/weekday_selector.rs +208 -0
- opening_hours_py-1.2.0/opening-hours/src/tests/year_selector.rs +78 -0
- opening_hours_py-1.2.0/opening-hours/src/utils/dates.rs +67 -0
- opening_hours_py-1.2.0/opening-hours/src/utils/mod.rs +2 -0
- opening_hours_py-1.2.0/opening-hours/src/utils/range.rs +108 -0
- opening_hours_py-1.2.0/opening-hours-py/.gitignore +4 -0
- opening_hours_py-1.2.0/opening-hours-py/Cargo.toml +42 -0
- opening_hours_py-1.2.0/opening-hours-py/LICENSE-APACHE +201 -0
- opening_hours_py-1.2.0/opening-hours-py/LICENSE-MIT +25 -0
- opening_hours_py-1.2.0/opening-hours-py/README.md +104 -0
- opening_hours_py-1.2.0/opening-hours-py/src/bin/stub_gen.rs +65 -0
- opening_hours_py-1.2.0/opening-hours-py/src/lib.rs +332 -0
- opening_hours_py-1.2.0/opening-hours-py/src/tests/bindings.rs +137 -0
- opening_hours_py-1.2.0/opening-hours-py/src/tests/doctests.rs +34 -0
- opening_hours_py-1.2.0/opening-hours-py/src/tests/mod.rs +107 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/datetime.rs +76 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/iterator.rs +86 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/location.rs +40 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/mod.rs +5 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/state.rs +38 -0
- opening_hours_py-1.2.0/opening-hours-py/src/types/timezone.rs +18 -0
- opening_hours_py-1.2.0/opening-hours-syntax/Cargo.toml +21 -0
- opening_hours_py-1.2.0/opening-hours-syntax/LICENSE-APACHE +201 -0
- opening_hours_py-1.2.0/opening-hours-syntax/LICENSE-MIT +25 -0
- opening_hours_py-1.2.0/opening-hours-syntax/README.md +39 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/display.rs +38 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/error.rs +44 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/extended_time.rs +167 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/grammar.pest +296 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/lib.rs +21 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/normalize/canonical.rs +218 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/normalize/frame.rs +164 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/normalize/mod.rs +83 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/normalize/paving.rs +297 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/parser.rs +846 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/rules/day.rs +537 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/rules/mod.rs +219 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/rules/time.rs +164 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/sorted_vec.rs +140 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/tests/mod.rs +2 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/tests/normalize.rs +94 -0
- opening_hours_py-1.2.0/opening-hours-syntax/src/tests/paving.rs +128 -0
- opening_hours_py-1.2.0/opening_hours.pyi +198 -0
- opening_hours_py-1.2.0/poetry.lock +291 -0
- opening_hours_py-1.2.0/pyproject.toml +36 -0
- opening_hours_py-1.2.0/scripts/check-osm.py +74 -0
- opening_hours_py-1.2.0/scripts/check-version.py +102 -0
- opening_hours_py-1.2.0/scripts/generate-holidays.py +123 -0
- opening_hours_py-1.2.0/scripts/poetry.lock +996 -0
- opening_hours_py-1.2.0/scripts/pyproject.toml +19 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
## 📋 Before Merge Checklist
|
|
4
|
+
|
|
5
|
+
1. [ ] I have chosen a new version number with respect to [semver](https://semver.org/)
|
|
6
|
+
2. [ ] I have updated the version in these files consistently: *Cargo.toml*, *compact-calendar/Cargo.toml*, *opening-hours-syntax/Cargo.toml*, *python/Cargo.toml* and *pyproject.toml*
|
|
7
|
+
3. [ ] I have updated *CHANGELOG.md*
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
name: Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
CARGO_TERM_COLOR: always
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
# ---
|
|
12
|
+
# --- Run tests and lints for Rust library
|
|
13
|
+
# ---
|
|
14
|
+
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
crate:
|
|
20
|
+
- .
|
|
21
|
+
- compact-calendar
|
|
22
|
+
- opening-hours-py
|
|
23
|
+
- opening-hours-syntax
|
|
24
|
+
- fuzz
|
|
25
|
+
features: [""]
|
|
26
|
+
include:
|
|
27
|
+
- { crate: ".", features: "log" }
|
|
28
|
+
- { crate: ".", features: "log,auto-country" }
|
|
29
|
+
- { crate: ".", features: "log,auto-country,auto-timezone" }
|
|
30
|
+
- { crate: ".", features: "log,auto-timezone" }
|
|
31
|
+
- { crate: "opening-hours-syntax", features: "log" }
|
|
32
|
+
defaults:
|
|
33
|
+
run:
|
|
34
|
+
working-directory: ${{ matrix.crate }}
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
with:
|
|
38
|
+
submodules: true
|
|
39
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
41
|
+
with:
|
|
42
|
+
toolchain: stable
|
|
43
|
+
components: rustfmt, clippy
|
|
44
|
+
- name: Display rust version
|
|
45
|
+
run: |
|
|
46
|
+
rustc --version
|
|
47
|
+
cargo clippy -- --version
|
|
48
|
+
cargo fmt -- --version
|
|
49
|
+
- name: Lint
|
|
50
|
+
run: cargo clippy --no-default-features --features "${{ matrix.features }}" -- -D warnings
|
|
51
|
+
- name: Format
|
|
52
|
+
run: cargo fmt -- --check
|
|
53
|
+
- name: Tests
|
|
54
|
+
run: cargo test --no-default-features --features "${{ matrix.features }}"
|
|
55
|
+
|
|
56
|
+
# ---
|
|
57
|
+
# --- Check that all versions are consistency accross packages
|
|
58
|
+
# ---
|
|
59
|
+
|
|
60
|
+
check-version:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
defaults:
|
|
63
|
+
run:
|
|
64
|
+
working-directory: scripts
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
- name: Install poetry
|
|
68
|
+
run: |
|
|
69
|
+
python -m pip install --upgrade pip
|
|
70
|
+
pip install poetry
|
|
71
|
+
- name: Install dependancies
|
|
72
|
+
run: poetry install
|
|
73
|
+
- name: Check version consistency
|
|
74
|
+
run: poetry run ./check-version.py
|
|
75
|
+
|
|
76
|
+
# ---
|
|
77
|
+
# --- Check that python stub file is up to date
|
|
78
|
+
# ---
|
|
79
|
+
|
|
80
|
+
check-stub:
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
defaults:
|
|
83
|
+
run:
|
|
84
|
+
working-directory: opening-hours-py
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
88
|
+
with:
|
|
89
|
+
toolchain: stable
|
|
90
|
+
components: rustfmt, clippy
|
|
91
|
+
- uses: actions/setup-python@v4
|
|
92
|
+
with:
|
|
93
|
+
python-version: 3.12
|
|
94
|
+
- name: Install poetry
|
|
95
|
+
run: |
|
|
96
|
+
python -m pip install --upgrade pip
|
|
97
|
+
pip install poetry
|
|
98
|
+
- name: Install poetry deps
|
|
99
|
+
run: poetry install --with dev
|
|
100
|
+
- name: Check that Python stub file is up to date
|
|
101
|
+
run: cargo run --bin stub_gen -- check
|
|
102
|
+
|
|
103
|
+
# ---
|
|
104
|
+
# --- Calculate coverage using tarpaulin
|
|
105
|
+
# ---
|
|
106
|
+
|
|
107
|
+
coverage:
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
container:
|
|
110
|
+
image: xd009642/tarpaulin:develop-nightly
|
|
111
|
+
options: --security-opt seccomp=unconfined
|
|
112
|
+
steps:
|
|
113
|
+
- uses: actions/checkout@v2
|
|
114
|
+
with:
|
|
115
|
+
submodules: true
|
|
116
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
117
|
+
- name: Install Python library
|
|
118
|
+
run: apt-get update && apt-get install -yy python3-dev && apt-get clean
|
|
119
|
+
- name: Generate code coverage
|
|
120
|
+
run: >-
|
|
121
|
+
cargo +nightly tarpaulin --out xml
|
|
122
|
+
--ignore-panics --ignore-tests
|
|
123
|
+
--workspace
|
|
124
|
+
--all-features
|
|
125
|
+
--run-types Tests
|
|
126
|
+
--run-types Doctests
|
|
127
|
+
- name: Upload to codecov.io
|
|
128
|
+
uses: codecov/codecov-action@v2
|
|
129
|
+
with:
|
|
130
|
+
fail_ci_if_error: true
|
|
131
|
+
token: ${{secrets.CODECOV_TOKEN}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
deploy-python-doc:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
13
|
+
|
|
14
|
+
- uses: actions/setup-python@v4
|
|
15
|
+
with:
|
|
16
|
+
python-version: 3.12
|
|
17
|
+
|
|
18
|
+
- name: Install poetry
|
|
19
|
+
run: |
|
|
20
|
+
python -m pip install --upgrade pip
|
|
21
|
+
pip install poetry
|
|
22
|
+
|
|
23
|
+
- name: Install dependancies
|
|
24
|
+
run: poetry install
|
|
25
|
+
|
|
26
|
+
- name: Check packaging for pypi.org
|
|
27
|
+
run: poetry run maturin develop
|
|
28
|
+
|
|
29
|
+
- name: Build python documentation
|
|
30
|
+
run: poetry run pdoc -o docs -d numpy opening_hours
|
|
31
|
+
|
|
32
|
+
- name: Publish to github pages
|
|
33
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
34
|
+
if: github.ref == 'refs/heads/master'
|
|
35
|
+
with:
|
|
36
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
+
publish_dir: ./docs
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# This file is autogenerated by maturin v1.12.6
|
|
2
|
+
# To update, run
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github -o .github/workflows/deploy-pypi.yml
|
|
5
|
+
#
|
|
6
|
+
name: Deploy PyPI
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
- push
|
|
10
|
+
- pull_request
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
linux:
|
|
17
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
platform:
|
|
21
|
+
- runner: ubuntu-22.04
|
|
22
|
+
target: x86_64
|
|
23
|
+
- runner: ubuntu-22.04
|
|
24
|
+
target: x86
|
|
25
|
+
- runner: ubuntu-22.04
|
|
26
|
+
target: aarch64
|
|
27
|
+
- runner: ubuntu-22.04
|
|
28
|
+
target: armv7
|
|
29
|
+
- runner: ubuntu-22.04
|
|
30
|
+
target: s390x
|
|
31
|
+
- runner: ubuntu-22.04
|
|
32
|
+
target: ppc64le
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v6
|
|
35
|
+
- uses: actions/setup-python@v6
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.10"
|
|
38
|
+
- name: Build wheels
|
|
39
|
+
uses: PyO3/maturin-action@v1
|
|
40
|
+
with:
|
|
41
|
+
target: ${{ matrix.platform.target }}
|
|
42
|
+
args: --release --out dist -i python3.10
|
|
43
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
44
|
+
manylinux: auto
|
|
45
|
+
- name: Build free-threaded wheels
|
|
46
|
+
uses: PyO3/maturin-action@v1
|
|
47
|
+
with:
|
|
48
|
+
target: ${{ matrix.platform.target }}
|
|
49
|
+
args: --release --out dist -i python3.14t
|
|
50
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
51
|
+
manylinux: auto
|
|
52
|
+
- name: Upload wheels
|
|
53
|
+
uses: actions/upload-artifact@v6
|
|
54
|
+
with:
|
|
55
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
56
|
+
path: dist
|
|
57
|
+
|
|
58
|
+
musllinux:
|
|
59
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
60
|
+
strategy:
|
|
61
|
+
matrix:
|
|
62
|
+
platform:
|
|
63
|
+
- runner: ubuntu-22.04
|
|
64
|
+
target: x86_64
|
|
65
|
+
- runner: ubuntu-22.04
|
|
66
|
+
target: x86
|
|
67
|
+
- runner: ubuntu-22.04
|
|
68
|
+
target: aarch64
|
|
69
|
+
- runner: ubuntu-22.04
|
|
70
|
+
target: armv7
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v6
|
|
73
|
+
- uses: actions/setup-python@v6
|
|
74
|
+
with:
|
|
75
|
+
python-version: "3.10"
|
|
76
|
+
- name: Build wheels
|
|
77
|
+
uses: PyO3/maturin-action@v1
|
|
78
|
+
with:
|
|
79
|
+
target: ${{ matrix.platform.target }}
|
|
80
|
+
args: --release --out dist -i python3.10
|
|
81
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
82
|
+
manylinux: musllinux_1_2
|
|
83
|
+
- name: Build free-threaded wheels
|
|
84
|
+
uses: PyO3/maturin-action@v1
|
|
85
|
+
with:
|
|
86
|
+
target: ${{ matrix.platform.target }}
|
|
87
|
+
args: --release --out dist -i python3.14t
|
|
88
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
89
|
+
manylinux: musllinux_1_2
|
|
90
|
+
- name: Upload wheels
|
|
91
|
+
uses: actions/upload-artifact@v6
|
|
92
|
+
with:
|
|
93
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
94
|
+
path: dist
|
|
95
|
+
|
|
96
|
+
windows:
|
|
97
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
98
|
+
strategy:
|
|
99
|
+
matrix:
|
|
100
|
+
platform:
|
|
101
|
+
- runner: windows-latest
|
|
102
|
+
target: x64
|
|
103
|
+
python_arch: x64
|
|
104
|
+
- runner: windows-latest
|
|
105
|
+
target: x86
|
|
106
|
+
python_arch: x86
|
|
107
|
+
- runner: windows-11-arm
|
|
108
|
+
target: aarch64
|
|
109
|
+
python_arch: arm64
|
|
110
|
+
steps:
|
|
111
|
+
- uses: actions/checkout@v6
|
|
112
|
+
- uses: actions/setup-python@v6
|
|
113
|
+
with:
|
|
114
|
+
python-version: 3.13
|
|
115
|
+
architecture: ${{ matrix.platform.python_arch }}
|
|
116
|
+
- name: Build wheels
|
|
117
|
+
uses: PyO3/maturin-action@v1
|
|
118
|
+
with:
|
|
119
|
+
target: ${{ matrix.platform.target }}
|
|
120
|
+
args: --release --out dist -i python3.10
|
|
121
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
122
|
+
- uses: actions/setup-python@v6
|
|
123
|
+
with:
|
|
124
|
+
python-version: 3.14t
|
|
125
|
+
architecture: ${{ matrix.platform.python_arch }}
|
|
126
|
+
- name: Build free-threaded wheels
|
|
127
|
+
uses: PyO3/maturin-action@v1
|
|
128
|
+
with:
|
|
129
|
+
target: ${{ matrix.platform.target }}
|
|
130
|
+
args: --release --out dist -i python3.14t
|
|
131
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
132
|
+
- name: Upload wheels
|
|
133
|
+
uses: actions/upload-artifact@v6
|
|
134
|
+
with:
|
|
135
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
136
|
+
path: dist
|
|
137
|
+
|
|
138
|
+
macos:
|
|
139
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
140
|
+
strategy:
|
|
141
|
+
matrix:
|
|
142
|
+
platform:
|
|
143
|
+
- runner: macos-15-intel
|
|
144
|
+
target: x86_64
|
|
145
|
+
- runner: macos-latest
|
|
146
|
+
target: aarch64
|
|
147
|
+
steps:
|
|
148
|
+
- uses: actions/checkout@v6
|
|
149
|
+
- uses: actions/setup-python@v6
|
|
150
|
+
with:
|
|
151
|
+
python-version: "3.10"
|
|
152
|
+
- name: Build wheels
|
|
153
|
+
uses: PyO3/maturin-action@v1
|
|
154
|
+
with:
|
|
155
|
+
target: ${{ matrix.platform.target }}
|
|
156
|
+
args: --release --out dist -i python3.10
|
|
157
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
158
|
+
- name: Build free-threaded wheels
|
|
159
|
+
uses: PyO3/maturin-action@v1
|
|
160
|
+
with:
|
|
161
|
+
target: ${{ matrix.platform.target }}
|
|
162
|
+
args: --release --out dist -i python3.14t
|
|
163
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
164
|
+
- name: Upload wheels
|
|
165
|
+
uses: actions/upload-artifact@v6
|
|
166
|
+
with:
|
|
167
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
168
|
+
path: dist
|
|
169
|
+
|
|
170
|
+
sdist:
|
|
171
|
+
runs-on: ubuntu-latest
|
|
172
|
+
steps:
|
|
173
|
+
- uses: actions/checkout@v6
|
|
174
|
+
- name: Build sdist
|
|
175
|
+
uses: PyO3/maturin-action@v1
|
|
176
|
+
with:
|
|
177
|
+
command: sdist
|
|
178
|
+
args: --out dist
|
|
179
|
+
- name: Upload sdist
|
|
180
|
+
uses: actions/upload-artifact@v6
|
|
181
|
+
with:
|
|
182
|
+
name: wheels-sdist
|
|
183
|
+
path: dist
|
|
184
|
+
|
|
185
|
+
release:
|
|
186
|
+
name: Release
|
|
187
|
+
runs-on: ubuntu-latest
|
|
188
|
+
if: ${{ github.ref == 'refs/heads/master' }}
|
|
189
|
+
needs: [linux, musllinux, windows, macos, sdist]
|
|
190
|
+
permissions:
|
|
191
|
+
# Use to sign the release artifacts
|
|
192
|
+
id-token: write
|
|
193
|
+
# Used to upload release artifacts
|
|
194
|
+
contents: write
|
|
195
|
+
# Used to generate artifact attestation
|
|
196
|
+
attestations: write
|
|
197
|
+
steps:
|
|
198
|
+
- uses: actions/download-artifact@v7
|
|
199
|
+
- name: Generate artifact attestation
|
|
200
|
+
uses: actions/attest-build-provenance@v3
|
|
201
|
+
with:
|
|
202
|
+
subject-path: "wheels-*/*"
|
|
203
|
+
- name: Install uv
|
|
204
|
+
uses: astral-sh/setup-uv@v7
|
|
205
|
+
- name: Publish to PyPI
|
|
206
|
+
run: uv publish 'wheels-*/*'
|
|
207
|
+
env:
|
|
208
|
+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Deploy Crates
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
deploy-rust:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
strategy:
|
|
12
|
+
max-parallel: 1
|
|
13
|
+
matrix:
|
|
14
|
+
crate:
|
|
15
|
+
- compact-calendar
|
|
16
|
+
- opening-hours-syntax
|
|
17
|
+
- .
|
|
18
|
+
|
|
19
|
+
defaults:
|
|
20
|
+
run:
|
|
21
|
+
working-directory: ${{ matrix.crate }}
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
26
|
+
|
|
27
|
+
- name: Login to crates.io
|
|
28
|
+
run: cargo login $TOKEN
|
|
29
|
+
if: github.ref == 'refs/heads/master'
|
|
30
|
+
env:
|
|
31
|
+
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
|
|
32
|
+
|
|
33
|
+
- name: Publish to crates.io
|
|
34
|
+
run: cargo publish
|
|
35
|
+
if: github.ref == 'refs/heads/master'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
struct_lit_width = 50
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### General
|
|
6
|
+
|
|
7
|
+
- Fix [#91](https://github.com/remi-dupre/opening-hours-rs/issues/91):
|
|
8
|
+
normalization does not prefix normal separators with a space anymore.
|
|
9
|
+
- Update holidays database from nagger. Support for new contries: DR Congo,
|
|
10
|
+
Congo, Ghana Seychelles and Türkiye.
|
|
11
|
+
|
|
12
|
+
### Python
|
|
13
|
+
|
|
14
|
+
- Fix [#92](https://github.com/remi-dupre/opening-hours-rs/issues/92):
|
|
15
|
+
missing wheels on Linux
|
|
16
|
+
- Fix [#90](https://github.com/remi-dupre/opening-hours-rs/issues/90):
|
|
17
|
+
missing README to PyPI
|
|
18
|
+
- Bump Maturin to 1.12 (build system) & update generated CI
|
|
19
|
+
|
|
20
|
+
## 1.1.6
|
|
21
|
+
|
|
22
|
+
### General
|
|
23
|
+
|
|
24
|
+
- Fix [#88](https://github.com/remi-dupre/opening-hours-rs/issues/88):
|
|
25
|
+
allow space inside of time blocks.
|
|
26
|
+
- Chore (CI): bump x86 runners for MacOS to version 14
|
|
27
|
+
- Chore: update dependencies
|
|
28
|
+
|
|
29
|
+
## 1.1.5
|
|
30
|
+
|
|
31
|
+
### General
|
|
32
|
+
|
|
33
|
+
- Fix generated calendar not being platform agnostic.
|
|
34
|
+
|
|
35
|
+
## 1.1.4
|
|
36
|
+
|
|
37
|
+
### Rust
|
|
38
|
+
|
|
39
|
+
- Use `docsrs` cfg to enable `doc_cfg` feature instead of checking for rustc nightly channel
|
|
40
|
+
- Update dependencies
|
|
41
|
+
|
|
42
|
+
### Python
|
|
43
|
+
|
|
44
|
+
- Only build for Python >= 3.10
|
|
45
|
+
- Update dependencies
|
|
46
|
+
- Build on Ubuntu 24.04 LTS (from 22.04)
|
|
47
|
+
|
|
48
|
+
## 1.1.3
|
|
49
|
+
|
|
50
|
+
### General
|
|
51
|
+
|
|
52
|
+
- Fix crashes when a repetition is defined in a time span (eg.
|
|
53
|
+
"10:00-18:00/01:30")
|
|
54
|
+
- Update dependencies (PyO3 0.24.1)
|
|
55
|
+
|
|
56
|
+
## 1.1.2
|
|
57
|
+
|
|
58
|
+
### Rust
|
|
59
|
+
|
|
60
|
+
- Switch from `sunrise-next` dependency back to `sunrise` as all changes
|
|
61
|
+
have been upstreamed.
|
|
62
|
+
|
|
63
|
+
## 1.1.1
|
|
64
|
+
|
|
65
|
+
### Rust
|
|
66
|
+
|
|
67
|
+
- Upgrade to edition 2024
|
|
68
|
+
|
|
69
|
+
## 1.1.0
|
|
70
|
+
|
|
71
|
+
### General
|
|
72
|
+
|
|
73
|
+
- Allow to normalize "canonical" expressions (expressions expressed as simple
|
|
74
|
+
intervals over each dimension).
|
|
75
|
+
- Weird expressions equivalent to "24/7" should generally be evaluated faster.
|
|
76
|
+
- Fixed a lot of bugs. This comes from the fuzzer being super happy of the
|
|
77
|
+
addition of a normalization which acts as a sort of concurrent implementation
|
|
78
|
+
of the evaluation rules.
|
|
79
|
+
|
|
80
|
+
### Rust
|
|
81
|
+
|
|
82
|
+
- Add `approx_bound_interval_size` option to context to allow optimizing calls
|
|
83
|
+
to `next_change` over long periods of time.
|
|
84
|
+
|
|
85
|
+
### Fixes
|
|
86
|
+
|
|
87
|
+
- NaN values are now ignored in coordinates inputs.
|
|
88
|
+
- Empty expressions are no longer allowed.
|
|
89
|
+
- Monthday "0" is no no longer allowed.
|
|
90
|
+
|
|
91
|
+
## 1.0.3
|
|
92
|
+
|
|
93
|
+
### Python
|
|
94
|
+
|
|
95
|
+
- stub: fix variants casing for `State`
|
|
96
|
+
|
|
97
|
+
## 1.0.2
|
|
98
|
+
|
|
99
|
+
### Python
|
|
100
|
+
|
|
101
|
+
- Add auto-generated Python stub file.
|
|
102
|
+
|
|
103
|
+
## 1.0.0
|
|
104
|
+
|
|
105
|
+
That's not really a huge milestone, but:
|
|
106
|
+
|
|
107
|
+
- Every "obviously missing things" that I had in mind are implemented now.
|
|
108
|
+
- The API proved itself to be quite stable.
|
|
109
|
+
|
|
110
|
+
### General
|
|
111
|
+
|
|
112
|
+
- Add Easter support
|
|
113
|
+
|
|
114
|
+
## 0.11.1
|
|
115
|
+
|
|
116
|
+
### Rust
|
|
117
|
+
|
|
118
|
+
- More robust week selector
|
|
119
|
+
|
|
120
|
+
## 0.11.0
|
|
121
|
+
|
|
122
|
+
### General
|
|
123
|
+
|
|
124
|
+
- General reorganisation of modules
|
|
125
|
+
|
|
126
|
+
### Rust
|
|
127
|
+
|
|
128
|
+
- Coordinates validation
|
|
129
|
+
- Add fuzzing corpus
|
|
130
|
+
|
|
131
|
+
## 0.10.1
|
|
132
|
+
|
|
133
|
+
### Rust
|
|
134
|
+
|
|
135
|
+
- Fix missing items in documentation
|
|
136
|
+
|
|
137
|
+
## 0.10.0
|
|
138
|
+
|
|
139
|
+
### Rust
|
|
140
|
+
|
|
141
|
+
- Rust 1.83
|
|
142
|
+
- Support localization (timezone & coords)
|
|
143
|
+
- add default feature _log_
|
|
144
|
+
- add optional feature _auto-country_
|
|
145
|
+
- add optional feature _auto-timezone_
|
|
146
|
+
|
|
147
|
+
### Python
|
|
148
|
+
|
|
149
|
+
- Add the `opening_hours.State` type.
|
|
150
|
+
- Updated to latest maturin's workflow, which should ship precompiled binaries
|
|
151
|
+
for more older Python version in the future.
|
|
152
|
+
- Support localization (timezone & coords)
|
|
153
|
+
- Add exception types `ParserError` and `UnknownCountryError`
|
|
154
|
+
|
|
155
|
+
## 0.9.1
|
|
156
|
+
|
|
157
|
+
### Fixes
|
|
158
|
+
|
|
159
|
+
- Fix [#56](https://github.com/remi-dupre/opening-hours-rs/issues/56):
|
|
160
|
+
expressions with no date filter (eg. `00:30-05:30`) may be considered as
|
|
161
|
+
always closed.
|
|
162
|
+
|
|
163
|
+
## 0.9.0
|
|
164
|
+
|
|
165
|
+
### General
|
|
166
|
+
|
|
167
|
+
- Holidays database from [nager.date](https://date.nager.at/).
|
|
168
|
+
- Some support for public holidays.
|
|
169
|
+
- Replace all panicking functions with faillible ones.
|
|
170
|
+
|
|
171
|
+
### Rust
|
|
172
|
+
|
|
173
|
+
- `OpeningHours` now implements `FromStr`.
|
|
174
|
+
- `CompactCalendar` is no longer bounded.
|
|
175
|
+
- Added `Context`, which will later be extended to handle localization info.
|
|
176
|
+
- Added module `country`.
|
|
177
|
+
- Better documentation converage.
|
|
178
|
+
|
|
179
|
+
### Python
|
|
180
|
+
|
|
181
|
+
- Got rid of `unsafe` used in `OpeningHours.intervals` implementation.
|
|
182
|
+
- The iterator returned by `OpeningHours.intervals` can be moved between
|
|
183
|
+
threads.
|
|
184
|
+
|
|
185
|
+
## 0.8.3
|
|
186
|
+
|
|
187
|
+
### Fixes
|
|
188
|
+
|
|
189
|
+
- Fix [#52](https://github.com/remi-dupre/opening-hours-rs/pull/52): intervals
|
|
190
|
+
were stopping at midnight before the last day.
|
|
191
|
+
|
|
192
|
+
## 0.8.2
|
|
193
|
+
|
|
194
|
+
### Fixes
|
|
195
|
+
|
|
196
|
+
- Python's Linux binary build were not uploading
|
|
197
|
+
|
|
198
|
+
## 0.8.1
|
|
199
|
+
|
|
200
|
+
### Fixes
|
|
201
|
+
|
|
202
|
+
- Rust crate couldn't publish
|
|
203
|
+
|
|
204
|
+
## 0.8.0
|
|
205
|
+
|
|
206
|
+
### General
|
|
207
|
+
|
|
208
|
+
- Emit some logs when parsing unsupported syntax.
|
|
209
|
+
- Basic support for stringifying `OpeningHours`
|
|
210
|
+
|
|
211
|
+
### Python
|
|
212
|
+
|
|
213
|
+
- Implement `__repr__`, `__str__`, `__hash__` and `__eq__`
|
|
214
|
+
- Upgrade to PyO3 0.22 (from 0.19) which natively supports datetime conversions
|
|
215
|
+
|
|
216
|
+
### Fixes
|
|
217
|
+
|
|
218
|
+
- Most crashing edge cases have been removed (through `.expect()` removal and fuzzing)
|
|
219
|
+
- Monthday & Time ambiguity has been fixed for parser (eg. "Oct 12:00-24:00")
|