Skip to content

Commit

Permalink
Update python/deps/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys0dev committed Jan 7, 2024
1 parent 1c088f2 commit 2b40d8d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: casperdcl/deploy-pypi@v2
with:
password: ${{ secrets.pypi_token }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
argparse
charset-normalizer>=3.1.0
certifi>=2017.4.17
chardet>=3.0.2,<5.2.0
chardet>=3.0.2
cssselect
dateparser==1.1.8
feedparser==6.0.10
geonamescache==1.6.0
dateparser>=1.2.0
feedparser>=6.0.11
geonamescache>=2.0.0
html5lib
lxml~=4.9
python-dateutil==2.8.2
python-dateutil>=2.8.2
requests>=2.20.0
selenium>=4.9.1
tldextract
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def run(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
34 changes: 32 additions & 2 deletions tests/local/test_PacerParseACMSDocketTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import sys

from juriscraper.pacer import ACMSDocketReport
from tests import TESTS_ROOT_EXAMPLES_PACER
Expand Down Expand Up @@ -59,7 +60,7 @@ def test_acms_datatypes(self):
}
""" # noqa

indented_padded_correct_repr = """
indented_padded_correct_repr_old = """
{'court_id': 'flp',
'pacer_case_id': '49d55502-744d-11ee-b5fa-e38eb4ba6cd2',
'docket_number': '23-1',
Expand All @@ -83,7 +84,36 @@ def test_acms_datatypes(self):
'pacer_doc_id': '19b65316-744e-11ee-a0a4-13890013fe63',
'page_count': 1}]}""" # noqa

_ = indented_padded_correct_repr
indented_padded_correct_repr = """
{'court_id': 'flp',
'pacer_case_id': '49d55502-744d-11ee-b5fa-e38eb4ba6cd2',
'docket_number': '23-1',
'case_name': 'Free Law Project v. People',
'date_filed': datetime.date(2023, 10, 26),
'appeal_from': 'Originating court name',
'fee_status': 'FLP',
'originating_court_information':
{'name': 'FLP',
'identifier': 'OGC ID',
'RESTRICTED_ALIEN_NUMBER': '46-3342480'},
'case_type_information': 'Typical, Subtypical, Subsubtypical',
'parties': [OrderedDict({'name':
'FREE LAW PARTY', 'type':
'Intervenor', 'attorneys': []})],
'docket_entries': [{'document_number': 1,
'description_html': '<p>NEW PARTY, Intervenor, Free Law Project. [Entered: 10/26/2023 6:18 PM]</p>',
'description': 'NEW PARTY, Intervenor, Free Law Project. [Entered: 10/26/2023 6:18 PM]',
'date_entered': datetime.datetime(2023, 10, 26, 18, 18),
'date_filed': datetime.datetime(2023, 10, 26, 18, 18),
'pacer_doc_id': '19b65316-744e-11ee-a0a4-13890013fe63',
'page_count': 1}]}""" # noqa

# Python 3.12 changed the format of OrderedDict so pick the appropriate
# repr here.
if sys.version_info >= (3, 12, 0):
_ = indented_padded_correct_repr
else:
_ = indented_padded_correct_repr_old
_ = re.sub(r"(?m)^\s*", "", _)
correct_repr = _.replace("\n", " ")

Expand Down

0 comments on commit 2b40d8d

Please sign in to comment.