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

Drop support for Python 3.7 #405

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
include:
- python: "3.7"
- python: "3.8"
psycopg: "psycopg2"
- python: "3.12"
psycopg: "psycopg3"
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ repos:
exclude: tests/test_*.txt
- repo: local
hooks:
- id: pyupgrade
name: pyupgrade
entry: pyupgrade --py38-plus --exit-zero-even-if-changed
language: system
types: [python]
- id: black
name: black
entry: black --check .
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
* Fix retrieval of I/O statistics on BSD systems (#393).
* Fix spelling mistakes in the man page.

### Removed

* Python 3.7 is no longer supported.

### Misc

* Document how to *hack* on pg\_activity in the `README`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pg\_activity releases. Before submitting a bug report here:

## From PyPI

pg\_activity can be installed using pip on Python 3.7 or later along with
pg\_activity can be installed using pip on Python 3.8 or later along with
psycopg:

$ python3 -m pip install "pg_activity[psycopg]"
Expand Down
7 changes: 1 addition & 6 deletions pgactivity/compat.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import operator
import sys
from importlib.metadata import version
from typing import Any, Dict

import attr
import attr.validators
import blessed

if sys.version_info < (3, 8):
from importlib_metadata import version
else:
from importlib.metadata import version

ATTR_VERSION = tuple(int(x) for x in version("attrs").split(".", 2)[:2])
BLESSED_VERSION = tuple(int(x) for x in version("blessed").split(".", 2)[:2])

Expand Down
2 changes: 1 addition & 1 deletion pgactivity/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def add_column(key: str, name: str, **kwargs: Any) -> None:
key="database",
name="DATABASE(*)" if filters.dbname else "DATABASE",
min_width=max_db_length,
transform=functools.lru_cache()(
transform=functools.lru_cache(
lambda v: utils.ellipsis(v, width=16) if v else "",
),
sort_key=None,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description = "Command line tool for PostgreSQL server activity monitoring."
readme = "README.md"
license = { text = "PostgreSQL" }
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [
{ name = "Julien Tachoires", email = "[email protected]" },
{ name = "Benoit Lobréau", email = "[email protected]" },
Expand Down Expand Up @@ -52,6 +52,7 @@ dev = [
"flake8",
"isort",
"pre-commit",
"pyupgrade",
]
typing = [
"mypy",
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ deps =
black >= 24.2.0
flake8
isort
pre-commit
pyupgrade
commands =
codespell {toxinidir}
black --check --diff {toxinidir}
flake8 {toxinidir}
isort --check --diff {toxinidir}
pre-commit run --all-files --show-diff-on-failure pyupgrade

[testenv:mypy]
extras =
Expand Down
Loading