Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 15, 2024
1 parent f60dbb0 commit d2e5a20
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
24 changes: 22 additions & 2 deletions xcookie/builders/github_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def combine_coverage(cls, *args, **kwargs):
@classmethod
def upload_artifact(cls, *args, **kwargs):
return cls.action({
'uses': 'actions/upload-artifact@v4.3.1'
'uses': 'actions/upload-artifact@v4.4.0'
# Rollback to 3.x due to
# https://github.com/actions/upload-artifact/issues/478
# todo: migrate
Expand All @@ -142,7 +142,7 @@ def upload_artifact(cls, *args, **kwargs):
@classmethod
def download_artifact(cls, *args, **kwargs):
return cls.action({
'uses': 'actions/[email protected].2',
'uses': 'actions/[email protected].8',
# 'uses': 'actions/[email protected]',
}, *args, **kwargs)

Expand Down Expand Up @@ -719,6 +719,26 @@ def get_supported_platform_info(self):
# Choose which Python version will be the "main" one we use for version
# agnostic jobs.
main_python_version = supported_py_versions[-1]
from xcookie import constants
# import kwutil
INFO_LUT = {row['version']: row for row in constants.KNOWN_PYTHON_VERSION_INFO}
for pyver in supported_py_versions[::-1]:
info = INFO_LUT[pyver]
if info.get('is_prerelease'):
continue
main_python_version = pyver
break

# TODO: find a nicer way to codify the idea that the supported python
# version needs to map to something github actions knows about, which could
# be a prerelease version.
cpython_versions_non34_ = []
for pyver in cpython_versions_non34:
info = INFO_LUT[pyver]
if 'github_action_version' in info:
pyver = info['github_action_version']
cpython_versions_non34_.append(pyver)
cpython_versions_non34 = cpython_versions_non34_

extras_versions_templates = {
'full-loose': self.config['ci_versions_full_loose'],
Expand Down
25 changes: 23 additions & 2 deletions xcookie/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KNOWN_PYTHON_VERSIONS = [
'2.7', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12',
# '3.13',
'3.13',
]

DEV_PYTHON_VERSIONS = [
Expand All @@ -10,7 +10,7 @@

KNOWN_CPYTHON_DOCKER_IMAGES = {
# TODO allow rc?
# 'cp313': 'python:3.13.0rc2',
'cp313': 'python:3.13.0rc2',
'cp312': 'python:3.12',
'cp311': 'python:3.11',
'cp310': 'python:3.10',
Expand All @@ -19,3 +19,24 @@
'cp37': 'python:3.7',
'cp36': 'python:3.6',
}

# Github Actions supported versions
# https://github.com/actions/python-versions
# https://github.com/actions/python-versions/blob/main/versions-manifest.json

# TODO: make a table of details about each version
# https://devguide.python.org/versions/
KNOWN_PYTHON_VERSION_INFO = [
{'version': '3.14', 'end_of_life': '2030-10'},
{'version': '3.13', 'end_of_life': '2029-10', 'github_action_version': '3.13.0-rc.2', 'is_prerelease': True},
{'version': '3.12', 'end_of_life': '2028-10'},
{'version': '3.11', 'end_of_life': '2027-10'},
{'version': '3.10', 'end_of_life': '2026-10'},
{'version': '3.9', 'end_of_life': '2025-10'},
{'version': '3.8', 'end_of_life': '2024-10'},
{'version': '3.7', 'end_of_life': '2023-06-27'},
{'version': '3.6', 'end_of_life': '2021-12-23'},
{'version': '3.5', 'end_of_life': '2020-09-30'},
{'version': '3.4', 'end_of_life': '2019-03-18'},
{'version': '2.7', 'end_of_life': '2020-01-01'},
]

0 comments on commit d2e5a20

Please sign in to comment.