Skip to content

Commit

Permalink
Merge pull request #1802 from gchq/dev/bump-lib/python-package-versio…
Browse files Browse the repository at this point in the history
…ns-python3.9-minimum

Bump python package versions to support new minimum versions
  • Loading branch information
PE39806 authored Jan 31, 2025
2 parents ad90284 + 1b1cd53 commit d67fdee
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 46 deletions.
6 changes: 2 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
.vscode
backend/dist
backend/node_modules
backend/python-docs
backend/docs
frontend/.next
frontend/dist
frontend/node_modules
infrastructure
lib/python/docs/pylint.md
node_modules
.dockerignore
lib/python/docs/_build
backend/coverage
backend/coverage
2 changes: 1 addition & 1 deletion backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist
node_modules
python-docs
docs
9 changes: 7 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# syntax=docker/dockerfile:1
FROM python:3.12.8-bullseye AS sphinx-docs

RUN apt update && apt install -y pandoc
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1

RUN apt-get update && apt-get install -y pandoc && rm -rf /var/lib/apt/lists/*

WORKDIR /app/docs

COPY docs .

RUN pip install bailo -r requirements.txt
RUN pip install --no-cache-dir --upgrade bailo -r requirements.txt

RUN make dirhtml

Expand Down
9 changes: 7 additions & 2 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM python:3.12.8-bullseye AS sphinx-docs

RUN apt update && apt install -y pandoc
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1

RUN apt-get update && apt-get install -y pandoc && rm -rf /var/lib/apt/lists/*

WORKDIR /app/docs

COPY docs .

RUN pip install bailo -r requirements.txt
RUN pip install --no-cache-dir --upgrade bailo -r requirements.txt

RUN make dirhtml

Expand Down
2 changes: 1 addition & 1 deletion backend/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Documentation is rendered with Sphinx and served [here](https://gchq.github.io/B

<!-- prettier-ignore-start -->
> [!IMPORTANT]
> Python 3.9 or higher is required
> Python 3.10 or higher is required
<!-- prettier-ignore-end -->
#### Prerequisites
Expand Down
File renamed without changes
7 changes: 4 additions & 3 deletions backend/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
myst_parser==2.0.0
ipython==8.31.0
myst_parser==4.0.0
nbsphinx==0.9.6
sphinx==7.2.6
sphinx-copybutton
sphinx==8.1.3
sphinx-copybutton==0.5.2
sphinx-rtd-theme==3.0.2
6 changes: 3 additions & 3 deletions lib/modelscan_api/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
stages: [manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
rev: v2.4.1
hooks:
- id: codespell

Expand All @@ -57,7 +57,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
args: [--line-length=120]
args: ['--config', 'lib/python/pyproject.toml']
3 changes: 1 addition & 2 deletions lib/modelscan_api/bailo_modelscan_api/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Configuration settings for FastAPI app.
"""
"""Configuration settings for FastAPI app."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions lib/modelscan_api/bailo_modelscan_api/dependencies.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Common utilities used by the FastAPI app.
"""
"""Common utilities used by the FastAPI app."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions lib/modelscan_api/bailo_modelscan_api/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""FastAPI app.
"""
"""FastAPI app."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions lib/modelscan_api/tests/test_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test for the dependencies.py file.
"""
"""Test for the dependencies.py file."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions lib/modelscan_api/tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Integration tests for working with ModelScan.
"""
"""Integration tests for working with ModelScan."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions lib/modelscan_api/tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test for the main.py file.
"""
"""Test for the main.py file."""

from __future__ import annotations

Expand Down
6 changes: 3 additions & 3 deletions lib/python/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
stages: [manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
rev: v2.4.1
hooks:
- id: codespell

Expand All @@ -56,7 +56,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
args: [--line-length=120]
args: ['--config', 'lib/python/pyproject.toml']
32 changes: 17 additions & 15 deletions lib/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
[build-system]
requires = ["flit_core >=2,<4"]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "bailo"
authors = []
description = "Simplifies interacting with Bailo"
description = "Simplifies interacting with Bailo programmatically"
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.9"
dynamic = ["version"]
dependencies = [
"requests==2.32.3",
"semantic-version==2.10.0",
"requests>=2.22",
"tqdm>=4.66.2"
"tqdm==4.67.1"
]

[project.optional-dependencies]
test = [
"black==24.10.0",
"check-manifest==0.49",
"mlflow>2.11.0",
"black==25.1.0",
"check-manifest==0.50",
"mlflow==2.20.1",
"pre-commit==4.1.0",
"pylint==2.17.4",
"pylint_junit",
"pytest-cov==4.0.0",
"pytest-mock<3.10.1",
"pytest-runner",
"pylint==3.3.4",
"pylint_junit==0.3.5",
"pytest-cov==6.0.0",
"pytest-mock==3.14.0",
"pytest-runner==6.0.1",
"pytest==8.3.4",
"pytest-github-actions-annotate-failures",
"requests_mock==1.11.0",
"shellcheck-py==0.9.0.2"
"pytest-github-actions-annotate-failures==0.3.0",
"requests_mock==1.12.1",
"shellcheck-py==0.10.0.1"
]

[project.urls]
Expand Down

0 comments on commit d67fdee

Please sign in to comment.