Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Enable version updates for GitHub Actions
Expand All @@ -15,7 +14,8 @@ updates:
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

cooldown:
default-days: 7
# Enable version updates for pre-commit hooks
- package-ecosystem: "pre-commit"
directory: "/"
Expand All @@ -25,3 +25,5 @@ updates:
pre-commit:
patterns:
- "*"
cooldown:
default-days: 7
14 changes: 1 addition & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
name: Check style + docs + types

on:
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest

defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -28,29 +22,23 @@ jobs:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install package with check dependencies
run: uv sync --group check

- name: Run Ruff linter
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89b # v4.1.0
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
with:
args: "check --output-format=github"

- name: Run Ruff formatter
# NOTE: ruff format does not currently support github output format
run: ruff format --check --diff src tests
# Check formatting even if the previous step failed
if: always()

# check docs build
- name: Check that documentation builds with no errors or warnings
run: uv run sphinx-build docs docs/_build --fail-on-warning

# check types with mypy
- name: Check types in python src directory; install needed types
run: uv run mypy --install-types --non-interactive src --follow-untyped-imports

# use treon to make sure that example notebooks run
- name: Check jupyter notebooks with treon
run: uv run treon
14 changes: 4 additions & 10 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]
# allow manually running on main
workflow_dispatch:

permissions:
contents: read

id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
# use python version in .python-version, currently 3.12
with:
python-version: "3.12"
enable-cache: false
- name: Build package
run: uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# configured to use trusted publishing
14 changes: 4 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: unit tests

permissions:
contents: read
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -20,11 +17,13 @@ on:
pull_request:
branches:
- "**"

env:
# python version used to calculate and submit code coverage
COV_PYTHON_VERSION: "3.12"

# Prevent uv from including develop dependencies by default
UV_NO_DEV: 1
# Prevent uv run from syncing by default
UV_NO_SYNC: 1
jobs:
python-unit:
runs-on: ubuntu-latest
Expand All @@ -34,7 +33,6 @@ jobs:
defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -45,20 +43,16 @@ jobs:
python-version: ${{ matrix.python }}
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install package with check dependencies
run: uv sync --group test

# for all versions but the one we use for code coverage, run normally
- name: Run unit tests without code coverage
run: uv run pytest
if: ${{ matrix.python != env.COV_PYTHON_VERSION }}

