Skip to content

Commit

Permalink
Update image and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
javfg committed Jan 7, 2025
1 parent 874cc85 commit 19fcaed
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 276 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
push-to-ghcr-and-gar:
name: Build docker image and publish to GHCR and GAR
runs-on: ubuntu-22.04

permissions:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,57 @@ on:
branches: [main]

jobs:
check-version:
name: Ensure version has been bumped
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request' # Only run on PRs

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install toml package
run: pip install toml

- name: Check version
run: |
# Read current version from PR branch
CURRENT_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
echo "Current version: $CURRENT_VERSION"
# Checkout main branch to compare
git fetch origin main
git checkout origin/main
# Read version from main branch
MAIN_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
echo "Main version: $MAIN_VERSION"
# Checkout back to PR branch
git checkout -
# Compare versions
if [ "$CURRENT_VERSION" = "$MAIN_VERSION" ]; then
echo "Error: Version has not been bumped from $MAIN_VERSION"
exit 1
fi
# Check if new version already exists as a tag
if git rev-parse "v$CURRENT_VERSION" >/dev/null 2>&1; then
echo "Error: Version v$CURRENT_VERSION already exists as a tag"
exit 1
fi
echo "Version v$CURRENT_VERSION is new and has been bumped from v$MAIN_VERSION"
test:
name: Run tests
runs-on: ubuntu-22.04

steps:
Expand All @@ -31,6 +81,7 @@ jobs:
run: uv run pytest

lint:
name: Check code style
runs-on: ubuntu-22.04

steps:
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/version.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# docker run -v /path/to/credentials.json:/app/credentials.json -e GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json pis -s so

FROM python:3.12.8-alpine3.21
FROM python:3.13.1-alpine3.21
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

ADD . /app
Expand Down
Empty file removed change
Empty file.
28 changes: 15 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[project]
name = "PIS"
version = "24.7.3"
description = "Open Target's Pipeline Input Stage Application"
version = "25.0.0-rc.1"
description = "Open Targets Pipeline Input Stage application"
readme = "README.md"
requires-python = ">=3.12"
requires-python = ">=3.13"
authors = [{ name = "Open Targets core team", email = "devs@opentargets.net" }]
license = { text = "Apache-2.0" }
dependencies = [
Expand All @@ -21,10 +21,12 @@ dependencies = [
[tool.uv]
override-dependencies = ["urllib3>=2.2.0"]

[dependency-groups]
dev = ["ruff==0.8.5", "deptry==0.21.2"]

[project.optional-dependencies]
dev = ["ruff==0.8.4", "deptry==0.21.2"]
test = [
"coverage==7.6.9",
"coverage==7.6.10",
"freezegun==1.5.1",
"pytest==8.3.4",
"pytest-mock==3.14.0",
Expand Down Expand Up @@ -69,6 +71,9 @@ target-version = 'py312'
line-length = 120
preview = true

[tool.ruff.format]
quote-style = 'single'

[tool.ruff.lint]
select = [
'E', # pycodestyle
Expand Down Expand Up @@ -173,14 +178,6 @@ extend-safe-fixes = [
'PERF102', # ^ likewise
]

[tool.ruff.format]
quote-style = 'single'

[tool.ruff.lint.per-file-ignores]
'**/*_test.py' = ['S108', 'S602', 'D']
'**/__init__.py' = ['F401']
'**/tasks/*.py' = ['D102']

[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'
multiline-quotes = 'double'
Expand All @@ -194,6 +191,11 @@ parametrize-names-type = 'tuple'
parametrize-values-type = 'list'
parametrize-values-row-type = 'tuple'

[tool.ruff.lint.per-file-ignores]
'**/*_test.py' = ['S108', 'S602', 'D']
'**/__init__.py' = ['F401']
'**/tasks/*.py' = ['D102']

[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = ["pis.tasks.report", "pis.manifest.task_reporter.report"]
Loading

0 comments on commit 19fcaed

Please sign in to comment.