Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 Release #56

Merged
merged 122 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
8789cb4
update unspecified date character
rettinghaus Feb 4, 2022
1895d6b
update for uncertain AND approximate
rettinghaus Feb 10, 2022
30ef6b6
Merge pull request #1 from rettinghaus/develop-latest-specs
ukretschmer Mar 17, 2023
8067056
catch the right exception
muellersSAW Mar 27, 2023
cb9b84e
Merge branch 'master' into develop
muellersSAW Mar 27, 2023
57e8686
update test for uncertain AND approximate qualifier
muellersSAW Mar 27, 2023
2d241be
fixing/completing the update of unspecified date character ('X' inste…
muellersSAW Mar 27, 2023
3b08350
code formatting: break-before-binary-operator style
muellersSAW Mar 27, 2023
3793142
latest spec definitions for exponential year: the year prefix 'y' and…
muellersSAW Mar 27, 2023
59ce382
latest spec definition: elimination of masked precision
muellersSAW Mar 27, 2023
4d6ed49
bugfix: not recognized time when hour is 23
muellersSAW Mar 28, 2023
8d556f9
latest spec definition: the extended interval syntax keywords 'unkno…
muellersSAW Mar 30, 2023
924b64b
implementation of Level2Season based on implementation of exisiting S…
muellersSAW Mar 30, 2023
bed138d
adding function to convert an old specification expression to a new s…
muellersSAW Apr 4, 2023
e53a11a
new specs for group qualification: at the first step added implementa…
muellersSAW Apr 4, 2023
3fa4156
new specs for group qualification: at the first step added implementa…
muellersSAW Apr 4, 2023
aed1798
Merge branch 'develop' of https://github.com/saw-leipzig/python-edtf …
muellersSAW Apr 4, 2023
f15511b
new specs for group qualification: at second step removed old groupin…
muellersSAW Apr 4, 2023
d0828ea
renaming of variable names (U to X)
muellersSAW Apr 4, 2023
9783799
using infinity for open end/start interval sections
muellersSAW Jun 7, 2023
300b4fe
returning math.inf for open intervall sections
muellersSAW Jun 8, 2023
f0c0040
Merge commit '300b4fe8bedbf3d1790dbef23613c95c3aa2bf6a' into v5
aweakley May 3, 2024
1e3a011
Merge remote-tracking branch 'saw-leipzig/master'
aweakley May 5, 2024
a095fc1
Revert name change from 43bc40 and e03739 back to `edtf`
aweakley May 5, 2024
41f3050
Prevent ImportError during test
aweakley May 5, 2024
a7091f6
WIP moving CI to Github Actions
ColeDCrawford May 6, 2024
782d1a1
Implement pyproject.toml
ColeDCrawford May 6, 2024
f88c88e
Switch to Pytest
ColeDCrawford May 7, 2024
acebbff
Pytest config
ColeDCrawford May 7, 2024
f37831f
Remove TravisCI config, update changelog
ColeDCrawford May 7, 2024
7ba63ad
Merge pull request #44 from artshumrc/ci-setup-packaging
aweakley May 7, 2024
7c41b8c
Convert tests to pytest format
ColeDCrawford May 8, 2024
cf341bb
Fix infinite comparison for OneOfASet
ColeDCrawford May 8, 2024
46b7b8f
Upgrade actions/setup-python
ColeDCrawford May 8, 2024
0cc4bdf
Remove context from from_db_value()
ColeDCrawford May 8, 2024
dfd3292
Allow for setting EDTF directly in Django field
ColeDCrawford May 9, 2024
4f06040
Set up Django test project
ColeDCrawford May 9, 2024
25ee507
Add TestEvent model implementing EDTFField
ColeDCrawford May 9, 2024
fbf4262
Add Django integration tests
ColeDCrawford May 9, 2024
ee4b21e
Update the natural language parser to work with 2018 spec
ColeDCrawford May 9, 2024
98636f7
Merge pull request #45 from artshumrc/pytest-format-tests
aweakley May 10, 2024
e2a79dd
Improve handling of field updates
ColeDCrawford May 12, 2024
4fd0782
More updates of tests and English parser
ColeDCrawford May 12, 2024
613ccf5
Merge pull request #47 from artshumrc/edtf-django-tests
aweakley May 12, 2024
d23ff7b
Remove masked precision and unspecified from README
ColeDCrawford May 13, 2024
f1cd472
Better grouping of group qualification tests
ColeDCrawford May 13, 2024
c024360
First pass with `ruff` #49
aweakley May 14, 2024
61c792e
Remove pdbs
aweakley May 14, 2024
17f7960
Don't require null=True for the CharFields #49
aweakley May 14, 2024
85bac2a
Ruff fix 349
aweakley May 14, 2024
e8b6433
Update year prefix in docs
ColeDCrawford May 16, 2024
77c1b6a
Update module imports
ColeDCrawford May 16, 2024
8d63225
Add pre-commit hook
ColeDCrawford May 16, 2024
ee1d07d
Merge pull request #51 from artshumrc/49_use_ruff
aweakley May 16, 2024
ed2a3f6
Merge branch 'v5' into natural-language
ColeDCrawford May 21, 2024
f74ae80
Linting fixes
ColeDCrawford May 21, 2024
26b0afb
Fix qualification (complete) for L1 qualification
ColeDCrawford May 21, 2024
077eac5
Merge pull request #48 from artshumrc/natural-language
aweakley May 22, 2024
48a9b02
Add code coverage
ColeDCrawford May 22, 2024
09b10d8
Create coverage_readme.yml
ColeDCrawford May 22, 2024
ac4705f
Remove unnecessary files
ColeDCrawford May 22, 2024
9f2b550
Fix matrix
ColeDCrawford May 22, 2024
0eeb9bd
Try adding permissions
ColeDCrawford May 22, 2024
7a02fcd
Try adding checks: permission too
aweakley May 22, 2024
54d5ec7
Run CI on push too
aweakley May 22, 2024
0b92096
Add id to Coverage Comment step
aweakley May 22, 2024
6428196
Remove html from printed output
aweakley May 23, 2024
b8fdbef
Remove not-success from printed output
aweakley May 23, 2024
f262199
Remove all junit-xml items from printed report
aweakley May 23, 2024
5d3d80c
Add back JUnit reporting stats
ColeDCrawford May 23, 2024
6771172
Skip covered due to long comments
ColeDCrawford May 23, 2024
7e15e89
Summary report comes with its own quotes #53
aweakley May 24, 2024
7556479
Finish removing masked precision
ColeDCrawford May 23, 2024
3ce6e87
Add all required tests for significant digits
ColeDCrawford May 23, 2024
7545b6a
Parse significant digits for year, Y-prefixed, exponential
ColeDCrawford May 23, 2024
6b3a9d4
Fix a regression with Consecutives / OneOfASet
ColeDCrawford May 23, 2024
5883f53
Significant digits updates
ColeDCrawford May 24, 2024
6f19388
Merge pull request #55 from artshumrc/12_exponential_year_precision
aweakley May 27, 2024
a6c869e
Minor fix to README
aweakley May 27, 2024
3a1f436
Add limited benchmark tests
aweakley May 27, 2024
6e7b109
Add benchmark to CI #50
aweakley May 27, 2024
0ab80ed
Prevent gh-pages push
aweakley May 27, 2024
3436357
Add gh-pages push
aweakley May 27, 2024
23a3d7e
Make 2 CI paths #50
aweakley May 27, 2024
bb6e640
Store/retrieve previous results
aweakley May 27, 2024
13a8315
Do not auto-push when using external-data file
aweakley May 27, 2024
57af559
GH token required for comment-always
aweakley May 27, 2024
90558b6
Activate packrat #50
aweakley May 27, 2024
6c0e239
Include benchmark url
aweakley May 27, 2024
d550274
Merge pull request #57 from ixc/50_add_performance_tests
aweakley May 28, 2024
ef24bc7
Handle unspecified and qualified ("16XX~")
ColeDCrawford May 28, 2024
b53df4a
Handle negative unspecified and negative unspecified + qualified
ColeDCrawford May 28, 2024
c14a57b
Cleanup
ColeDCrawford May 28, 2024
53d3a32
Add a global debug setting
ColeDCrawford May 28, 2024
ab6c413
Handle empty string
ColeDCrawford May 28, 2024
8c571b0
Merge pull request #58 from artshumrc/38_unspecified_and_qualified
aweakley May 30, 2024
55b0723
Add targeted failure and tests for empty and null inputs
ColeDCrawford Jun 3, 2024
d5ad27b
Improve EDTFParseException handling
ColeDCrawford Jun 3, 2024
daf0d04
Add the TestEvent model to Django admin
ColeDCrawford Jun 3, 2024
5818557
Update qualification properties
ColeDCrawford Jun 5, 2024
63a1573
Add docs about qualification properties
ColeDCrawford Jun 5, 2024
d779dea
Merge pull request #59 from artshumrc/30_improve_exceptions
aweakley Jun 10, 2024
b3205af
Fix typo, add more tests
ColeDCrawford Jun 11, 2024
7a99f12
Simplify EDTFField init; add direct_input_field to deconstruct()
ColeDCrawford Jun 11, 2024
e99813c
Only publish benchmark results on the upstream
ColeDCrawford Jun 11, 2024
fe96fbd
Merge pull request #60 from artshumrc/31-is_approximate-is_uncertain
aweakley Jun 11, 2024
9529491
Anticipate None for date_display #62
aweakley Jun 13, 2024
630a165
Merge pull request #63 from ixc/62_field_could_be_none
aweakley Jun 13, 2024
48b232f
style(readme): use project name for heading
rettinghaus Jun 16, 2024
c0dce8a
style(readme): unify code block style
rettinghaus Jun 16, 2024
e90db90
update authors
rettinghaus Jun 16, 2024
336e8bf
style(readme): add relative link to file
rettinghaus Jun 16, 2024
efbb954
Merge pull request #64 from rettinghaus/readme
aweakley Jun 16, 2024
ea74daf
Update contributors
aweakley Jun 16, 2024
5f09bdf
fix alerts
rettinghaus Jun 17, 2024
4592e9b
drop six dependency
rettinghaus Jun 17, 2024
a2b20cf
Merge pull request #66 from rettinghaus/python3
aweakley Jun 27, 2024
ec5dcc4
Merge pull request #65 from rettinghaus/readme
aweakley Jun 27, 2024
2dee3d0
WIP adding checks for edtf field aliases #62
aweakley Jun 27, 2024
1a5ebd5
Tests for aliases that point to non-existent fields #62
aweakley Jun 27, 2024
ca7e02e
Merge pull request #68 from ixc/62_verify_related_fields
aweakley Jul 7, 2024
d313a9d
Note on benchmarks location
aweakley Jul 7, 2024
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
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI

on:
pull_request:
push:
workflow_dispatch:

permissions:
checks: write
contents: write
# deployments permission to deploy GitHub pages website
deployments: write
pull-requests: write


jobs:
python-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]

