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 11, 2024
1 parent f465705 commit 621577a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 28 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 All @@ -29,7 +28,7 @@ packages = [
{%- endif %}

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
importlib-resources = { version = "==6.4.*", python = "<3.9" }
singer-sdk = { version="~=0.40.0", extras = [
{%- if cookiecutter.auth_method == "JWT" -%}"jwt", {% endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from __future__ import annotations

import sys
{%- if cookiecutter.auth_method in ("OAuth2", "JWT") %}
{% if cookiecutter.auth_method in ("OAuth2", "JWT") -%}
from functools import cached_property
{%- endif %}
{% endif -%}
from importlib import resources
from typing import TYPE_CHECKING, Any, Iterable

{% if cookiecutter.auth_method == "API Key" -%}
Expand Down Expand Up @@ -40,11 +40,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 +50,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
9 changes: 4 additions & 5 deletions samples/sample_tap_dummy_json/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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 @@ -20,13 +19,13 @@ classifiers = [
license = "Apache-2.0"

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
requests = "~=2.32.3"
singer-sdk = { version="~=0.38.0", extras = [] }
singer-sdk = {path = "../..", develop = true}

[tool.poetry.group.dev.dependencies]
pytest = ">=8"
singer-sdk = { version="~=0.38.0", extras = ["testing"] }
singer-sdk = {path = "../..", develop = true, extras = ["testing"]}

[tool.poetry.extras]
s3 = ["fs-s3fs"]
Expand All @@ -36,7 +35,7 @@ python_version = "3.12"
warn_unused_configs = true

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down

0 comments on commit 621577a

Please sign in to comment.