Skip to content

Commit

Permalink
feat: Drop support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 17, 2023
1 parent f545682 commit 0792f68
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 132 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Changed-20230629-202540.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Changed
body: Drop support for Python 3.7
time: 2023-06-29T20:25:40.318839-06:00
custom:
Issue: "617"
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "pypy3.7"
- "pypy3.8"
- "pypy3.9"
- "pypy3.10"
Expand Down Expand Up @@ -271,7 +269,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out the repository
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sonar.python.version=3.7, 3.8, 3.9, 3.10
sonar.python.version=3.8, 3.9, 3.10, 3.11
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

package = "citric"

python_versions = ["3.11", "3.10", "3.9", "3.8", "3.7"]
pypy_versions = ["pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10"]
python_versions = ["3.11", "3.10", "3.9", "3.8"]
pypy_versions = ["pypy3.8", "pypy3.9", "pypy3.10"]
all_python_versions = python_versions + pypy_versions

main_cpython_version = "3.11"
Expand Down
69 changes: 4 additions & 65 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -34,8 +33,7 @@ version = "0.7.2"
"Issue Tracker" = "https://github.com/edgarrmondragon/citric/issues"

[tool.poetry.dependencies]
importlib_metadata = { version = ">=1.6", python = "<3.8" }
python = ">=3.7.0"
python = ">=3.8"
requests = ">=2.23.0"

# Docs
Expand All @@ -54,7 +52,7 @@ faker = ">=18.3.1,<19"
mypy = "^1.4.1"
pytest = ">=7.3.1,<8"
pytest-github-actions-annotate-failures = ">=0.1.7,<0.3.0"
python-dotenv = ">=0.21.1,<1"
python-dotenv = "<2"
safety = ">=2.1.1,<3"
types-requests = "^2.31.0.2"
typing-extensions = { version = ">=4.6.0,<5", python = "<3.12" }
Expand Down Expand Up @@ -85,7 +83,7 @@ include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
line-length = 88
select = ["ALL"]
src = ["src", "tests", "docs"]
target-version = "py37"
target-version = "py38"

[tool.ruff.per-file-ignores]
"docs/notebooks/*" = [
Expand Down
9 changes: 2 additions & 7 deletions src/citric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

from __future__ import annotations

import sys
from importlib import metadata

from citric.client import Client

if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

__version__ = metadata.version(__package__)
"""Package version"""

del annotations, metadata, sys
del annotations, metadata

__all__ = ["Client"]
7 changes: 1 addition & 6 deletions src/citric/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
from citric import types
from citric.objects import Participant

if sys.version_info >= (3, 8):
from typing import Literal # noqa: ICN003
else:
from typing_extensions import Literal

if sys.version_info >= (3, 11):
from typing import Self, Unpack # noqa: ICN003
else:
Expand Down Expand Up @@ -827,7 +822,7 @@ def save_statistics(
def export_timeline(
self,
survey_id: int,
period: Literal["day", "hour"] | enums.TimelineAggregationPeriod,
period: t.Literal["day", "hour"] | enums.TimelineAggregationPeriod,
start: datetime.datetime,
end: datetime.datetime | None = None,
) -> dict[str, int]:
Expand Down
8 changes: 2 additions & 6 deletions src/citric/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import json
import logging
import random
import sys
import typing as t
from importlib import metadata

import requests

Expand All @@ -19,12 +19,8 @@
)
from citric.method import Method

if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

if t.TYPE_CHECKING:
import sys
from types import TracebackType

from citric.types import Result, RPCResponse
Expand Down
Loading

0 comments on commit 0792f68

Please sign in to comment.