Skip to content

Commit

Permalink
Merge branch 'release/0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Apr 25, 2024
2 parents f5550ba + b3be961 commit 215542e
Show file tree
Hide file tree
Showing 19 changed files with 3,658 additions and 80 deletions.
8 changes: 6 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"README.md"
],
"imageSize": 100,
"commit": false,
"commit": true,
"commitConvention": "angular",
"contributors": [
{
Expand All @@ -26,7 +26,10 @@
"code",
"review",
"test",
"blog"
"blog",
"example",
"doc",
"platform"
]
},
{
Expand Down Expand Up @@ -64,6 +67,7 @@
}
],
"contributorsPerLine": 7,
"linkToUsage": true,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: style + docs check
name: Check style + docs + types

on:
pull_request:
Expand All @@ -12,17 +12,27 @@ jobs:
working-directory: .

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: '**/setup.cfg'
- name: Install package with dependencies
run: pip install -e ".[dev]"
if: steps.python-cache.outputs.cache-hit != 'true'

# check code style
- name: Run black
run: black src --check --diff

# check docs
- name: Check that documentation can be built
run: tox -e docs

# check types with mypy
- name: Install mypy
run: pip install mypy
- name: Check types in python src directory; install needed types
run: mypy --install-types --non-interactive src
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ on:

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

jobs:
python-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: .
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## 0.2

- 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)
- Rich comparison checks for Undate
- improved equality check; now supports comparing Undate object with day precision to datetime.date
- implementations and tests for comparison, sorting and contains (`>`, `<`, `>=`, `<=`, and `in`)
- static method to initialize an Undate object from a datetime.date (used for comparisons)
- Example Jupyter notebook comparing Undate duration calculation against
dates and durations in the [Shakespeare and Company Project](https://shakespeareandco.princeton.edu/) [events dataset](https://doi.org/10.34770/nz90-ym25)
- Preliminary support for parsing Extended Date Time Format (EDTF) level 0 and some of level 1 and transforming into Undate objects
- Dropped support for python 3.8; added python 3.12
- Python type improvements and preliminary type checking with mypy

## 0.1

Pre-alpha version with preliminary `Undate` and `UndateInterval` classes
Expand Down
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# undate-python
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

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

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

Pull requests should be made against the **develop** branch.
Pull requests for new features should be made against the **develop** branch.

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.
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.

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

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

### Check python types

Python typing is currently only enforced by a CI check action using `mypy`.
To run mypy locally, first install mypy and the necessary typing libraries:
```sh
pip install mypy
mypy --install-types
```

Once mypy is installed, run `mypy src/` to check.


### Create documentation

```sh
Expand All @@ -111,12 +123,21 @@ tox -e docs
<tbody>
<tr>
<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>
<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>
<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>
<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>
<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>
<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>
</tr>
</tbody>
<tfoot>
<tr>
<td align="center" size="13px" colspan="7">
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
</img>
</td>
</tr>
</tfoot>
</table>

<!-- markdownlint-restore -->
Expand Down
Loading

0 comments on commit 215542e

Please sign in to comment.