Skip to content

Commit

Permalink
chore: Support Python 3.9+ (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Jan 6, 2025
1 parent f06889f commit 9c353ce
Show file tree
Hide file tree
Showing 7 changed files with 1,819 additions and 2,262 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ on:
workflow_dispatch:
inputs: {}

env:
FORCE_COLOR: "1"

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Run Pytest
Expand Down
6 changes: 1 addition & 5 deletions cron_ext/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@
import stat
import sys
from contextlib import suppress
from functools import cached_property
from pathlib import Path
from typing import Any, Callable, Iterable

if sys.version_info >= (3, 8):
from functools import cached_property
else:
from cached_property import cached_property

import structlog
from meltano.edk import models
from meltano.edk.extension import ExtensionBase
Expand Down
7 changes: 1 addition & 6 deletions cron_ext/stores/crontab.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@

import os
import re
import sys
from functools import cached_property
from typing import Iterable

if sys.version_info >= (3, 8):
from functools import cached_property
else:
from cached_property import cached_property

from cron_ext.entry import comment_pattern, entry_pattern
from cron_ext.stores.base import EntryStore
from cron_ext.subprocess import run_subprocess
Expand Down
4,036 changes: 1,798 additions & 2,238 deletions poetry.lock

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ license = "MIT"
"Youtube" = "https://www.youtube.com/meltano"

[tool.poetry.dependencies]
cached-property = "^1" # Remove after Python 3.7 support is dropped
python = ">=3.7,<3.12"
python = ">=3.9"
typer = "^0.15.1"
typing-extensions = "^4.7"
meltano-edk = {git = "https://github.com/meltano/edk.git", rev = "v0.1.0"}
meltano-edk = { version = "~=0.4.4" }

[tool.poetry.group.dev.dependencies]
coverage = "^7.2"
meltano = "^2.17"
meltano = [
{ version = ">=3.5", python = ">=3.9,<3.14" },
]
pytest = "^7.4"

[tool.isort]
Expand All @@ -43,12 +44,8 @@ exclude = [
addopts = "-ra -vvv"

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

packages = [
{ include = "cron_ext" }
]

[tool.poetry.scripts]
cron = 'cron_ext.main:app'
4 changes: 2 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.10
ARG PYTHON_VERSION=3.13
FROM python:${PYTHON_VERSION}-slim

WORKDIR /cron-ext
Expand All @@ -7,7 +7,7 @@ RUN apt-get update && \
apt-get install -y cron git && \
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
pip install --upgrade pip && \
pip install poetry==1.3.1 && \
pip install poetry==1.8.5 && \
poetry --version

COPY pyproject.toml poetry.lock /cron-ext/
Expand Down
2 changes: 1 addition & 1 deletion tests/compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.0'
services:
pytest:
build:
Expand All @@ -8,4 +7,5 @@ services:
- ../:/cron-ext
environment:
CONTAINERIZED: 'True'
FORCE_COLOR:
PYTHONDONTWRITEBYTECODE: '1'

0 comments on commit 9c353ce

Please sign in to comment.