fix: Update minimum Python version in pyproject.toml and CI workflow to ensure compatibility and streamline version management
This commit is contained in:
@@ -382,7 +382,7 @@ jobs:
|
||||
# - Programming Language :: Python :: {{LATEST-2}} → 3.11
|
||||
# - Programming Language :: Python :: {{LATEST-1}} → 3.12
|
||||
# - Programming Language :: Python :: {{LATEST}} → 3.13
|
||||
# - requires-python = ">=3.{{LATEST-4}}" → ">=3.9"
|
||||
# - requires-python: Updates minimum version if it changes (currently >=3.9)
|
||||
# Preserves all other classifiers including Development Status :: 5 - Production/Stable
|
||||
run: |
|
||||
python << 'EOF'
|
||||
@@ -395,6 +395,7 @@ jobs:
|
||||
python_versions = json.loads(python_versions_str)
|
||||
|
||||
print(f"Updating pyproject.toml with Python versions: {python_versions}")
|
||||
print(f"Minimum Python version: {python_versions[0]}")
|
||||
|
||||
# Read pyproject.toml
|
||||
with open('pyproject.toml', 'r') as f:
|
||||
@@ -410,15 +411,27 @@ jobs:
|
||||
|
||||
print(f"Placeholder mappings: {replacements}")
|
||||
|
||||
# Get minimum version for requires-python
|
||||
min_version = python_versions[0]
|
||||
|
||||
# Process each line and replace placeholders
|
||||
updated_lines = []
|
||||
for line in lines:
|
||||
updated_line = line
|
||||
# Replace Python version placeholders
|
||||
|
||||
# Replace Python version placeholders in classifiers
|
||||
for placeholder, version in replacements.items():
|
||||
if placeholder in line:
|
||||
updated_line = updated_line.replace(placeholder, version)
|
||||
print(f" Replaced: {placeholder} → {version}")
|
||||
|
||||
# Update requires-python to use minimum version (if it's still at default)
|
||||
if 'requires-python' in line and '>=3.9' in line:
|
||||
# Only update if we're changing to a different minimum version
|
||||
if min_version != '3.9':
|
||||
updated_line = line.replace('>=3.9', f'>={min_version}')
|
||||
print(f" Updated requires-python: >=3.9 → >={min_version}")
|
||||
|
||||
updated_lines.append(updated_line)
|
||||
|
||||
# Write back to pyproject.toml
|
||||
|
||||
Reference in New Issue
Block a user