Skip to content

Commit 215542e

Browse files
committed
Merge branch 'release/0.2'
2 parents f5550ba + b3be961 commit 215542e

19 files changed

+3658
-80
lines changed

.all-contributorsrc

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"README.md"
44
],
55
"imageSize": 100,
6-
"commit": false,
6+
"commit": true,
77
"commitConvention": "angular",
88
"contributors": [
99
{
@@ -26,7 +26,10 @@
2626
"code",
2727
"review",
2828
"test",
29-
"blog"
29+
"blog",
30+
"example",
31+
"doc",
32+
"platform"
3033
]
3134
},
3235
{
@@ -64,6 +67,7 @@
6467
}
6568
],
6669
"contributorsPerLine": 7,
70+
"linkToUsage": true,
6771
"skipCi": true,
6872
"repoType": "github",
6973
"repoHost": "https://github.com",

.github/workflows/check.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: style + docs check
1+
name: Check style + docs + types
22

33
on:
44
pull_request:
@@ -12,17 +12,27 @@ jobs:
1212
working-directory: .
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Set up Python 3.10
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.10"
2020
cache: 'pip'
2121
cache-dependency-path: '**/setup.cfg'
2222
- name: Install package with dependencies
2323
run: pip install -e ".[dev]"
2424
if: steps.python-cache.outputs.cache-hit != 'true'
25+
26+
# check code style
2527
- name: Run black
2628
run: black src --check --diff
29+
30+
# check docs
2731
- name: Check that documentation can be built
2832
run: tox -e docs
33+
34+
# check types with mypy
35+
- name: Install mypy
36+
run: pip install mypy
37+
- name: Check types in python src directory; install needed types
38+
run: mypy --install-types --non-interactive src

.github/workflows/unit_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111

1212
env:
1313
# python version used to calculate and submit code coverage
14-
COV_PYTHON_VERSION: "3.10"
14+
COV_PYTHON_VERSION: "3.11"
1515

1616
jobs:
1717
python-unit:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python: ["3.8", "3.9", "3.10", "3.11"]
21+
python: ["3.9", "3.10", "3.11", "3.12"]
2222
defaults:
2323
run:
2424
working-directory: .

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Change Log
22

