Skip to content

Commit

Permalink
set min version to python 3.8 (3.7 is EOL)
Browse files Browse the repository at this point in the history
  • Loading branch information
klamann committed Aug 10, 2023
1 parent efb4a1a commit 77f47cc
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.11]
python-version: [3.8, 3.12]
os: [ubuntu-latest, windows-latest]
name: "Test: Python ${{ matrix.python-version }}, conda, ${{ matrix.os }}"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.11]
python-version: [3.8, 3.12]
os: [ubuntu-latest, windows-latest]
name: "Test: Python ${{ matrix.python-version }}, pip, ${{ matrix.os }}"
steps:
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ repos:
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AT Python Template

[![build](https://img.shields.io/github/actions/workflow/status/at-gmbh/at-python-template/tests-pip.yml?branch=master)](https://github.com/at-gmbh/at-python-template/actions?query=branch%3Amaster+)
![Python Version](https://img.shields.io/badge/python-3.7%20--%203.11-blue)
![Python Version](https://img.shields.io/badge/python-3.8%20--%203.12-blue)
[![License](https://img.shields.io/github/license/at-gmbh/at-python-template)](https://github.com/at-gmbh/at-python-template/blob/master/LICENSE)
![GitHub Repo stars](https://img.shields.io/github/stars/at-gmbh/at-python-template?style=social)

Expand All @@ -13,7 +13,7 @@ This is the official Python Project Template of Alexander Thamm GmbH (AT). It is
2. `cookiecutter https://github.com/at-gmbh/at-python-template`
3. profit!

This will install or update cookiecutter on your system and create a new project in the current folder using the AT Python Template. Please note: Python 3.7 or higher is required.
This will install or update cookiecutter on your system and create a new project in the current folder using the AT Python Template. Please note: Python 3.8 or higher is required.

> This template requires `cookiecutter>=1.7.2`. If you experience issues installing it into your default conda environment, we recommend to create a new clean environment with nothing but the `cookiecutter` package installed.
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"package_manager": ["conda", "pip", "poetry"],
"use_notebooks": ["no", "yes"],
"use_docker": ["no", "yes"],
"ci_pipeline": ["none", "gitlab"],
"ci_pipeline": ["none", "gitlab"],
"create_cli": ["no", "yes"],
"config_file": ["none", "hocon", "yaml"],
"code_formatter": ["none", "black"],
Expand Down
6 changes: 3 additions & 3 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
# check Python version (3.7 or higher)
if StrictVersion(platform.python_version()) < StrictVersion("3.7.0"):
print("ERROR: You are using Python {}, but Python 3.7 or higher is required "
# check Python version (3.8 or higher)
if StrictVersion(platform.python_version()) < StrictVersion("3.8.0"):
print("ERROR: You are using Python {}, but Python 3.8 or higher is required "
"to use this template".format(platform.python_version()))
sys.exit(1)
# check cookiecutter version (1.7.2 or higher)
Expand Down
2 changes: 1 addition & 1 deletion tests/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
shutil.rmtree(temp_dir, ignore_errors=True)

# handle possible issues & give proper return codes
if b'Python 3.7 or higher' in stdout or b'successfully created' in stdout:
if b'Python 3.8 or higher' in stdout or b'successfully created' in stdout:
if actual_fail == expect_fail:
print("Python {} {} as expected".format(
platform.python_version(),
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.7
language_version: python3.8
exclude: ^notebooks{% else %}
- repo: https://github.com/PyCQA/flake8
rev: '5.0.4'
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ services:
build:
context: .{% if cookiecutter.package_manager != 'poetry' %}
args:
PYTHON_IMAGE_TAG: {% if cookiecutter.package_manager == 'conda' %}"4.8.2"{% else %}"3.7-stretch"{% endif %}{% endif %}
PYTHON_IMAGE_TAG: {% if cookiecutter.package_manager == 'conda' %}"4.8.2"{% else %}"3.8-stretch"{% endif %}{% endif %}
command: '{% if cookiecutter.create_cli == 'yes' %}--help{% endif %}'
tty: true
1 change: 0 additions & 1 deletion {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ python = "^3.10"{% if cookiecutter.config_file == 'hocon' %}
pyhocon = "^0.3.59"{% elif cookiecutter.config_file == 'yaml' %}
PyYAML = "^6.0"{% endif %}{% if cookiecutter.create_cli == 'yes' %}
typer = {extras = ["all"], version = "^0.7.0"}{% endif %}
importlib-metadata = {version = "^1.0", python = "<3.8"}

[tool.poetry.dev-dependencies]{% if cookiecutter.code_formatter == 'black' %}
black = "^22.10"{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def read(fname):
'pre-commit',
],
platforms='any',
python_requires='>=3.7',
python_requires='>=3.8',
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{% if cookiecutter.package_manager == 'poetry' %}try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata
{% if cookiecutter.package_manager == 'poetry' %}from importlib.metadata import version

__version__ = importlib_metadata.version("{{ cookiecutter.project_slug }}")
__version__ = version("{{ cookiecutter.project_slug }}")
{%- else %}__version__ = '0.1.0'{% endif %}

0 comments on commit 77f47cc

Please sign in to comment.