Skip to content

Commit 08c0c6b

Browse files
committed
Switch to uv and bump version to 0.2.0
1 parent 160f5e2 commit 08c0c6b

14 files changed

Lines changed: 300 additions & 231 deletions

File tree

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ dist/
55
__pycache__/
66
.ruff_cache/
77
.mypy_cache/
8-
wolsocketproxy.conf
8+
wolsocketproxy.conf
9+
*.egg-info/
10+
.vscode/

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ dist/
55
__pycache__/
66
.ruff_cache/
77
.mypy_cache/
8-
wolsocketproxy.conf
8+
wolsocketproxy.conf
9+
*.egg-info/
10+
.vscode/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It can forward TCP(bidirectional) and UDP(send-only) traffic from local machine
66

77
## Requirements
88

9-
Python 3.11+
9+
Python 3.12+
1010

1111
The remote machine must accept and respond to ICMP ping requests.
1212

docker/Dockerfile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
FROM python:3.12.7-alpine3.20 AS builder
1+
FROM ghcr.io/astral-sh/uv:0.11.7-python3.13-trixie AS builder
22

3-
RUN pip install poetry
43
RUN mkdir -p /app
5-
COPY . /app
4+
5+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_NO_DEV=1 UV_PYTHON_DOWNLOADS=0
66

77
WORKDIR /app
8-
RUN poetry install --without dev
98

10-
FROM python:3.12.7-alpine3.20 AS base
9+
RUN --mount=type=cache,target=/root/.cache/uv \
10+
--mount=type=bind,source=uv.lock,target=uv.lock \
11+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
12+
uv sync --locked --no-install-project
13+
14+
COPY . /app
15+
16+
RUN --mount=type=cache,target=/root/.cache/uv \
17+
uv sync --locked
18+
19+
20+
FROM docker.io/python:3.13.13-slim-trixie
21+
22+
RUN apt update && apt -y upgrade && apt install -y curl
1123

1224
COPY --from=builder /app /app
25+
1326
RUN mkdir /app/config
14-
WORKDIR /app
15-
VOLUME /app/config
1627

1728
ENV PATH="/app/.venv/bin:$PATH"
18-
CMD ["python", "-m", "wolsocketproxy", "-c", "/app/config/wolsocketproxy.conf"]
29+
30+
WORKDIR /app
31+
32+
CMD python -m wolsocketproxy \
33+
-c /app/config/wolsocketproxy.conf

poetry.lock

Lines changed: 0 additions & 181 deletions
This file was deleted.

poetry.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pyproject.toml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
[tool.poetry]
1+
[build-system]
2+
requires = ["setuptools>=68"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
26
name = "wolsocketproxy"
3-
version = "0.1.1"
7+
version = "0.2.0"
48
description = "A socket proxy with wake-on-lan feature."
5-
authors = ["Song Fuchang <song.fc@gmail.com>"]
9+
authors = [
10+
{name = "Song Fuchang", email = "song.fc@gmail.com"}
11+
]
612
license = "Apache-2.0"
713
readme = "README.md"
814
classifiers = [
@@ -11,28 +17,25 @@ classifiers = [
1117
"Intended Audience :: System Administrators",
1218
"Topic :: System :: Networking"
1319
]
20+
requires-python = ">=3.12"
21+
dependencies = [
22+
"dataclass-wizard==0.39.1",
23+
"icmplib==3.0.4",
24+
"redfish==3.3.5",
25+
"wakeonlan==3.1.0",
26+
]
1427

15-
[tool.poetry.urls]
16-
Changelog = "https://github.com/notsyncing/wol-socket-proxy/releases"
17-
Issues = "https://github.com/notsyncing/wol-socket-proxy/issues"
18-
19-
[tool.poetry.dependencies]
20-
python = "^3.11"
21-
wakeonlan = "3.1.0"
22-
dataclass-wizard = "0.28.0"
23-
icmplib = "3.0.4"
24-
25-
[tool.poetry.dev-dependencies]
26-
mypy = { version = "*", python = ">=3.11" }
27-
ruff = { version = "*", python = ">=3.11" }
28+
[project.urls]
29+
source = "https://github.com/notsyncing/wolsocketproxy"
30+
issues = "https://github.com/notsyncing/wol-socket-proxy/issues"
2831

29-
[tool.poetry.scripts]
32+
[project.scripts]
3033
wolsocketproxy = "wolsocketproxy:main"
3134

3235
[tool.ruff]
3336
line-length = 120
34-
src = ["wolsocketproxy"]
35-
target-version = "py311"
37+
src = ["src"]
38+
target-version = "py312"
3639
lint.select = ["ALL"]
3740
lint.ignore = [
3841
"COM812",
@@ -52,18 +55,3 @@ lint.ignore = [
5255
"TRY003",
5356
"TRY201",
5457
]
55-
56-
[tool.mypy]
57-
disallow_untyped_defs = true # Functions need to be annotated
58-
warn_unused_ignores = true
59-
ignore_missing_imports = true
60-
61-
62-
[[tool.poetry.source]]
63-
name = "mirrors"
64-
url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
65-
priority = "primary"
66-
67-
[build-system]
68-
requires = ["poetry-core"]
69-
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)