Skip to content

Commit

Permalink
Merge pull request #432 from lona-web-org/fscherf/remove-python37-sup…
Browse files Browse the repository at this point in the history
…port

python: drop support for 3.7
  • Loading branch information
fscherf committed Jul 3, 2023
2 parents 4ea4976 + f632500 commit d0b50b9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test:
docker-compose run playwright tox $(args)

ci-test:
docker-compose run playwright tox -e lint,py37,py38,py39,py310,py311 $(args)
docker-compose run playwright tox -e lint,py38,py39,py310,py311 $(args)

lint:
docker-compose run playwright tox -e lint $(args)
Expand Down
32 changes: 1 addition & 31 deletions lona/command_line/collect_static.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from distutils.dir_util import copy_tree
import shutil
import sys
import os

from lona.logging import setup_logging
Expand Down Expand Up @@ -39,35 +37,7 @@ def _cp(source, destination):
return

if source_is_dir:
if sys.version_info < (3, 8):
# TODO: remove after Python 3.7 got removed
# this is necessary because the `dirs_exists_ok` flag in
# shutil.copytree was added in Python 3.8

for rel_source in os.listdir(source):
abs_source = os.path.join(source, rel_source)
abs_destination = os.path.join(destination, rel_source)

if os.path.isdir(abs_source):
if not os.path.exists(abs_destination):
os.makedirs(abs_destination)

copy_tree(
src=abs_source,
dst=abs_destination,
)

else:
if not os.path.exists(destination):
os.makedirs(destination)

shutil.copy(
src=abs_source,
dst=abs_destination,
)

else:
shutil.copytree(source, destination, dirs_exist_ok=True)
shutil.copytree(source, destination, dirs_exist_ok=True)

else:
shutil.copy(source, destination)
Expand Down
22 changes: 4 additions & 18 deletions lona/command_line/handle_command_line.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from argparse import RawTextHelpFormatter, ArgumentParser
import logging
import sys
import os

from jinja2 import Environment
Expand Down Expand Up @@ -44,18 +43,10 @@ def handle_command_line(argv):
description=DESCRIPTION,
)

# the keyword 'required' is not available in python versions lower than 3.7
# TODO: remove after Python3.7 was removed
if sys.version_info < (3, 7):
sub_parsers = parser.add_subparsers(
dest='command',
)

else:
sub_parsers = parser.add_subparsers(
dest='command',
required=True,
)
sub_parsers = parser.add_subparsers(
dest='command',
required=True,
)

# run-server ##############################################################
parser_run_server = sub_parsers.add_parser(
Expand Down Expand Up @@ -229,11 +220,6 @@ def handle_command_line(argv):
# parse argv
args = parser.parse_args(argv[1:])

# this can happen on python versions lower than 3.7
# TODO: remove after Python3.7 was removed
if not args.command:
exit('no sub command was given')

args.settings_pre_overrides = parse_overrides(
args.settings_pre_overrides,
)
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[mypy]
# Minimal supported by lona
python_version = 3.7
python_version = 3.8
pretty = True
warn_unused_configs = True
disallow_incomplete_defs = True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
]

requires-python = ">=3.7"
requires-python = ">=3.8"

dependencies = [
'aiohttp>=3,<4',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ envlist=py310


[tox:jenkins]
envlist=lint,py37,py38,py39,py310,py311
envlist=lint,py38,py39,py310,py311


[testenv]
Expand Down

0 comments on commit d0b50b9

Please sign in to comment.