Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
henrist committed Mar 28, 2024
1 parent 6e2b8d1 commit 248540f
Show file tree
Hide file tree
Showing 10 changed files with 575 additions and 556 deletions.
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ VALID_TOKENS=CHANGEME
GIT_CRYPT_KEY_PATH=CHANGEME

[email protected]:blindern/drift.git

SERVICES_FILE=tests/services.json
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- run: sudo apt-get install -y --no-install-recommends git-crypt

Expand All @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
python-version: '3.12.x'

- name: Initialize Git
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
echo "$GIT_SSH_KEY" >~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
Expand All @@ -45,7 +45,7 @@ jobs:

- run: poetry install

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
Expand All @@ -56,7 +56,7 @@ jobs:

- name: Build container
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.ref == 'refs/heads/main' }}
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
default_language_version:
python: python3.10
python: python3.12
repos:
- repo: https://github.com/PyCQA/autoflake
rev: v1.4
rev: v2.3.1
hooks:
- id: autoflake
args:
- --remove-all-unused-imports
- --in-place
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 24.3.0
hooks:
- id: black
- repo: local
Expand All @@ -26,6 +26,6 @@ repos:
pass_filenames: true
require_serial: true
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11-slim
FROM python:3.12-slim

# renovate: datasource=pypi depName=ansible
ENV ANSIBLE_VERSION=6.7.0
ENV ANSIBLE_VERSION=9.4.0

RUN set -eux; \
apt-get update; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Authorization is based on pre-configured tokens.

## Development

This has been built with Python 3.10.
This has been built with Python 3.12.

You need Poetry. See https://python-poetry.org/docs/#installation

Expand Down
2 changes: 1 addition & 1 deletion deployer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def deploy(service_locks: ServiceLocks, config: Config, deployer: Deployer):
current_app.logger.info("Received data: {}".format(body))

try:
model = DeployRequest.parse_obj(body)
model = DeployRequest.model_validate(body)
except ValidationError as e:
current_app.logger.info(f"Invalid model: {e}")
return text_response("Invalid model", 400)
Expand Down
9 changes: 4 additions & 5 deletions deployer/services.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from pathlib import Path

from pydantic import BaseModel, StrictStr
from pydantic import BaseModel, RootModel, StrictStr


class ServiceModel(BaseModel):
Expand All @@ -13,11 +13,10 @@ class ServiceModel(BaseModel):
mappings: dict[StrictStr, StrictStr]


class ServicesModel(BaseModel):
__root__: dict[StrictStr, ServiceModel]
ServicesModel = RootModel[dict[StrictStr, ServiceModel]]


def load_services_file(path: str) -> dict[str, ServiceModel]:
data = json.loads(Path(path).read_text())
model = ServicesModel.parse_obj(data)
return model.__root__
model = ServicesModel.model_validate(data)
return model.root
1,060 changes: 539 additions & 521 deletions poetry.lock

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ authors = ["Henrik Steen <[email protected]>"]
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
python = "^3.12"

ansible = "6.0"
Flask = "2.2.2"
Flask-Injector = "0.14.0"
gunicorn = "20.1.0"
injector = "0.20.1"
ansible = "9.4.0"
Flask = "3.0.2"
Flask-Injector = "0.15.0"
gunicorn = "21.2.0"
injector = "0.21.0"
NamedAtomicLock = "1.1.3"
pydantic = "1.10.4"
python-dotenv = "0.21.1"
pydantic = "2.6.4"
python-dotenv = "1.0.1"

[tool.poetry.dev-dependencies]
autoflake = "1.7.8"
black = "22.12.0"
flake8 = "4.0.1"
isort = "5.12.0"
mypy = "0.982"
pre-commit = "2.21.0"
pytest = "7.2.1"
autoflake = "2.3.1"
black = "24.3.0"
flake8 = "7.0.0"
isort = "5.13.2"
mypy = "1.9.0"
pre-commit = "3.7.0"
pytest = "8.1.1"

[build-system]
requires = ["poetry_core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ def test_ansible(
},
)

assert mock_push_changes.assert_called_once
mock_push_changes.assert_called_once()

0 comments on commit 248540f

Please sign in to comment.