Skip to content

Commit

Permalink
Update to Python 3.13 (#5145)
Browse files Browse the repository at this point in the history
* Update to python 3.13

* mypy

* remove 3.12 from normal run and deal with htcondor

* Also update prebake file

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
stxue1 and github-actions[bot] authored Nov 13, 2024
1 parent 303a8d8 commit acadd74
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
35 changes: 33 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variables:
PYTHONIOENCODING: "utf-8"
DEBIAN_FRONTEND: "noninteractive"
TOIL_OWNER_TAG: "shared"
MAIN_PYTHON_PKG: "python3.12"
MAIN_PYTHON_PKG: "python3.13"
# Used to tell pytest which tests to be run by specifying markers,
# Allows partitioning of tests to prevent duplicate running of tests in different jobs.
# Currently specifies special tests that are not run by quick_test_offline.
Expand Down Expand Up @@ -191,6 +191,12 @@ py311_main:
- TOIL_SKIP_DOCKER=true make test threads="${TEST_THREADS}" tests=src/toil/test/lib

py312_appliance_build:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH =~ /.*-fix-ci/
- if: $CI_COMMIT_BRANCH =~ /.*3\.12.*/
stage: basic_tests
script:
- pwd
Expand All @@ -201,14 +207,39 @@ py312_appliance_build:

py312_main:
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH =~ /.*-fix-ci/
- if: $CI_COMMIT_BRANCH =~ /.*3\.12.*/
stage: basic_tests
script:
- pwd
- python3.12 -m virtualenv venv && . venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor==23.6.1'
- make test threads="${TEST_THREADS}" tests="src/toil/test/src src/toil/test/utils"
- TOIL_SKIP_DOCKER=true make test threads="${TEST_THREADS}" tests=src/toil/test/lib

py313_appliance_build:
stage: basic_tests
script:
- pwd
- python3.13 -m virtualenv venv && . venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 && pip install -U pip wheel && pip install -U build && make prepare && pip install pycparser && make develop extras=[all]
# This reads GITLAB_SECRET_FILE_QUAY_CREDENTIALS
- python setup_gitlab_docker.py
- make push_docker

py313_main:
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
stage: basic_tests
script:
- pwd
# todo: htcondor is not out for python 3.13 yet, we don't actively test htcondor batchsystems but should still test an htcondor install
- python3.13 -m virtualenv venv && . venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 && pip install -U pip wheel && make prepare && make develop extras=[all]
- make test threads="${TEST_THREADS}" tests="src/toil/test/src src/toil/test/utils"
- TOIL_SKIP_DOCKER=true make test threads="${TEST_THREADS}" tests=src/toil/test/lib


slurm_test:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
Expand Down
7 changes: 4 additions & 3 deletions contrib/toil-ci-prebake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ RUN sudo add-apt-repository -y ppa:deadsnakes/ppa && \
python3.9 python3.9-dev python3.9-venv python3.9-distutils \
python3.10 python3.10-dev python3.10-venv python3.10-distutils \
python3.11 python3.11-dev python3.11-venv python3.11-distutils \
python3.12 python3.12-dev python3.12-venv python3.12-distutils
python3.12 python3.12-dev python3.12-venv python3.12-distutils \
python3.13 python3.13-dev python3.13-venv

RUN rm -f /usr/bin/python
RUN ln -s /usr/bin/python3.11 /usr/bin/python
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.8 get-pip.py && python3.9 get-pip.py && python3.10 get-pip.py && python3.11 get-pip.py && python3.12 get-pip.py # for python 3.12, get-pip seems to remove other pip versions
RUN python3.12 -m pip install virtualenv -U && python3.8 -m pip install virtualenv && python3.9 -m pip install virtualenv && python3.10 -m pip install virtualenv && python3.11 -m pip install virtualenv # python3.12 needs latest version of virtualenv
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.8 get-pip.py && python3.9 get-pip.py && python3.10 get-pip.py && python3.11 get-pip.py && python3.12 get-pip.py && python3.13 get-pip.py # for python 3.12, get-pip seems to remove other pip versions, python 3.13 needs get-pip.py or ensure-pip as older versions of pip relies on distutils which is removed in 3.13
RUN python3.13 -m pip install virtualenv -U && python3.12 -m pip install virtualenv -U && python3.8 -m pip install virtualenv && python3.9 -m pip install virtualenv && python3.10 -m pip install virtualenv && python3.11 -m pip install virtualenv # python3.12 needs latest version of virtualenv


LABEL maintainers="[email protected] [email protected]"
3 changes: 2 additions & 1 deletion docker/Dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
python_packages = {'python3.9': ['python3.9-distutils', 'python3.9-venv'],
'python3.10': ['python3.10-distutils', 'python3.10-venv'],
'python3.11': ['python3.11-distutils', 'python3.11-venv'],
'python3.12': ['python3.12-distutils', 'python3.12-venv']}
'python3.12': ['python3.12-distutils', 'python3.12-venv'],
'python3.13': ['python3.13-venv']} # python3.13 removed distutils

dependencies = ' '.join(python_packages[python] +
['libffi-dev', # For client side encryption for extras with PyNACL
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def run_setup():
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Astronomy",
Expand Down

0 comments on commit acadd74

Please sign in to comment.