Skip to content

Commit 57eeaa2

Browse files
authored
add python v39 support. (#25)
* add Python v3.9 and newer support.
1 parent a2c9c86 commit 57eeaa2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+518
-476
lines changed

.editorconfig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
# RTFM: https://EditorConfig.org
12
root = true
23

34
[*]
5+
charset = utf-8
6+
end_of_line = lf
47
indent_style = space
58
indent_size = 4
69
insert_final_newline = true
710
trim_trailing_whitespace = true
8-
end_of_line = lf
9-
charset = utf-8
1011
max_line_length = 100
1112

12-
[*.{yml, yaml}]
13-
indent_size = 2
13+
[Makefile]
14+
indent_style = tab
1415

15-
[*.md]
16+
[{*.yaml,*.yml,*.toml}]
1617
indent_size = 2
18+
insert_final_newline = false

.flake8

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ __pycache__/
1919

2020
# IDE and editors.
2121
.idea/
22+
23+
.tox/

.pre-commit-config.yaml

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.3.1
4-
hooks:
5-
- id: pyupgrade
6-
args: ["--py310-plus"]
7-
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
9-
hooks:
10-
- id: check-ast
11-
- id: fix-byte-order-marker
12-
- id: end-of-file-fixer
13-
- id: trailing-whitespace
14-
- id: check-yaml
15-
- id: check-builtin-literals
16-
- id: requirements-txt-fixer
17-
- repo: https://github.com/psf/black
18-
rev: 22.12.0
19-
hooks:
20-
- id: black
21-
args: [--line-length=100, --skip-string-normalization]
22-
- repo: https://github.com/asottile/reorder_python_imports
23-
rev: v3.9.0
24-
hooks:
25-
- id: reorder-python-imports
26-
- repo: https://github.com/pre-commit/pygrep-hooks
27-
rev: v1.10.0
28-
hooks:
29-
- id: python-use-type-annotations
30-
- id: python-no-eval
31-
- id: text-unicode-replacement-char
32-
exclude: '.js$'
33-
- repo: https://github.com/pycqa/flake8
34-
rev: 6.0.0
35-
hooks:
36-
- id: flake8
37-
additional_dependencies:
38-
- flake8-bugbear
39-
- flake8-implicit-str-concat
40-
args: [--max-line-length=100]
41-
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
42-
rev: v1.3.1
43-
hooks:
44-
- id: python-safety-dependencies-check
45-
files: requirements.txt
46-
default_language_version:
47-
python: python3.10
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v3.15.0
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py39-plus]
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.5.0
9+
hooks:
10+
- id: check-ast
11+
- id: fix-byte-order-marker
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- id: check-yaml
15+
- id: check-builtin-literals
16+
- id: check-toml
17+
- repo: https://github.com/psf/black
18+
rev: 23.10.0
19+
hooks:
20+
- id: black
21+
- repo: https://github.com/asottile/reorder_python_imports
22+
rev: v3.12.0
23+
hooks:
24+
- id: reorder-python-imports
25+
- repo: https://github.com/pre-commit/pygrep-hooks
26+
rev: v1.10.0
27+
hooks:
28+
- id: python-use-type-annotations
29+
- id: python-no-eval
30+
- id: text-unicode-replacement-char
31+
exclude: .js$
32+
- repo: https://github.com/pycqa/flake8
33+
rev: 6.1.0
34+
hooks:
35+
- id: flake8
36+
additional_dependencies:
37+
- flake8-bugbear
38+
- flake8-implicit-str-concat
39+
args: [--max-line-length=100]
40+
- repo: https://github.com/mrtazz/checkmake.git
41+
rev: 0.2.2
42+
hooks:
43+
- id: checkmake
44+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
45+
rev: v2.11.0
46+
hooks:
47+
- id: pretty-format-yaml
48+
args: [--autofix, --indent, '2']
49+
- id: pretty-format-toml
50+
args: [--autofix, --indent, '2']

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10
1+
3.11

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Version 0.14.3
2+
3+
* Add Python versions 3.9, 3.10, 3.11, 3.12 support.
4+
15
## Version 0.14.2
26

