wol-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ version: 2
2
+ updates:
3
+ # Python dependencies
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "monday"
9
+ commit-message:
10
+ prefix: "deps"
11
+ labels:
12
+ - "dependencies"
13
+ - "python"
14
+ groups:
15
+ python-dependencies:
16
+ patterns:
17
+ - "*"
18
+
19
+ # GitHub Actions
20
+ - package-ecosystem: "github-actions"
21
+ directory: "/"
22
+ schedule:
23
+ interval: "weekly"
24
+ day: "monday"
25
+ commit-message:
26
+ prefix: "ci"
27
+ labels:
28
+ - "dependencies"
29
+ - "github-actions"
30
+ groups:
31
+ github-actions:
32
+ patterns:
33
+ - "*"
@@ -0,0 +1,111 @@
1
+ name: Build
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ workflow_call:
6
+ outputs:
7
+ artifact-linux:
8
+ description: "Linux binary artifact name"
9
+ value: "wol-linux-amd64"
10
+ artifact-windows:
11
+ description: "Windows binary artifact name"
12
+ value: "wol-windows-amd64.exe"
13
+ artifact-macos:
14
+ description: "macOS binary artifact name"
15
+ value: "wol-macos-amd64"
16
+ artifact-package:
17
+ description: "Python package artifact name"
18
+ value: "python-package"
19
+
20
+ jobs:
21
+ test:
22
+ name: Run tests
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout code
26
+ uses: actions/checkout@v6
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v6
30
+ with:
31
+ python-version: "3.12"
32
+
33
+ - name: Install dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ pip install pytest
37
+ pip install -e .
38
+
39
+ - name: Run tests
40
+ run: pytest -v
41
+
42
+ build-binaries:
43
+ name: Build ${{ matrix.os }} binary
44
+ needs: test
45
+ runs-on: ${{ matrix.os }}
46
+ strategy:
47
+ matrix:
48
+ include:
49
+ - os: ubuntu-latest
50
+ artifact_name: wol-linux-amd64
51
+ binary_path: dist/wol
52
+ - os: windows-latest
53
+ artifact_name: wol-windows-amd64.exe
54
+ binary_path: dist/wol.exe
55
+ - os: macos-latest
56
+ artifact_name: wol-macos-amd64
57
+ binary_path: dist/wol
58
+
59
+ steps:
60
+ - name: Checkout code
61
+ uses: actions/checkout@v6
62
+
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v6
65
+ with:
66
+ python-version: "3.12"
67
+
68
+ - name: Install dependencies
69
+ run: |
70
+ python -m pip install --upgrade pip
71
+ pip install pyinstaller
72
+ pip install .
73
+
74
+ - name: Build binary
75
+ run: pyinstaller --onefile --name wol --clean src/wol_cli/cli.py
76
+
77
+ - name: Upload artifact
78
+ uses: actions/upload-artifact@v7
79
+ with:
80
+ name: ${{ matrix.artifact_name }}
81
+ path: ${{ matrix.binary_path }}
82
+ retention-days: 7
83
+
84
+ build-package:
85
+ name: Build Python package
86
+ needs: test
87
+ runs-on: ubuntu-latest
88
+
89
+ steps:
90
+ - name: Checkout code
91
+ uses: actions/checkout@v6
92
+
93
+ - name: Set up Python
94
+ uses: actions/setup-python@v6
95
+ with:
96
+ python-version: "3.12"
97
+
98
+ - name: Install build dependencies
99
+ run: |
100
+ python -m pip install --upgrade pip
101
+ pip install build
102
+
103
+ - name: Build package
104
+ run: python -m build
105
+
106
+ - name: Upload artifact
107
+ uses: actions/upload-artifact@v7
108
+ with:
109
+ name: python-package
110
+ path: dist/*
111
+ retention-days: 7
@@ -0,0 +1,78 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, windows-latest, macos-latest]
17
+ python-version: ['3.10', '3.11', '3.12', '3.13']
18
+
19
+ steps:
20
+ - name: Checkout code
21
+ uses: actions/checkout@v6
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v6
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install pytest
32
+ pip install -e .
33
+
34
+ - name: Run tests
35
+ run: pytest -v
36
+
37
+ lint:
38
+ name: Lint
39
+ runs-on: ubuntu-latest
40
+
41
+ steps:
42
+ - name: Checkout code
43
+ uses: actions/checkout@v6
44
+
45
+ - name: Set up Python
46
+ uses: actions/setup-python@v6
47
+ with:
48
+ python-version: '3.12'
49
+
50
+ - name: Install dependencies
51
+ run: |
52
+ python -m pip install --upgrade pip
53
+ pip install ruff
54
+
55
+ - name: Run ruff
56
+ run: ruff check src/ tests/
57
+
58
+ type-check:
59
+ name: Type Check
60
+ runs-on: ubuntu-latest
61
+
62
+ steps:
63
+ - name: Checkout code
64
+ uses: actions/checkout@v6
65
+
66
+ - name: Set up Python
67
+ uses: actions/setup-python@v6
68
+ with:
69
+ python-version: '3.12'
70
+
71
+ - name: Install dependencies
72
+ run: |
73
+ python -m pip install --upgrade pip
74
+ pip install mypy
75
+ pip install -e .
76
+
77
+ - name: Run mypy
78
+ run: mypy src/
@@ -0,0 +1,109 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ test_pypi:
9
+ description: "Publish to TestPyPI instead of PyPI"
10
+ required: false
11
+ default: false
12
+ type: boolean
13
+
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+
18
+ jobs:
19
+ build:
20
+ name: Build package
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v6
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.12"
31
+
32
+ - name: Install build dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install build
36
+
37
+ - name: Build package
38
+ run: python -m build
39
+
40
+ - name: Upload artifact
41
+ uses: actions/upload-artifact@v7
42
+ with:
43
+ name: python-package
44
+ path: dist/*
45
+
46
+ test:
47
+ name: Test package
48
+ runs-on: ubuntu-latest
49
+ needs: build
50
+
51
+ steps:
52
+ - name: Download artifact
53
+ uses: actions/download-artifact@v8
54
+ with:
55
+ name: python-package
56
+ path: dist/
57
+
58
+ - name: Set up Python
59
+ uses: actions/setup-python@v6
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Install package from wheel
64
+ run: |
65
+ pip install dist/*.whl
66
+ wol --version
67
+
68
+ publish-testpypi:
69
+ name: Publish to TestPyPI
70
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.test_pypi }}
71
+ runs-on: ubuntu-latest
72
+ needs: test
73
+ environment:
74
+ name: testpypi
75
+ url: https://test.pypi.org/p/wol-cli
76
+
77
+ steps:
78
+ - name: Download artifact
79
+ uses: actions/download-artifact@v8
80
+ with:
81
+ name: python-package
82
+ path: dist/
83
+
84
+ - name: Publish to TestPyPI
85
+ uses: pypa/gh-action-pypi-publish@release/v1
86
+ with:
87
+ repository-url: https://test.pypi.org/legacy/
88
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
89
+
90
+ publish-pypi:
91
+ name: Publish to PyPI
92
+ if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.test_pypi) }}
93
+ runs-on: ubuntu-latest
94
+ needs: test
95
+ environment:
96
+ name: pypi
97
+ url: https://pypi.org/p/wol-cli
98
+
99
+ steps:
100
+ - name: Download artifact
101
+ uses: actions/download-artifact@v8
102
+ with:
103
+ name: python-package
104
+ path: dist/
105
+
106
+ - name: Publish to PyPI
107
+ uses: pypa/gh-action-pypi-publish@release/v1
108
+ with:
109
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,62 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ build:
13
+ name: Build artifacts
14
+ uses: ./.github/workflows/build.yml
15
+
16
+ release:
17
+ name: Create GitHub Release
18
+ runs-on: ubuntu-latest
19
+ needs: build
20
+
21
+ steps:
22
+ - name: Download Linux binary
23
+ uses: actions/download-artifact@v8
24
+ with:
25
+ name: wol-linux-amd64
26
+ path: artifacts/linux/
27
+
28
+ - name: Download Windows binary
29
+ uses: actions/download-artifact@v8
30
+ with:
31
+ name: wol-windows-amd64.exe
32
+ path: artifacts/windows/
33
+
34
+ - name: Download macOS binary
35
+ uses: actions/download-artifact@v8
36
+ with:
37
+ name: wol-macos-amd64
38
+ path: artifacts/macos/
39
+
40
+ - name: Download Python package
41
+ uses: actions/download-artifact@v8
42
+ with:
43
+ name: python-package
44
+ path: artifacts/package/
45
+
46
+ - name: Prepare release assets
47
+ run: |
48
+ mv artifacts/linux/wol artifacts/wol-linux-amd64
49
+ mv artifacts/windows/wol.exe artifacts/wol-windows-amd64.exe
50
+ mv artifacts/macos/wol artifacts/wol-macos-amd64
51
+ chmod +x artifacts/wol-linux-amd64 artifacts/wol-macos-amd64
52
+
53
+ - name: Create Release
54
+ uses: softprops/action-gh-release@v3
55
+ with:
56
+ generate_release_notes: true
57
+ files: |
58
+ artifacts/wol-linux-amd64
59
+ artifacts/wol-windows-amd64.exe
60
+ artifacts/wol-macos-amd64
61
+ artifacts/package/*.whl
62
+ artifacts/package/*.tar.gz
@@ -0,0 +1,35 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.egg
11
+ .eggs/
12
+
13
+ # Virtual environments
14
+ .venv/
15
+ venv/
16
+ ENV/
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+ *.swp
22
+ *.swo
23
+
24
+ # Testing
25
+ .pytest_cache/
26
+ .coverage
27
+ htmlcov/
28
+ .tox/
29
+ .nox/
30
+
31
+ # mypy
32
+ .mypy_cache/
33
+
34
+ # ruff
35
+ .ruff_cache/
wol_cli-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
wol_cli-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,183 @@
1
+ Metadata-Version: 2.4
2
+ Name: wol-cli
3
+ Version: 0.1.0
4
+ Summary: Wake-on-LAN magic packet sender with VLAN support
5
+ Project-URL: Homepage, https://github.com/yourusername/wol-cli-tool
6
+ Project-URL: Repository, https://github.com/yourusername/wol-cli-tool
7
+ Project-URL: Issues, https://github.com/yourusername/wol-cli-tool/issues
8
+ Project-URL: Changelog, https://github.com/yourusername/wol-cli-tool/releases
9
+ Author-email: Your Name <you@example.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: magic-packet,network,vlan,wake-on-lan,wol
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: System :: Networking
24
+ Classifier: Topic :: Utilities
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.10
27
+ Provides-Extra: dev
28
+ Requires-Dist: build>=1.4.3; extra == 'dev'
29
+ Requires-Dist: mypy>=1.20.0; extra == 'dev'
30
+ Requires-Dist: pyinstaller>=6.19.0; extra == 'dev'
31
+ Requires-Dist: pytest>=9.0.3; extra == 'dev'
32
+ Requires-Dist: ruff>=0.15.10; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # wol-cli
36
+
37
+ [![CI](https://github.com/yourusername/wol-cli-tool/actions/workflows/ci.yml/badge.svg)](https://github.com/yourusername/wol-cli-tool/actions/workflows/ci.yml)
38
+ [![PyPI version](https://badge.fury.io/py/wol-cli.svg)](https://badge.fury.io/py/wol-cli)
39
+ [![Python versions](https://img.shields.io/pypi/pyversions/wol-cli.svg)](https://pypi.org/project/wol-cli/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
41
+
42
+ A Wake-on-LAN magic packet sender with VLAN support.
43
+
44
+ ## Features
45
+
46
+ - **UDP Broadcast**: Standard Wake-on-LAN via UDP broadcast
47
+ - **Directed Broadcast**: Auto-compute broadcast address from CIDR notation
48
+ - **802.1Q VLAN Support**: Send tagged Ethernet frames directly (Linux only, requires root)
49
+
50
+ ## Installation
51
+
52
+ ### From PyPI
53
+
54
+ ```bash
55
+ pip install wol-cli
56
+ ```
57
+
58
+ ### From GitHub Releases (standalone binary)
59
+
60
+ Download the appropriate binary for your platform from the [Releases](https://github.com/yourusername/wol-cli-tool/releases) page:
61
+
62
+ - `wol-linux-amd64` - Linux x86_64
63
+ - `wol-windows-amd64.exe` - Windows x86_64
64
+ - `wol-macos-amd64` - macOS x86_64
65
+
66
+ ### From source
67
+
68
+ ```bash
69
+ pip install .
70
+ ```
71
+
72
+ For development:
73
+
74
+ ```bash
75
+ pip install -e ".[dev]"
76
+ ```
77
+
78
+ ## Usage
79
+
80
+ ### Plain UDP Broadcast (same subnet)
81
+
82
+ ```bash
83
+ wol AA:BB:CC:DD:EE:FF
84
+ ```
85
+
86
+ ### Directed Broadcast
87
+
88
+ Auto-computes the broadcast address from a CIDR network:
89
+
90
+ ```bash
91
+ wol AA:BB:CC:DD:EE:FF --network 192.168.10.0/24
92
+ ```
93
+
94
+ ### 802.1Q Tagged Frame (Linux only)
95
+
96
+ Send a VLAN-tagged raw Ethernet frame (requires root):
97
+
98
+ ```bash
99
+ sudo wol AA:BB:CC:DD:EE:FF --vlan-id 10 --interface eth0
100
+ ```
101
+
102
+ ### Options
103
+
104
+ | Option | Description |
105
+ |--------|-------------|
106
+ | `--ip IP` | Explicit broadcast/unicast IP (default: 255.255.255.255) |
107
+ | `--port PORT` | UDP port (default: 9) |
108
+ | `--network CIDR` | Subnet for directed broadcast (e.g., 192.168.10.0/24) |
109
+ | `--vlan-id ID` | 802.1Q VLAN ID (1-4094) |
110
+ | `--interface IFACE` | Network interface for 802.1Q mode |
111
+ | `--version` | Show version |
112
+
113
+ ## Library Usage
114
+
115
+ ```python
116
+ from wol_cli import send_udp, send_dot1q, build_magic_packet
117
+
118
+ # Send via UDP broadcast
119
+ send_udp("AA:BB:CC:DD:EE:FF")
120
+
121
+ # Send via directed broadcast
122
+ send_udp("AA:BB:CC:DD:EE:FF", ip="192.168.10.255")
123
+
124
+ # Build a magic packet manually
125
+ packet = build_magic_packet("AA:BB:CC:DD:EE:FF")
126
+ ```
127
+
128
+ ## Development
129
+
130
+ Install development dependencies:
131
+
132
+ ```bash
133
+ pip install -e ".[dev]"
134
+ ```
135
+
136
+ Run tests:
137
+
138
+ ```bash
139
+ pytest -v
140
+ ```
141
+
142
+ Run linter:
143
+
144
+ ```bash
145
+ ruff check src/ tests/
146
+ ```
147
+
148
+ Run type checker:
149
+
150
+ ```bash
151
+ mypy src/
152
+ ```
153
+
154
+ ## Releasing
155
+
156
+ Releases are automated via GitHub Actions. To create a new release:
157
+
158
+ 1. Update the version in `pyproject.toml` and `src/wol_cli/__init__.py`
159
+ 2. Commit the changes
160
+ 3. Create and push a tag:
161
+ ```bash
162
+ git tag v0.1.0
163
+ git push origin v0.1.0
164
+ ```
165
+
166
+ The workflow will automatically:
167
+ - Run tests
168
+ - Build binaries for Linux, Windows, and macOS
169
+ - Build the Python package
170
+ - Publish to PyPI
171
+ - Create a GitHub release with all artifacts
172
+
173
+ ### PyPI Setup
174
+
175
+ To enable PyPI publishing, add a `PYPI_API_TOKEN` secret to your repository:
176
+
177
+ 1. Go to [PyPI Account Settings](https://pypi.org/manage/account/token/)
178
+ 2. Create an API token
179
+ 3. Add it as a repository secret named `PYPI_API_TOKEN`
180
+
181
+ ## License
182
+
183
+ MIT