Skip to content

Commit 7fb1958

Browse files
authored
Python: update deps and switch to ruff. (#1332)
Ruff is better, and we already use it everywhere. Updating the deps to more recent ones that fix a few bugs.
1 parent ef04e51 commit 7fb1958

File tree

9 files changed

+443
-202
lines changed

9 files changed

+443
-202
lines changed

python/example.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
import time
21
import whsaas.openapi_client
32
from pprint import pprint
43
from whsaas.openapi_client.api import application_api
5-
from whsaas.openapi_client.model.application_in import ApplicationIn
6-
from whsaas.openapi_client.model.application_out import ApplicationOut
7-
from whsaas.openapi_client.model.http_validation_error import HTTPValidationError
8-
from whsaas.openapi_client.model.http_error_out import HttpErrorOut
9-
from whsaas.openapi_client.model.list_response_application_out import ListResponseApplicationOut
4+
105
# Defining the host is optional and defaults to http://localhost
116
# See configuration.py for a list of all supported configuration parameters.
12-
configuration = whsaas.openapi_client.Configuration(
13-
host = "http://localhost:8040"
14-
)
7+
configuration = whsaas.openapi_client.Configuration(host="http://localhost:8040")
158

169
# The client must configure the authentication and authorization parameters
1710
# in accordance with the API server security policy.
1811
# Examples for each auth method are provided below, use the example that
1912
# satisfies your auth use case.
2013

2114
# Configure API key authorization: APIKeyHeader
22-
configuration.api_key['APIKeyHeader'] = 'qqqqqqqq'
15+
configuration.api_key["APIKeyHeader"] = "qqqqqqqq"
2316

2417
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
2518
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
@@ -35,4 +28,7 @@
3528
api_response = api_instance.list_applications_api_v1_app_get()
3629
pprint(api_response)
3730
except whsaas.openapi_client.ApiException as e:
38-
print("Exception when calling ApplicationApi->create_application_api_v1_app_post: %s\n" % e)
31+
print(
32+
"Exception when calling ApplicationApi->create_application_api_v1_app_post: %s\n"
33+
% e
34+
)

python/requirements-dev.txt

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is autogenerated by pip-compile
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
44
#
55
# pip-compile --output-file=requirements-dev.txt requirements.in/development.txt
66
#
@@ -11,13 +11,9 @@ attrs==21.4.0
1111
# openapi-python-client
1212
# pytest
1313
autoflake==1.4
14-
# via
15-
# -r requirements.in/development.txt
16-
# openapi-python-client
14+
# via openapi-python-client
1715
black==23.3.0
18-
# via
19-
# -r requirements.in/development.txt
20-
# openapi-python-client
16+
# via openapi-python-client
2117
build==0.10.0
2218
# via pip-tools
2319
certifi==2023.07.22
@@ -29,15 +25,6 @@ click==8.0.1
2925
# black
3026
# pip-tools
3127
# typer
32-
flake8-polyfill==1.0.2
33-
# via pep8-naming
34-
flake8-print==4.0.0
35-
# via -r requirements.in/development.txt
36-
flake8==3.9.2
37-
# via
38-
# -r requirements.in/development.txt
39-
# flake8-polyfill
40-
# flake8-print
4128
h11==0.12.0
4229
# via httpcore
4330
httpcore==0.15.0
@@ -53,23 +40,19 @@ idna==3.3
5340
iniconfig==1.1.1
5441
# via pytest
5542
isort==5.8.0
56-
# via
57-
# -r requirements.in/development.txt
58-
# openapi-python-client
43+
# via openapi-python-client
5944
jinja2==3.1.3
6045
# via
6146
# -r requirements.in/development.txt
6247
# openapi-python-client
6348
markupsafe==2.1.0
6449
# via jinja2
65-
mccabe==0.6.1
66-
# via flake8
50+
mypy==1.4.0
51+
# via -r requirements.in/development.txt
6752
mypy-extensions==1.0.0
6853
# via
6954
# black
7055
# mypy
71-
mypy==1.4.0
72-
# via -r requirements.in/development.txt
7356
openapi-python-client==0.14.1
7457
# via -r requirements.in/development.txt
7558
packaging==23.1
@@ -79,8 +62,6 @@ packaging==23.1
7962
# pytest
8063
pathspec==0.11.1
8164
# via black
82-
pep8-naming==0.11.1
83-
# via -r requirements.in/development.txt
8465
pip-tools==6.13.0
8566
# via -r requirements.in/development.txt
8667
platformdirs==3.5.1
@@ -89,45 +70,33 @@ pluggy==0.13.1
8970
# via pytest
9071
py==1.10.0
9172
# via pytest
92-
pycodestyle==2.7.0
93-
# via
94-
# flake8
95-
# flake8-print
96-
pydantic==1.10.0
73+
pydantic==1.10.13
9774
# via openapi-python-client
9875
pyflakes==2.3.1
99-
# via
100-
# autoflake
101-
# flake8
76+
# via autoflake
10277
pyproject-hooks==1.0.0
10378
# via build
10479
pytest==6.2.4
10580
# via -r requirements.in/development.txt
10681
python-dateutil==2.8.2
10782
# via openapi-python-client
108-
pyyaml==6.0
83+
pyyaml==6.0.1
10984
# via openapi-python-client
11085
rfc3986[idna2008]==1.5.0
11186
# via httpx
87+
ruff==0.4.8
88+
# via -r requirements.in/development.txt
11289
shellingham==1.4.0
11390
# via openapi-python-client
11491
six==1.16.0
115-
# via
116-
# flake8-print
117-
# python-dateutil
92+
# via python-dateutil
11893
sniffio==1.2.0
11994
# via
12095
# anyio
12196
# httpcore
12297
# httpx
12398
toml==0.10.2
12499
# via pytest
125-
tomli==2.0.1
126-
# via
127-
# black
128-
# build
129-
# mypy
130-
# pyproject-hooks
131100
typer==0.7.0
132101
# via openapi-python-client
133102
typing-extensions==4.6.3

python/requirements.in/development.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
autoflake
2-
black
3-
isort
4-
flake8
5-
flake8-print
6-
pep8-naming
1+
ruff
72
mypy>=1.4.0
83
pip-tools>=6.13.0
94
pytest

python/scripts/format.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh -e
22
set -x
33

4-
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place svix --exclude=__init__.py
5-
isort svix
6-
black svix
4+
ruff check --fix svix
5+
ruff format svix

python/scripts/lint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
set -ex
44

55
mypy svix
6-
isort --check-only svix
7-
black svix --check
8-
flake8 svix
6+
ruff check svix
7+
ruff format --check svix

python/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
Svix
2+
Svix
33
4-
The Svix server API documentation # noqa: E501
4+
The Svix server API documentation # noqa: E501
55
6-
The version of the OpenAPI document: 0.8.1
7-
Generated by: https://openapi-generator.tech
6+
The version of the OpenAPI document: 0.8.1
7+
Generated by: https://openapi-generator.tech
88
"""
99

1010
import os

0 commit comments

Comments
 (0)