Skip to content

Commit

Permalink
Merge pull request #376 from ImageMarkup/upgrade-py312
Browse files Browse the repository at this point in the history
  • Loading branch information
danlamanna authored Jul 18, 2024
2 parents 1386729 + 7f1c9b9 commit 64e234e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"
- name: Install tox
run: |
pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ but allows developers to run Python code on their native system.

### Initial Setup
1. Run `docker-compose -f ./docker-compose.yml up -d`
2. Install Python 3.10
2. Install Python 3.12
3. Install
[`psycopg2` build prerequisites](https://www.psycopg.org/docs/install.html#build-prerequisites)
4. Create and activate a new Python virtualenv
Expand Down
2 changes: 1 addition & 1 deletion dev/django.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.12-slim
# Install system librarires for Python packages:
# * psycopg2
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.black]
line-length = 100
skip-string-normalization = true
target-version = ["py310"]
target-version = ["py312"]
exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist'

[tool.isort]
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.7
python-3.12.0
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python',
],
python_requires='>=3.10',
python_requires='>=3.12',
packages=find_packages(),
include_package_data=True,
install_requires=[
Expand All @@ -53,10 +53,12 @@
'isic-challenge-scoring>=5.6',
'requests',
'rules',
# See https://github.com/axnsan12/drf-yasg/issues/874
'setuptools',
'uritemplate',
# Production-only
'django-composed-configuration[prod]>=0.20.1',
'django-s3-file-field[boto3]',
'django-s3-file-field[s3]>=1',
'gunicorn',
],
extras_require={
Expand Down
4 changes: 2 additions & 2 deletions stade/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def clean(self):

def get_invites(self):
for field in range(3):
if self.cleaned_data[f'initial_invite_{field+1}']:
if self.cleaned_data[f'initial_invite_{field + 1}']:
yield TeamInvitation(
sender=self.request.user,
team=self.instance,
recipient=self.cleaned_data[f'initial_invite_{field+1}'].lower(),
recipient=self.cleaned_data[f'initial_invite_{field + 1}'].lower(),
)


Expand Down
7 changes: 4 additions & 3 deletions stade/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def _score_submission(submission):
prediction_file: FieldFile = submission.test_prediction_file

if submission.approach.task.type == Task.Type.SEGMENTATION:
with field_file_to_local_path(truth_file) as truth_file_path, field_file_to_local_path(
prediction_file
) as prediction_file_path:
with (
field_file_to_local_path(truth_file) as truth_file_path,
field_file_to_local_path(prediction_file) as prediction_file_path,
):
score = SegmentationScore.from_zip_file(
truth_file_path,
prediction_file_path,
Expand Down

0 comments on commit 64e234e

Please sign in to comment.