Skip to content

Commit

Permalink
Merge pull request #1027 from sanger/python-version-upgradec
Browse files Browse the repository at this point in the history
Update Python version in Dockerfile and Pipfile to 3.13
  • Loading branch information
dasunpubudumal authored Feb 3, 2025
2 parents 7d3906f + 7e3c8e4 commit a9a3cac
Show file tree
Hide file tree
Showing 9 changed files with 868 additions and 1,002 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,24 @@ env:
SETTINGS_MODULE: crawler.config.test

jobs:
setup:
runs-on: ubuntu-latest
outputs:
python_version: ${{ steps.read_python_version.outputs.python_version }}
steps:
- uses: actions/checkout@v4
- name: Read Python version
id: read_python_version
run: echo "::set-output name=python_version::$(cat .python-version)"
black:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ needs.setup.outputs.python_version }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand All @@ -42,12 +52,13 @@ jobs:
python -m black --check .
flake8:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ needs.setup.outputs.python_version }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand All @@ -66,12 +77,13 @@ jobs:
flake8
mypy:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ needs.setup.outputs.python_version }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand All @@ -89,6 +101,7 @@ jobs:
python -m mypy .
test:
runs-on: ubuntu-latest
needs: setup
services:
mysql:
image: mysql:8.0
Expand All @@ -102,7 +115,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ needs.setup.outputs.python_version }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down Expand Up @@ -139,3 +136,6 @@ dmypy.json

# RabbitMQ admin tool
rabbitmqadmin

# PyCharm indexes
.idea
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use buster for a smaller image size and install only the required packages.
# Note that bullseye uses Debian 11 which cannot install msodbcsql17.
FROM python:3.8-slim-buster
FROM python:3.13-slim

# > Setting PYTHONUNBUFFERED to a non empty value ensures that the python output is sent straight to
# > terminal (e.g. your container log) without being first buffered and that you can see the output
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sqlalchemy = "~=2.0"
lab-share-lib = { git = 'https://github.com/sanger/lab-share-lib.git', ref = 'v0.2.0', editable = false }

[requires]
python_version = "3.8"
python_version = "3.13"

[pipenv]
allow_prereleases = true
Expand Down
1,832 changes: 842 additions & 990 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crawler/db/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def reset_is_current_flags(
cursor.execute(sql_statement, [datetime.now()] + rna_ids_group)
total_rows_affected += cursor.rowcount

logger.info(f"Reset is_current to false for { total_rows_affected } rows.")
logger.info(f"Reset is_current to false for {total_rows_affected} rows.")


def insert_or_update_samples_in_mlwh(
Expand Down
2 changes: 1 addition & 1 deletion migrations/back_populate_uuids_date_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def update_mongo(config: Config, updated_at: datetime) -> None:
counter += 1

if counter > 0 and (counter % 5000) == 0:
logger.debug(f"{counter = }")
logger.debug(f"{counter=}")

logger.debug(f"{counter} samples updated in mongo")

Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/test_cherrypicker_data_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_create_barcodes(config, count):
) as generate_barcodes:
actual = create_barcodes(config, count)

assert generate_barcodes.called_with(count)
generate_barcodes.assert_called_with(config, "TEST", count)
assert actual == expected


Expand Down

0 comments on commit a9a3cac

Please sign in to comment.