Skip to content

chore!: Drop support for Python 3.7, put minimum version limit on Black #754

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

Merged
merged 1 commit into from
Apr 30, 2023
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/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
python: [ "3.8", "3.9", "3.10", "3.11" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem:
)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
for prop_name, prop in self.additional_properties.items():
field_dict[prop_name] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class FreeFormModel:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Import:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ModelName:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ModelReferenceWithPeriods:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ModelWithAdditionalPropertiesRefed:
additional_properties: Dict[str, AnEnum] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
for prop_name, prop in self.additional_properties.items():
field_dict[prop_name] = prop.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
for prop_name, prop in self.additional_properties.items():

if isinstance(prop, ModelWithAnyJsonPropertiesAdditionalPropertyType0):
field_dict[prop_name] = prop.to_dict()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ModelWithAnyJsonPropertiesAdditionalPropertyType0:
additional_properties: Dict[str, str] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ModelWithBackslashInDescription:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ModelWithPrimitiveAdditionalPropertiesADateHolder:
additional_properties: Dict[str, datetime.datetime] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
for prop_name, prop in self.additional_properties.items():
field_dict[prop_name] = prop.isoformat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ModelWithRecursiveRefInAdditionalProperties:
additional_properties: Dict[str, "ModelWithRecursiveRefInAdditionalProperties"] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
for prop_name, prop in self.additional_properties.items():
field_dict[prop_name] = prop.to_dict()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class None_:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class PostResponsesUnionsSimpleBeforeComplexResponse200AType1:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
Expand Down
4 changes: 2 additions & 2 deletions end_to_end_tests/golden-record/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
include = ["CHANGELOG.md", "my_test_api_client/py.typed"]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
httpx = ">=0.15.4,<0.25.0"
attrs = ">=21.3.0"
python-dateutil = "^2.8.0"
Expand All @@ -23,7 +23,7 @@ build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 120
target_version = ['py37', 'py38', 'py39']
target_version = ['py38', 'py39', 'py310', 'py311']
exclude = '''
(
/(
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [
include = ["CHANGELOG.md", "open_api_test_server_client/py.typed"]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
httpx = ">=0.15.4,<0.25.0"
attrs = ">=21.3.0"
python-dateutil = "^2.8.0"
Expand All @@ -24,7 +24,7 @@ build-backend = "poetry.masonry.api"

[tool.black]
line-length = 120
target_version = ['py37', 'py38', 'py39']
target_version = ['py38', 'py39', 'py310', 'py311']
exclude = '''
(
/(
Expand Down
7 changes: 1 addition & 6 deletions openapi_python_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import mimetypes
import shutil
import subprocess
import sys
from enum import Enum
from importlib.metadata import version
from pathlib import Path
from subprocess import CalledProcessError
from typing import Any, Dict, List, Optional, Sequence, Union
Expand All @@ -21,11 +21,6 @@
from .parser import GeneratorData, import_string_from_class
from .parser.errors import ErrorLevel, GeneratorError

if sys.version_info.minor < 8: # version did not exist before 3.8, need to use a backport
from importlib_metadata import version
else:
from importlib.metadata import version # type: ignore

__version__ = version(__package__)


Expand Down
1 change: 0 additions & 1 deletion openapi_python_client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def _version_callback(value: bool) -> None:


def _process_config(path: Optional[pathlib.Path]) -> Config:

if not path:
return Config()

Expand Down
1 change: 0 additions & 1 deletion openapi_python_client/parser/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def _add_responses(
) -> Tuple["Endpoint", Schemas]:
endpoint = deepcopy(endpoint)
for code, response_data in data.items():

status_code: HTTPStatus
try:
status_code = HTTPStatus(int(code))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# pylint: disable=W0611
import sys
from typing import List, Optional, Union
from typing import List, Literal, Optional, Union

from pydantic import BaseModel, Extra

Expand All @@ -12,11 +11,6 @@
from .server import Server
from .tag import Tag

if sys.version_info.minor < 8:
from typing_extensions import Literal
else:
from typing import Literal # type: ignore


class OpenAPI(BaseModel):
"""This is the root document object of the OpenAPI document.
Expand Down
2 changes: 1 addition & 1 deletion openapi_python_client/templates/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = [
include = ["CHANGELOG.md", "{{ package_name }}/py.typed"]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
httpx = ">=0.15.4,<0.25.0"
attrs = ">=21.3.0"
python-dateutil = "^2.8.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target_version = ['py37', 'py38', 'py39']
target_version = ['py38', 'py39', 'py310', 'py311']
exclude = '''
(
/(
Expand Down
2 changes: 1 addition & 1 deletion openapi_python_client/templates/setup.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setup(
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
python_requires=">=3.7, <4",
python_requires=">=3.8, <4",
install_requires=["httpx >= 0.15.0, < 0.25.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"],
package_data={"{{ package_name }}": ["py.typed"]},
)
Loading