- name: Check Python linting (Ruff)
run: ruff check --output-format=github

- name: Check Python formatting (Ruff)
run: ruff format --check

- name: Run unit tests
run: |
pytest --junitxml=junit_pytest_main.xml --cov-report=term-missing:skip-covered
mv .coverage .coverage_main

- name: Run Django integration tests
working-directory: ./edtf_django_tests
run: |
pytest edtf_integration/tests.py --ds=edtf_django_tests.settings --junitxml=../junit_pytest_django.xml --cov-report=term-missing:skip-covered
mv .coverage ../.coverage_django

- name: Combine coverage reports
run: |
coverage combine .coverage_main .coverage_django
coverage report --omit="edtf_django_tests/*"
coverage xml -o coverage_combined.xml --omit="edtf_django_tests/*"

- name: Combine JUnit XML reports
run: |
python combine_junit.py combined_junit_pytest.xml junit_pytest_main.xml junit_pytest_django.xml

- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage_combined.xml
junitxml-path: ./combined_junit_pytest.xml
unique-id-for-comment: ${{ matrix.python-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check the output coverage
run: |
echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}"
echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}"
echo "Summary Report -" ${{ steps.coverageComment.outputs.summaryReport }}
echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}"
echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}"

- name: Run benchmarks
run: |
pytest -m benchmark --benchmark-json=./output.json

- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Publish benchmark results
uses: benchmark-action/github-action-benchmark@v1
if: github.event_name == 'pull_request' && github.repository == 'ixc/python-edtf'
with:
tool: 'pytest'
auto-push: true
comment-always: true
output-file-path: output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
save-data-file: true
summary-always: true

- name: Comment on benchmark results without publishing
if: github.event_name != 'pull_request' || github.repository != 'ixc/python-edtf'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'pytest'
auto-push: false
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-always: true
output-file-path: output.json
comment-on-alert: false
save-data-file: true
summary-always: true
external-data-json-path: ./cache/benchmark-data.json
68 changes: 68 additions & 0 deletions .github/workflows/coverage_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Update Coverage on Readme
on:
push:
branches:
- main

# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# `contents` is for permission to the contents of the repository.
# `pull-requests` is for permission to pull request
permissions:
contents: write
checks: write
pull-requests: write

# see: https://github.com/MishaKav/pytest-coverage-comment
jobs:
update-coverage-on-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]

- name: Run tests and generate coverage
run: |
pytest
mv .coverage .coverage_main
cd edtf_django_tests
coverage run manage.py test edtf_integration
mv .coverage ../.coverage_django
cd ..
coverage combine .coverage_main .coverage_django
coverage report --omit="edtf_django_tests/*"
coverage xml -o coverage_combined.xml --omit="edtf_django_tests/*"

- name: Pytest coverage comment
if: ${{ github.ref == 'refs/heads/main' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage_combined.xml
hide-comment: true

- name: Update Readme with Coverage Html
if: ${{ github.ref == 'refs/heads/main' }}
run: |
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.coverageComment.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md

- name: Commit & Push changes to README
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m 'Update coverage badge in README'
git push
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -41,14 +42,22 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
coverage_combined.xml
.coverage_main
.coverage_django
*,cover
combined_junit_pytest.xml
pytest.xml
junit_pytest_main.xml
junit_pytest_django.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log
db.sqlite3

# Sphinx documentation
docs/_build/
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
exclude: "business-facing/layer"
- id: trailing-whitespace
exclude: "business-facing/layer"
- id: check-yaml
exclude: "business-facing/layer"
- id: check-json
exclude: "business-facing/layer"

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.4
hooks:
# Run the linter, and enable lint fixes
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2015 The Interaction Consortium
Copyright (c) 2023 SAW Leipzig

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading