From 602f6414c302425be909cb36dd50c1baf536c2a8 Mon Sep 17 00:00:00 2001 From: shamilbi Date: Tue, 14 Oct 2025 14:32:33 +0200 Subject: [PATCH 1/4] requires-python: >=3.7 -> >=3.8, -importlib-metadata --- pyproject.toml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 50c9d2b..cce7681 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,14 +12,17 @@ authors = [ license = { file="LICENSE" } keywords = [ "pypi", "mirror", "packages", "pypi-mirror" ] readme = "README.md" -requires-python = ">=3.7" +#requires-python = ">=3.7" + # ruff warning: + # __init__.py:273:12: SyntaxError: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) +requires-python = ">=3.8" dependencies = [ #"packaging~=21.3", # hatchling 1.27.0 requires packaging>=24.2, but you have packaging 21.3 which is incompatible. "packaging~=24.2", # packaging.utils.InvalidSdistFilename: Invalid sdist filename (invalid version): 'expandvars-0.6.0-macosx-10.15-x86_64.tar.gz' (old versions) # solved in morgan/__init__.py - "importlib-metadata~=4.12.0; python_version < '3.8'", + #"importlib-metadata~=4.12.0; python_version < '3.8'", "tomli~=2.0.1", ] classifiers = [ @@ -31,10 +34,12 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", ] @@ -56,4 +61,5 @@ morgan = "morgan:main" [tool.black] line-length = 80 -target-version = ['py37'] +skip-string-normalization = true +target-version = ['py38'] From f2b7e5b397640beb29d1199e7bb84bed610d5a09 Mon Sep 17 00:00:00 2001 From: shamilbi Date: Tue, 14 Oct 2025 14:34:38 +0200 Subject: [PATCH 2/4] -importlib-metadata --- morgan/configurator.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/morgan/configurator.py b/morgan/configurator.py index c543997..f350bb7 100644 --- a/morgan/configurator.py +++ b/morgan/configurator.py @@ -1,17 +1,11 @@ import argparse -from collections import OrderedDict import configparser import os import platform import sys import sysconfig - -from packaging.version import Version - -if Version(platform.python_version()) < Version('3.8'): - import importlib_metadata as metadata -else: - import importlib.metadata as metadata +from collections import OrderedDict +from importlib import metadata def generate_env(name: str = "local"): @@ -23,7 +17,7 @@ def generate_env(name: str = "local"): """ config = configparser.ConfigParser() - config["env.{}".format(name)] = { + config[f'env.{name}'] = { 'os_name': os.name, 'platform_tag': sysconfig.get_platform(), 'sys_platform': sys.platform, From bb781d0a0ed374adb5b2527e9dc24a66768586b4 Mon Sep 17 00:00:00 2001 From: shamilbi Date: Tue, 14 Oct 2025 16:58:55 +0200 Subject: [PATCH 3/4] removed several comments from the code --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cce7681..59049d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,9 +12,6 @@ authors = [ license = { file="LICENSE" } keywords = [ "pypi", "mirror", "packages", "pypi-mirror" ] readme = "README.md" -#requires-python = ">=3.7" - # ruff warning: - # __init__.py:273:12: SyntaxError: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) requires-python = ">=3.8" dependencies = [ #"packaging~=21.3", @@ -22,7 +19,6 @@ dependencies = [ "packaging~=24.2", # packaging.utils.InvalidSdistFilename: Invalid sdist filename (invalid version): 'expandvars-0.6.0-macosx-10.15-x86_64.tar.gz' (old versions) # solved in morgan/__init__.py - #"importlib-metadata~=4.12.0; python_version < '3.8'", "tomli~=2.0.1", ] classifiers = [ From 2568c9bdf29fc0fb97ae8f23a077fc5155219dd5 Mon Sep 17 00:00:00 2001 From: shamilbi Date: Tue, 14 Oct 2025 17:00:41 +0200 Subject: [PATCH 4/4] tool.black: -skip-string-normalization = true --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 59049d1..59aa1e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,5 +57,4 @@ morgan = "morgan:main" [tool.black] line-length = 80 -skip-string-normalization = true target-version = ['py38']