37
* Fix case-sensitive url validation.

Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1+
.PHONY: venv test tox format clean build install upload_to_testpypi upload_to_pypi all
2+
3+
14
venv:
25
# Create virtual environment.
3-
python3.10 -m venv venv
4-
./venv/bin/pip3 install --upgrade pip setuptools wheel
5-
./venv/bin/pip3 install -r requirements.txt
6-
7-
test:
8-
# Run pytest.
9-
./venv/bin/pytest -s -x --cov-report term-missing:skip-covered --cov=src/flask_first tests/
6+
python3.11 -m venv venv
7+
./venv/bin/pip3 -q install --upgrade pip setuptools wheel
8+
./venv/bin/pip3 -q install -e ".[dev]"
9+
./venv/bin/pip3 -q install -e .
1010

1111
format:
1212
# Run checking and formatting sources.
1313
./venv/bin/pre-commit run -a
1414

15+
test: venv
16+
# Run pytest.
17+
./venv/bin/bandit -q -r src/
18+
./venv/bin/pytest -s -x --cov-report term-missing:skip-covered --cov=src/flask_first tests/
19+
20+
tox: venv
21+
# Testing project via several Python versions.
22+
./venv/bin/tox
23+
1524
clean:
1625
rm -rf dist/
1726
rm -rf src/Flask_First.egg-info
@@ -27,3 +36,5 @@ upload_to_testpypi: build
2736

2837
upload_to_pypi: build
2938
python3 -m twine upload --repository pypi dist/*
39+
40+
all: venv tox build

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Will be added in future releases.
2828

2929
## Installing
3030

31+
Recommended using the latest version of Python. Flask-First supports Python 3.9 and newer.
32+
3133
Install and update using `pip`:
3234

3335
```shell

examples/minimum_app/openapi.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ info:
55
paths:
66
/{name}:
77
parameters:
8-
- name: name
9-
in: path
10-
required: true
11-
schema:
12-
type: string
8+
- name: name
9+
in: path
10+
required: true
11+
schema:
12+
type: string
1313
get:
1414
operationId: index
1515
summary: Returns a list of items

pyproject.toml

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,69 @@
11
[build-system]
2-
requires = ["setuptools>=42", "wheel"]
32
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools>=42", "wheel"]
4+
5+
[project]
6+
authors = [
7+
{name = "Konstantin Fadeev", email = "[email protected]"}
8+
]
9+
classifiers = [
10+
"Framework :: Flask",
11+
"License :: OSI Approved :: MIT License",
12+
"Operating System :: OS Independent",
13+
"Programming Language :: Python :: 3"
14+
]
15+
dependencies = [
16+
'Flask>=2.0.2',
17+
'openapi-spec-validator>=0.5.0',
18+
'marshmallow>=3.14.1'
19+
]
20+
description = "Flask extension for using 'specification first' principle via OpenAPI specification"
21+
license = {file = "LICENSE"}
22+
name = "Flask-First"
23+
readme = "README.md"
24+
requires-python = ">=3.9"
25+
version = "0.14.3"
26+
27+
[project.optional-dependencies]
28+
dev = [
29+
"bandit==1.7.5",
30+
"build==1.0.3",
31+
"mypy==1.6.1",
32+
"pre-commit==3.5.0",
33+
"pytest==7.4.2",
34+
"pytest-cov==4.1.0",
35+
"python-dotenv==1.0.0",
36+
"tox==4.11.3"
37+
]
38+
39+
[project.urls]
40+
changelog = "https://github.com/flask-pro/flask-first/blob/master/CHANGES.md"
41+
repository = "https://github.com/flask-pro/flask-first"
42+
43+
[tool.black]
44+
extend-exclude = '''
45+
# A regex preceded with ^/ will apply only to files and directories
46+
# in the root of the project.
47+
^/foo.py # exclude a file named foo.py in the root of the project (in addition to the defaults)
48+
'''
49+
include = '\.pyi?$'
50+
line-length = 100
51+
skip-string-normalization = true
52+
target-version = ['py39']
53+
54+
[tool.setuptools.packages.find]
55+
include = ["flask_first*"]
56+
where = ["src"]
57+
58+
[tool.tox]
59+
legacy_tox_ini = """
60+
[tox]
61+
env_list =
62+
py312
63+
py311
64+
py310
65+
py39
66+
[testenv]
67+
extras = dev
68+
commands = pytest -s -x --cov-report term-missing:skip-covered --cov=../src/flask_first tests/
69+
"""

0 commit comments

Comments
 (0)