Skip to content

Commit

Permalink
refactor(templates): Drop support for Python 3.8 in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 6, 2024
1 parent efdc735 commit 079dba1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -30,7 +29,7 @@ packages = [
{%- endif %}

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
singer-sdk = { version="~=0.40.0"{{ ', extras = ["faker"]' if cookiecutter.faker_extra }} }
fs-s3fs = { version = "~=1.1.1", optional = true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

from __future__ import annotations

import sys
{%- if cookiecutter.auth_method in ("OAuth2", "JWT") %}
from functools import cached_property
{%- endif %}

from importlib import resources
from typing import TYPE_CHECKING, Any, Iterable

{% if cookiecutter.auth_method == "API Key" -%}
Expand Down Expand Up @@ -40,11 +41,6 @@

{% endif -%}

if sys.version_info >= (3, 9):
import importlib.resources as importlib_resources
else:
import importlib_resources

if TYPE_CHECKING:
import requests
{%- if cookiecutter.auth_method in ("OAuth2", "JWT") %}
Expand All @@ -55,7 +51,7 @@


# TODO: Delete this is if not using json files for schema definition
SCHEMAS_DIR = importlib_resources.files(__package__) / "schemas"
SCHEMAS_DIR = resources.files(__package__) / "schemas"


class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

from __future__ import annotations

import sys
import typing as t
from importlib import resources

from singer_sdk import typing as th # JSON Schema typing helpers

from {{ cookiecutter.library_name }}.client import {{ cookiecutter.source_name }}Stream

if sys.version_info >= (3, 9):
import importlib.resources as importlib_resources
else:
import importlib_resources


# TODO: Delete this is if not using json files for schema definition
SCHEMAS_DIR = importlib_resources.files(__package__) / "schemas"
SCHEMAS_DIR = resources.files(__package__) / "schemas"


{%- if cookiecutter.stream_type == "GraphQL" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -29,7 +28,7 @@ packages = [
{%- endif %}

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
singer-sdk = { version="~=0.40.0"{{ ', extras = ["faker"]' if cookiecutter.faker_extra }} }
fs-s3fs = { version = "~=1.1.1", optional = true }
{%- if cookiecutter.serialization_method != "SQL" %}
Expand Down

0 comments on commit 079dba1

Please sign in to comment.