Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 testing, drop Python 3.8 support, update nginx, and other dependency updates #300

Merged
merged 17 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/github-actions-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Checkout scos-sensor
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install tox-gh
run: python -m pip install tox-gh
- name: Set up test suite
Expand Down
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
exclude: src/static/.+|.+\.pem|.+\.crt|.vscode/.+|LICENSE.md
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
types: [file, python]
Expand All @@ -19,10 +17,10 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
args: ["--py39-plus"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
Expand All @@ -31,12 +29,12 @@ repos:
types: [file, python]
args: ["--profile", "black", "--filter-files", "--gitignore"]
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
types: [file, python]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
rev: v0.42.0
hooks:
- id: markdownlint
types: [file, markdown]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update -q && \
python3-pip python3.10 python3.10-dev usbutils && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED 1
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /src
WORKDIR /src
COPY ./src/requirements.txt /src
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx:1.24-alpine
FROM nginx:1.26-alpine

RUN mkdir -p /var/www/scos-sensor/static
COPY --chown=nginx:nginx ./src/static/ /var/www/scos-sensor/static/
Expand Down
Empty file removed mkdocs.yml
Empty file.
3 changes: 1 addition & 2 deletions src/initialization/action_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import pkgutil
import shutil
from typing import Dict

from django.conf import settings
from scos_actions.actions import action_classes
Expand Down Expand Up @@ -46,7 +45,7 @@ def __new__(cls):
return cls._instance

@property
def actions(self) -> Dict[str, Action]:
def actions(self) -> dict[str, Action]:
"""
Returns all sensor actions configured in the system.
"""
Expand Down
8 changes: 4 additions & 4 deletions src/requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-rrequirements.txt

pre-commit>=3.0, <4.0
pytest-cov>=3.0, <4.0
pytest-django>=4.0, <5.0
ray[default]>=2.5.0
pre-commit>=4.0, <5.0
pytest-cov>=6.0, <7.0
pytest-django>=4.6, <5.0
ray[default]>=2.10.0
tox>=4.0,<5.0

# The following are sub-dependencies for which SCOS Sensor enforces a
Expand Down
17 changes: 11 additions & 6 deletions src/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aiohappyeyeballs==2.4.0
# via
# -r requirements.txt
# aiohttp
aiohttp==3.10.3
aiohttp==3.11.5
# via
# -r requirements-dev.in
# -r requirements.txt
Expand Down Expand Up @@ -63,7 +63,7 @@ colorama==0.4.6
# via tox
colorful==0.5.5
# via ray
coverage[toml]==7.3.2
coverage[toml]==7.6.4
# via pytest-cov
cryptography==43.0.1
# via -r requirements.txt
Expand All @@ -73,7 +73,7 @@ defusedxml==0.7.1
# its-preselector
distlib==0.3.7
# via virtualenv
django==4.2.15
django==4.2.16
# via
# -r requirements.txt
# django-session-timeout
Expand Down Expand Up @@ -218,10 +218,15 @@ pluggy==1.3.0
# via
# pytest
# tox
pre-commit==3.5.0
pre-commit==4.0.1
# via -r requirements-dev.in
prometheus-client==0.19.0
# via ray
propcache==0.2.0
# via
# -r requirements.txt
# aiohttp
# yarl
protobuf==4.25.1
# via
# -r requirements.txt
Expand Down Expand Up @@ -256,7 +261,7 @@ pytest==7.4.3
# via
# pytest-cov
# pytest-django
pytest-cov==3.0.0
pytest-cov==6.0.0
# via -r requirements-dev.in
pytest-django==4.7.0
# via -r requirements-dev.in
Expand Down Expand Up @@ -380,7 +385,7 @@ virtualenv==20.21.0
# pre-commit
# ray
# tox
yarl==1.9.4
yarl==1.17.2
# via
# -r requirements.txt
# aiohttp
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cryptography>=43.0.1
django>=4.2, <5.0
django>=4.2.16, <5.0
djangorestframework>=3.15.2, <4.0
django-session-timeout>=0.1, <1.0
drf-yasg>=1.0, <2.0
Expand All @@ -17,7 +17,7 @@ scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.0.0
# The following are sub-dependencies for which SCOS Sensor enforces a
# higher minimum patch version than the dependencies which require them.
# This is done to ensure the inclusion of specific security patches.
aiohttp>=3.10.2 # CVE-2024-42367
aiohttp>=3.10.11 # CVE-2024-52304
certifi>=2024.7.4 # CVE-2024-39689
idna>=3.7 # CVE-2024-3651
grpcio>=1.53.0 # CVE-2023-32732, CVE-2023-32731, CVE-2023-1428
Expand Down
10 changes: 7 additions & 3 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
aiohappyeyeballs==2.4.0
# via aiohttp
aiohttp==3.10.3
aiohttp==3.11.5
# via -r requirements.in
aiosignal==1.3.1
# via
Expand Down Expand Up @@ -35,7 +35,7 @@ cryptography==43.0.1
# via -r requirements.in
defusedxml==0.7.1
# via its-preselector
django==4.2.15
django==4.2.16
# via
# -r requirements.in
# django-session-timeout
Expand Down Expand Up @@ -110,6 +110,10 @@ packaging==23.2
# gunicorn
# marshmallow
# ray
propcache==0.2.0
# via
# aiohttp
# yarl
protobuf==4.25.1
# via ray
psutil==5.9.6
Expand Down Expand Up @@ -181,7 +185,7 @@ urllib3==2.2.2
# via
# -r requirements.in
# requests
yarl==1.9.4
yarl==1.17.2
# via aiohttp
zipp==3.19.1
# via -r requirements.in
5 changes: 3 additions & 2 deletions src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ deps =
commands = pytest {posargs}

[testenv:cert]
envlist = py39,py310,py311
envlist = py39,py310,py311,py312
setenv =
AUTHENTICATION=CERT
CALLBACK_AUTHENTICATION=CERT
Expand All @@ -42,6 +42,7 @@ omit =

[gh] ; GitHub Actions CI with tox-gh
python =
3.8 = py38
3.9 = py39
3.10 = py310
3.11 = py311
3.12 = py312