3+
## 0.2
4+
5+
- Undate and UndateInterval now include an optional label for named dates or time periods
6+
- Support partially known dates with missing digits (e.g. 1991-1?-10)
7+
- Rich comparison checks for Undate
8+
- improved equality check; now supports comparing Undate object with day precision to datetime.date
9+
- implementations and tests for comparison, sorting and contains (`>`, `<`, `>=`, `<=`, and `in`)
10+
- static method to initialize an Undate object from a datetime.date (used for comparisons)
11+
- Example Jupyter notebook comparing Undate duration calculation against
12+
dates and durations in the [Shakespeare and Company Project](https://shakespeareandco.princeton.edu/) [events dataset](https://doi.org/10.34770/nz90-ym25)
13+
- Preliminary support for parsing Extended Date Time Format (EDTF) level 0 and some of level 1 and transforming into Undate objects
14+
- Dropped support for python 3.8; added python 3.12
15+
- Python type improvements and preliminary type checking with mypy
16+
317
## 0.1
418

519
Pre-alpha version with preliminary `Undate` and `UndateInterval` classes

README.md

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# undate-python
2+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
4+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
25

36
**undate** is a python library for working with uncertain or partially known dates.
47

@@ -59,12 +62,9 @@ This repository uses [git-flow](https://github.com/nvie/gitflow) branching conve
5962
- **main** will always contain the most recent release
6063
- **develop** branch is the latest version of work in progress
6164

62-
Pull requests should be made against the **develop** branch.
65+
Pull requests for new features should be made against the **develop** branch.
6366

64-
It is recommended to install git flow (on OSX, use brew or ports, e.g.: `brew install git-flow`;
65-
on Ubuntu/Debian, `apt-get install git-flow`) and then initialize it in this repository
66-
via `git flow init` and accept the defaults. Then you can use `git flow feature start`
67-
to create feature development branches.
67+
It is recommended to install git flow (on OSX, use brew or ports, e.g.: `brew install git-flow`; on Ubuntu/Debian, `apt-get install git-flow`) and then initialize it in this repository via `git flow init` and accept the defaults. Then you can use `git flow feature start` to create feature development branches.
6868

6969
Alternately, you can check out the develop branch (`git checkout develop`)
7070
and create your branches manually based on develop (`git checkout -b feature/xxx-name`).
@@ -96,6 +96,18 @@ To run all the tests in a single test file, use pytest and specify the path to t
9696

9797
To test cases by name, use pytest: `pytest -k test_str`
9898

99+
### Check python types
100+
101+
Python typing is currently only enforced by a CI check action using `mypy`.
102+
To run mypy locally, first install mypy and the necessary typing libraries:
103+
```sh
104+
pip install mypy
105+
mypy --install-types
106+
```
107+
108+
Once mypy is installed, run `mypy src/` to check.
109+
110+
99111
### Create documentation
100112

101113
```sh
@@ -111,12 +123,21 @@ tox -e docs
111123
<tbody>
112124
<tr>
113125
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ColeDCrawford"><img src="https://avatars.githubusercontent.com/u/16374762?v=4?s=100" width="100px;" alt="Cole Crawford"/><br /><sub><b>Cole Crawford</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=ColeDCrawford" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3AColeDCrawford" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=ColeDCrawford" title="Tests">⚠️</a></td>
114-
<td align="center" valign="top" width="14.28%"><a href="http://rlskoeser.github.io"><img src="https://avatars.githubusercontent.com/u/691231?v=4?s=100" width="100px;" alt="Rebecca Sutton Koeser"/><br /><sub><b>Rebecca Sutton Koeser</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=rlskoeser" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Arlskoeser" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=rlskoeser" title="Tests">⚠️</a> <a href="#blog-rlskoeser" title="Blogposts">📝</a></td>
126+
<td align="center" valign="top" width="14.28%"><a href="http://rlskoeser.github.io"><img src="https://avatars.githubusercontent.com/u/691231?v=4?s=100" width="100px;" alt="Rebecca Sutton Koeser"/><br /><sub><b>Rebecca Sutton Koeser</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=rlskoeser" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Arlskoeser" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=rlskoeser" title="Tests">⚠️</a> <a href="#blog-rlskoeser" title="Blogposts">📝</a> <a href="#example-rlskoeser" title="Examples">💡</a> <a href="https://github.com/dh-tech/undate-python/commits?author=rlskoeser" title="Documentation">📖</a> <a href="#platform-rlskoeser" title="Packaging/porting to new platform">📦</a></td>
115127
<td align="center" valign="top" width="14.28%"><a href="https://github.com/robcast"><img src="https://avatars.githubusercontent.com/u/1488847?v=4?s=100" width="100px;" alt="Robert Casties"/><br /><sub><b>Robert Casties</b></sub></a><br /><a href="#data-robcast" title="Data">🔣</a></td>
116128
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jdamerow"><img src="https://avatars.githubusercontent.com/u/8881141?v=4?s=100" width="100px;" alt="Julia Damerow"/><br /><sub><b>Julia Damerow</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=jdamerow" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Ajdamerow" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=jdamerow" title="Tests">⚠️</a> <a href="#eventOrganizing-jdamerow" title="Event Organizing">📋</a></td>
117129
<td align="center" valign="top" width="14.28%"><a href="https://github.com/maltevogl"><img src="https://avatars.githubusercontent.com/u/20907912?v=4?s=100" width="100px;" alt="Malte Vogl"/><br /><sub><b>Malte Vogl</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Amaltevogl" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Tests">⚠️</a> <a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Documentation">📖</a></td>
118130
</tr>
119131
</tbody>
132+
<tfoot>
133+
<tr>
134+
<td align="center" size="13px" colspan="7">
135+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
136+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
137+
</img>
138+
</td>
139+
</tr>
140+
</tfoot>
120141
</table>
121142

122143
<!-- markdownlint-restore -->

0 commit comments

Comments
 (0)