# run code coverage in one version only
- name: Run unit tests with code coverage reporting
run: uv run pytest --cov=.
if: ${{ matrix.python == env.COV_PYTHON_VERSION }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
env:
Expand Down
15 changes: 9 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
files: \.py
repos:
# ruff for linting and formatting python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: cb8c523fd4835aba42af70f4cad5568db4df0b6c # frozen: v0.16.0
rev: cb8c523fd4835aba42af70f4cad5568db4df0b6c # frozen: v0.16.0
hooks:
- id: ruff-check
args: [--fix, --show-fixes, --exit-non-zero-on-fix]
Expand All @@ -20,21 +19,19 @@ repos:
- id: check-yaml
- id: name-tests-test
args: [--pytest-test-first]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 41e691678310dfd3833f7ab4e180ddb014310356 # frozen: v2.3.0
rev: 41e691678310dfd3833f7ab4e180ddb014310356 # frozen: v2.3.0
hooks:
- id: mypy
additional_dependencies: [numpy]

# yamlfmt for formatting YAML files
- repo: https://github.com/google/yamlfmt
rev: b5ca1890231d5e1e5181fef75a1be609d1e25029 # frozen: v0.21.0
hooks:
- id: yamlfmt
# Codespell for spell checking
- repo: https://github.com/codespell-project/codespell
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -45,3 +42,9 @@ repos:
rev: 76a805bbfcba3506d6cdb4bba1810ab504e0d72b # frozen: v0.9.0
hooks:
- id: action-validator
# Security-focused GitHub Actions static analysis tool
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: 9257c6050c0261b8c57e712f632dc4a8010109a9 # frozen: v1.25.2
hooks:
- id: zizmor
args: [--fix=safe] # enable safe fixes
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.7
1 change: 0 additions & 1 deletion .pythonversion

This file was deleted.

46 changes: 34 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# Change Log

## 0.8
## [0.8] - 2026-07-30

-
- **Documentation update**: examples are now rendered with [sphinx-pyodide](https://rlskoeser.github.io/sphinx-pyodide/)

## 0.7
- Readme now provides a quick start and a link to usage examples in the documentation
- Usage examples provide better coverage of current functionality

- Now tested against python 3.14
- Updates to pre-commit hook versions, GitHub Action versions
- Updates to comply with new version of ruff linter

## [0.7] - 2026-05-07

- Add parsing to Gregorian date converter; supports month names (full or abbreviated)
in English, French, German, Spanish, Kinyarwanda, Ganda, and Tigrinya
- Add support for parsing Christian liturgical dates (fixed holidays and movable feasts)
- Include Gregorian dates and holidays in omnibus parser
- Updates to pyproject.toml, pre-commit hooks, ruff rules, dependabot configuration

## 0.6.1
## [0.6.1] - 2026-03-30

- Updated Read the Docs build to use Ubuntu 24.04

## 0.6
## [0.6] - 2026-01-16

- Experimental omnibus date converter + parser (EDTF, Hebrew, Hijri)
- Reorganized Lark grammar files to a common location
- Improved documentation for converter class parsing and serialization
- Update action versions in GitHub Workflows (contributed by @rettinghaus)

## 0.5.2
## [0.5.2] - 2025-10-02

- repr for Undate, UndateInterval, and UnDelta now produce fully-qualified, constructor-style strings with deterministic field ordering.
- Added Undate.unknown_year property and is_unknown() method to check for fully-unknown year/month/day.
- bugfix: comparisons (eq, gt, lt) and contains (in) now return False when year is unknown
- bugfix: month durations for non-Gregorian dates now returns an integer when month length is known

## 0.5.1
## [0.5.1] - 2025-07-22

- Correct license identifier in CITATION.cff so it is valid

## 0.5
## [0.5] - 2025-06-26

- New `UnDelta` and `UnInt` classes for uncertain durations
- `Undate.duration` now returns either a `Timedelta` or an `UnDelta` if the duration is ambiguous
Expand All @@ -47,7 +57,7 @@
- New example notebook testing Hebrew, Islamic, and Seleucid date parsing and conversion with Princeton Geniza Project data
- bugfix: duration for uncertain years previously returned the duration from earliest to latest possible dates in range; now returns an `UnDelta` with the possible durations for the possible years in the given calendar

## 0.4
## [0.4] - 2025-04-11

- Undate is now Calendar aware / Calendar explicit; default is Gregorian
- New `BaseCalendarConverter` class, with additional methods required for calendar converters
Expand All @@ -67,11 +77,11 @@
- Reorganized examples folder to avoid unnecessary nesting
- ISMI data has been updated from older JSON data to examples in RDF (turtle)

## 0.3.1
## [0.3.1] - 2024-11-18

Update readthedocs config for current installation

## 0.3
## [0.3] - 2024-11-18

- Updated to use numpy `datetime64` to support a greater range of years beyond the 4-digit years supported by python's builtin `datetime.date`
- Custom `Date` and `Timedelta` objects as shims to make numpy datetime64 and timedelta64 act more like python `datetime` objects
Expand All @@ -97,7 +107,7 @@ Update readthedocs config for current installation

Performance differences seem to be negligible, but it does increase payload size. The virtualenv for installing version 0.2 was 14MB; when installing the newer version with numpy, the virtualenv is 46MB (the numpy folder in site packages is 31MB on its own).

## 0.2
## [0.2] - 2024-04-25

- Undate and UndateInterval now include an optional label for named dates or time periods
- Support partially known dates with missing digits (e.g. 1991-1?-10)
Expand All @@ -115,3 +125,15 @@ Performance differences seem to be negligible, but it does increase payload size

Pre-alpha version with preliminary `Undate` and `UndateInterval` classes
with support for ISO8601 date format

[0.2]: https://github.com/dh-tech/undate-python/releases/tag/0.2
[0.3]: https://github.com/dh-tech/undate-python/releases/tag/0.3
[0.3.1]: https://github.com/dh-tech/undate-python/releases/tag/0.3.1
[0.4]: https://github.com/dh-tech/undate-python/releases/tag/0.4
[0.5]: https://github.com/dh-tech/undate-python/releases/tag/0.5
[0.5.1]: https://github.com/dh-tech/undate-python/releases/tag/0.5.1
[0.5.2]: https://github.com/dh-tech/undate-python/releases/tag/0.5.2
[0.6]: https://github.com/dh-tech/undate-python/releases/tag/0.6
[0.6.1]: https://github.com/dh-tech/undate-python/releases/tag/0.6.1
[0.7]: https://github.com/dh-tech/undate-python/releases/tag/0.7
[0.8]: https://github.com/dh-tech/undate-python/releases/tag/0.8
Loading
Loading