Skip to content

Commit

Permalink
Support python38 (#7)
Browse files Browse the repository at this point in the history
* feat: can resume and dump from string

Signed-off-by: yihong0618 <[email protected]>

* fix: by review and open py3.8

* fix: open package bug

Signed-off-by: yihong0618 <[email protected]>

* fix: ci

Signed-off-by: yihong0618 <[email protected]>

* fix: python3.8 in requirement

* fix: drop 3.8 support

* fix: support python3.8

---------

Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 authored Sep 27, 2023
1 parent 482d127 commit 556e762
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4

Expand All @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

env:
PYTHON: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion garth/stats/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ def list(
if not page_dirs:
return []
if "values" in page_dirs[0]:
page_dirs = [stat | stat.pop("values") for stat in page_dirs]
page_dirs = [{**stat, **stat.pop("values")} for stat in page_dirs]
page_dirs = [camel_to_snake_dict(stat) for stat in page_dirs]
return [cls(**stat) for stat in page_dirs]
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ dependencies = [
"pydantic>=2.0.0",
"requests-oauthlib>=1.3.1",
]
requires-python = ">=3.9"
requires-python = ">=3.8"
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
6 changes: 4 additions & 2 deletions tests/stats/test_intensity_minutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def test_weekly_intensity_minutes(authed_client: Client):
weekly_im = WeeklyIntensityMinutes.list(end, weeks, client=authed_client)
assert len(weekly_im) == weeks
assert (
weekly_im[-1].calendar_date.isocalendar().week
== end.isocalendar().week
weekly_im[-1].calendar_date.isocalendar()[
1
] # in python3.9+ [1] can be .week
== end.isocalendar()[1]
)

0 comments on commit 556e762

Please sign in to comment.