Skip to content

Commit

Permalink
Merge branch 'main' into issue-135-fix-court-string-matching
Browse files Browse the repository at this point in the history
  • Loading branch information
flooie authored Jul 18, 2024
2 parents c9b4d78 + 5d3cf67 commit 37f237f
Show file tree
Hide file tree
Showing 13 changed files with 969 additions and 976 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
#----------------------------------------------
# Alert PR to eyecite benchmark test
#----------------------------------------------
Expand All @@ -32,9 +32,9 @@ jobs:
recreate: true
message: |
Eyecite Benchmarking in progress...
For details, see: https://github.com/freelawproject/eyecite/actions/workflows/benchmark.yml
This message will be updated when the test is completed.
#----------------------------------------------
Expand All @@ -43,7 +43,7 @@ jobs:
# That we should drop once groups is released for main
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand All @@ -52,7 +52,7 @@ jobs:
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down Expand Up @@ -103,14 +103,14 @@ jobs:
poetry run python benchmark/benchmark.py --branches ${{ steps.branch1.outputs.hash }}
git stash --include-untracked
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: freelawproject/eyecite
ref: main

- name: Load cached venv 2
id: cached-poetry-dependencies2
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down Expand Up @@ -164,12 +164,12 @@ jobs:
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
#----------------------------------------------
# Alert PR to eyecite benchmark test
#----------------------------------------------
Expand All @@ -187,7 +187,7 @@ jobs:
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand All @@ -197,7 +197,7 @@ jobs:
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,30 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.12"

- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install hyperscan
run: sudo apt-get install libhyperscan-dev

- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock')}}
key: venv-${{ runner.os }}-cache-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock')}}-v20210414

- name: Install dependencies
run: poetry install
Expand All @@ -47,10 +51,10 @@ jobs:
uses: psf/black@stable

- name: Run flake8
uses: py-actions/flake8@v1
uses: py-actions/flake8@v2

- name: isort Import Sorter
uses: isort/isort-action@v0.1.0
uses: isort/isort-action@v1

- name: pylint Error Checker
run: pylint --fail-under 9 -f colorized eyecite
Expand All @@ -61,23 +65,27 @@ jobs:
lint-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock')}}
key: venv-${{ runner.os }}-cache-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock')}}-v20210414

- name: Install dependencies
run: poetry install
Expand All @@ -95,7 +103,7 @@ jobs:
pylint-json2html -f json -o pylint-report.html
- name: Upload report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: pylint report
path: pylint-report.html
18 changes: 11 additions & 7 deletions .github/workflows/pdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.11"

- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install hyperscan
run: sudo apt-get install libhyperscan-dev

- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-v2021-09-23
key: venv-${{ runner.os }}-cache-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock')}}-v20210414

- name: Install dependencies
run: poetry install
Expand All @@ -52,7 +56,7 @@ jobs:
sed -i 's/AhocorasickTokenizer(.*\]))/AhocorasickTokenizer()/' ./eyecite/index.html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: api_documentation/eyecite
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,34 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/[email protected].3
uses: snok/[email protected].4
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install hyperscan
run: sudo apt-get install libhyperscan-dev

- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-cache-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock')}}-v20210414

- name: Install dependencies
run: poetry install
Expand Down
66 changes: 61 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,79 @@ Features:
- None

Changes:
- As noted in 2.3.3 (2021-03-23), the old `NonopinionCitation` class was renamed `UnknownCitation` to better reflect its purpose. Support for the old class name has now been completely deprecated. This change is purely semantic -- there is no change in how these citations are handled.

Fixes:
- None

Fixes:
- Strengthens error handling during the loading of the cached Hyperscan database. This ensures that an invalid cache triggers a rebuild.


## Current

**2.5.2 - 2023-05-23**
**2.6.4 - 2024-06-03**

Fixes:
- Update dependencies and add Python 3.11 support.

- Bump eyecite to for InvalidError/hyperscan bug

## Past

**2.6.3 - 2024-04-09**

Fixes:

- Addresses compatibility issues identified with the current version of hyperscan(0.7.7).

**2.6.2 - 2024-03-19**

Fixes:

- Adds missing closing parentheses to the corrected_citation_full method in FullCaseCitation and FullJournalCitation classes.

**2.6.1 - 2024-02-29**

Fixes:

- Improves reliability of utils.hash_sha256() by providing a default function to handle non-serializable objects.

**2.6.0 - 2024-02-07**

Features:

- Removes Python 3.8 and 3.9 support
- Adds Python 3.12 support

Changes:

- The hashing and equality behavior of `CitationBase` objects has changed in subtle ways in order to conform with user intuitions and define previously ill-defined behavior. Most importantly, to compare two `eyecite` objects going forward, simply use the native Python syntax `citation1 == citation2`. You can also take the hash of each object and compare that with identical results: `hash(citation1) == hash(citation2)`. This broad change has several more specific implications:
- Citation objects that are created from text with a normalized/corrected reporter are now treated as equal to objects created from text *without* a normalized/corrected reporter (e.g., `1 U.S. 1` versus `1 U. S. 1` are now treated as equal)
- Citation objects that are created from text with a nominative reporter are now treated as equal to objects created from text *without* a nominative reporter (e.g., `5 U.S. 137` versus `5 U.S. (1 Cranch) 137` are now treated as equal)
- Any `IdCitation` and `UnknownCitation` object will always be treated as unequal to any other object
- Previously, `CitationBase` objects had a `comparison_hash()` method. This method was never intended to be a "public" method and has been removed.
- Citation hashes are now stable and reproducible across module loadings of `eyecite`, as we are now using `hashlib.sha256` under the hood. However, note that due to `hashlib`'s implementation details, hashes with NOT be consistent across 32 and 64 machines.

- As noted in 2.3.3 (2021-03-23), the old `NonopinionCitation` class was renamed `UnknownCitation` to better reflect its purpose. Support for the old class name has now been completely deprecated. This change is purely semantic -- there is no change in how these citations are handled.

Fixes:

- Update dependencies for reporters-db

**2.5.5 - 2024-01-10**

Yanked.

**2.5.4 - 2024-01-10**

Yanked.

**2.5.3 - 2024-01-10**

Yanked.

**2.5.2 - 2023-05-23**

Fixes:
- Update dependencies and add Python 3.11 support.

**2.5.1 - 2023-03-09**

Fixes:
Expand Down
Loading

0 comments on commit 37f237f

Please sign in to comment.