Skip to content

Commit

Permalink
Merge pull request #55 from remi-dupre/localization
Browse files Browse the repository at this point in the history
0.10 : Localization
  • Loading branch information
remi-dupre authored Dec 29, 2024
2 parents 83ba43e + 8388f09 commit 661d613
Show file tree
Hide file tree
Showing 71 changed files with 2,530 additions and 1,064 deletions.
58 changes: 21 additions & 37 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,40 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
crate: ["opening-hours-syntax", ".", "compact-calendar"]
toolchain: ["stable", "beta", "nightly"]
crate:
[".", "compact-calendar", "opening-hours-py", "opening-hours-syntax"]
features: [""]
include:
- crate: "."
features: "log"
- crate: "."
features: "log,auto-country"
- crate: "."
features: "log,auto-country,auto-timezone"
- crate: "."
features: "log,auto-timezone"
- crate: "opening-hours-syntax"
features: "log"
defaults:
run:
working-directory: ${{ matrix.crate }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
toolchain: stable
components: rustfmt, clippy
- name: Display rust version
run: |
rustc --version
cargo clippy -- --version
cargo fmt -- --version
- name: Lint
run: cargo clippy -- -D warnings
if: matrix.toolchain != 'nightly'
run: cargo clippy --no-default-features --features "${{ matrix.features }}" -- -D warnings
- name: Format
run: cargo fmt -- --check
if: matrix.toolchain != 'nightly'
- name: Tests
run: cargo test

# ---
# --- Execute tests for python package
# ---

test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dev dependancies
run: poetry install
- name: Build Python package
run: poetry run maturin develop
- name: Run doctests
run: poetry run python/run_doctests.py
run: cargo test --no-default-features --features "${{ matrix.features }}"

# ---
# --- Check that all versions are consistency accross packages
Expand All @@ -74,9 +61,6 @@ jobs:
working-directory: scripts
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install poetry
run: |
python -m pip install --upgrade pip
Expand All @@ -98,15 +82,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python library
run: apt-get update && apt-get install -yy python3-dev && apt-get clean
- name: Generate code coverage
run: >-
cargo +nightly tarpaulin --out xml
--ignore-panics --ignore-tests
--features disable-test-timeouts
--all-features
--run-types Tests --run-types Doctests
-p opening-hours -p opening-hours-syntax -p compact-calendar
-p opening-hours -p opening-hours-syntax -p compact-calendar -p opening-hours-py
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data/osm_examples.txt
opening-hours/data/osm_examples.txt
docs
fuzz/artifacts
fuzz/corpus
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.10.0

### Rust

- Rust 1.83
- Support localization (timezone & coords)
- add default feature _log_
- add optional feature _auto-country_
- add optional feature _auto-timezone_

### Python

- Add the `opening_hours.State` type.
- Updated to latest maturin's workflow, which should ship precompiled binaries
for more older Python version in the future.
- Support localization (timezone & coords)
- Add exception types `ParserError` and `UnknownCountryError`

## 0.9.1

### Fixes
Expand Down
Loading

0 comments on commit 661d613

Please sign in to comment.