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

Python 3.11 #21

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: main
name: Main

on:
push: { branches: [main] }
Expand All @@ -18,14 +18,14 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: pip
- name: "lint: isort"
run: make isort
- name: "lint: black"
run: make black
- name: "lint: flake8"
run: make flake8
- name: "lint: ruff"
run: make ruff
- name: "lint: pylint"
run: make pylint
- name: "lint: mypy"
Expand All @@ -34,6 +34,7 @@ jobs:
run: make bandit

test:
name: test (Python ${{ matrix.target.python }}, ClickHouse ${{ matrix.clickhouse }})
needs: lint
strategy:
fail-fast: false
Expand All @@ -42,6 +43,8 @@ jobs:
- python: "3.6"
ubuntu: "20.04"
- python: "3.10"
ubuntu: "22.04"
- python: "3.11"
ubuntu: "latest"
clickhouse:
- "21.8.15.7"
Expand All @@ -59,4 +62,4 @@ jobs:
- name: run unit tests
run: make test-unit
- name: run integration tests
run: make test-integration
run: CLICKHOUSE_VERSION=${{ matrix.clickhouse }} make test-integration
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.11
9 changes: 9 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
select = ["E", "F", "W", "A"]

ignore = [
"A003", # "Class attribute is shadowing a Python builtin"
"E501", # "Line too long"
]

[per-file-ignores]
"__init__.py" = ["F401"] # "Unused import"
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build: install-deps ch_backup/version.txt
all: build lint test-unit test-integration

.PHONY: lint
lint: install-deps isort black flake8 pylint mypy bandit
lint: install-deps isort black ruff pylint mypy bandit

.PHONY: isort
isort: install-deps
Expand All @@ -37,9 +37,9 @@ isort: install-deps
black: install-deps
${TEST_ENV} black --check --diff .

.PHONY: flake8
flake8: install-deps
${TEST_ENV} flake8 ch_backup tests
.PHONY: ruff
ruff: install-deps
${TEST_ENV} ruff check ch_backup tests

.PHONY: pylint
pylint: install-deps
Expand Down Expand Up @@ -157,6 +157,7 @@ install-deps: .install-deps

.install-deps: requirements.txt requirements-dev.txt
if [ -z "${NO_VENV}" ]; then ${PYTHON} -m venv venv; fi
${TEST_ENV} pip install --upgrade pip
${TEST_ENV} pip install --no-cache-dir --disable-pip-version-check -r requirements.txt -r requirements-dev.txt
touch .install-deps

Expand All @@ -166,12 +167,12 @@ help:
@echo "Targets:"
@echo " build (default) Build project. It installs dependencies and generates version.txt."
@echo " all Alias for \"build lint test-unit test-integration\"."
@echo " lint Run all linter tools. Alias for \"isort black flake8 pylint mypy bandit\"."
@echo " lint Run all linter tools. Alias for \"isort black ruff pylint mypy bandit\"."
@echo " test-unit Run unit tests."
@echo " test-integration Run integration tests."
@echo " isort Perform isort checks."
@echo " black Perform black checks."
@echo " flake8 Perform flake8 checks."
@echo " ruff Perform ruff checks."
@echo " pylint Perform pylint checks."
@echo " mypy Perform mypy checks.."
@echo " bandit Perform bandit checks."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Commands:

### Regression

The regression test suite contains run of static code analysis tools (isort, black, flake8, pylint, mypy, bandit),
The regression test suite contains run of static code analysis tools (isort, black, ruff, pylint, mypy, bandit),
unit tests and integration tests.

The tests can be run by issuing the command:
Expand Down
4 changes: 2 additions & 2 deletions ch_backup/type_hints/boto3/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from mypy_boto3_s3 import S3Client
from mypy_boto3_s3.type_defs import ObjectIdentifierTypeDef
from mypy_boto3_s3 import S3Client # noqa: F401
from mypy_boto3_s3.type_defs import ObjectIdentifierTypeDef # noqa: F401
else:
# TODO: Use module level __getattr_() as fallback (PEP 562) in Python 3.7+
S3Client = Any
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
isort
black
flake8
flake8-string-format
flake8-print
ruff; python_version >="3.7"
pep8
pylint
mypy==0.910
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Database",
"Typing :: Typed",
],
Expand Down