Compare commits
5 commits
03666c3334
...
595f93cb61
| Author | SHA1 | Date | |
|---|---|---|---|
| 595f93cb61 | |||
| 3e84b1dfed | |||
| 76f80c5032 | |||
| 9a50b78a16 | |||
| df869b0828 |
5 changed files with 33 additions and 4 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
tests
|
||||||
25
Dockerfile
Normal file
25
Dockerfile
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
FROM ghcr.io/astral-sh/uv:python3.11-bookworm
|
||||||
|
|
||||||
|
ENV UV_CACHE_DIR=/app/.cache/uv
|
||||||
|
|
||||||
|
RUN useradd --shell /bin/bash --uid 1000 transip_client
|
||||||
|
|
||||||
|
USER transip_client
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN mkdir --parents /app/.cache/uv
|
||||||
|
|
||||||
|
# only install dependencies
|
||||||
|
RUN --mount=type=cache,uid=1000,target=/app/.cache/uv \
|
||||||
|
--mount=type=bind,source=uv.lock,target=/app/uv.lock \
|
||||||
|
--mount=type=bind,source=pyproject.toml,target=/app/pyproject.toml \
|
||||||
|
uv sync --frozen --no-install-project
|
||||||
|
|
||||||
|
COPY pyproject.toml uv.lock /app
|
||||||
|
COPY transip_client /app/transip_client
|
||||||
|
|
||||||
|
# install dependencies + project
|
||||||
|
RUN --mount=type=cache,uid=1000,target=/app/.cache/uv uv sync --frozen
|
||||||
|
|
||||||
|
ENTRYPOINT ["uv", "run", "--", "transip-listen"]
|
||||||
|
|
@ -32,6 +32,9 @@ build-backend = 'setuptools.build_meta'
|
||||||
[tool.uv]
|
[tool.uv]
|
||||||
environments = ["sys_platform == 'linux'"]
|
environments = ["sys_platform == 'linux'"]
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
select = ["E4", "E7", "E9", "F", "I"]
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
lines-between-types=1
|
lines-between-types=1
|
||||||
lines-after-imports=2
|
lines-after-imports=2
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from unittest import TestCase, skip
|
|
||||||
from unittest.mock import call, patch, Mock
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from unittest import TestCase
|
||||||
|
from unittest.mock import Mock, call, patch
|
||||||
|
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
from requests import HTTPError
|
from requests import HTTPError
|
||||||
|
|
@ -225,7 +225,7 @@ class RunTestCase(TestCase):
|
||||||
self.assertEqual(result.exit_code, 0)
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
|
||||||
self.mocked_get.assert_called_with(
|
self.mocked_get.assert_called_with(
|
||||||
f"https://other-provider.com/domains/foobar.com/dns",
|
"https://other-provider.com/domains/foobar.com/dns",
|
||||||
headers={"Authorization": "Bearer token"},
|
headers={"Authorization": "Bearer token"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -243,7 +243,7 @@ class RunTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
self.mocked_put.assert_called_with(
|
self.mocked_put.assert_called_with(
|
||||||
f"https://other-provider.com/domains/foobar.com/dns",
|
"https://other-provider.com/domains/foobar.com/dns",
|
||||||
data=expected_json,
|
data=expected_json,
|
||||||
headers={"Authorization": "Bearer token"},
|
headers={"Authorization": "Bearer token"},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue