tizen-tool 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.
- tizen_tool-0.1.0/.gitignore +12 -0
- tizen_tool-0.1.0/LICENSE +21 -0
- tizen_tool-0.1.0/PKG-INFO +240 -0
- tizen_tool-0.1.0/README.md +206 -0
- tizen_tool-0.1.0/pyproject.toml +98 -0
- tizen_tool-0.1.0/src/tizen_tool/__init__.py +1 -0
- tizen_tool-0.1.0/src/tizen_tool/__main__.py +4 -0
- tizen_tool-0.1.0/src/tizen_tool/bundled_resources.py +28 -0
- tizen_tool-0.1.0/src/tizen_tool/cli.py +164 -0
- tizen_tool-0.1.0/src/tizen_tool/docker_ops.py +253 -0
- tizen_tool-0.1.0/src/tizen_tool/errors.py +2 -0
- tizen_tool-0.1.0/src/tizen_tool/paths.py +20 -0
- tizen_tool-0.1.0/src/tizen_tool/project_files.py +68 -0
- tizen_tool-0.1.0/src/tizen_tool/resources/Dockerfile +38 -0
- tizen_tool-0.1.0/src/tizen_tool/resources/__init__.py +1 -0
- tizen_tool-0.1.0/src/tizen_tool/resources/install_tizen_studio.py +159 -0
- tizen_tool-0.1.0/src/tizen_tool/runtime.py +36 -0
- tizen_tool-0.1.0/src/tizen_tool/settings.py +192 -0
tizen_tool-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruslan Khasanshin
|
|
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.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tizen-tool
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: tizen-tool is a small CLI for building, re-signing, and installing Tizen web packages through a Dockerized Tizen Studio environment
|
|
5
|
+
Project-URL: Homepage, https://github.com/hu553in/tizen-tool
|
|
6
|
+
Project-URL: Repository, https://github.com/hu553in/tizen-tool
|
|
7
|
+
Project-URL: Issues, https://github.com/hu553in/tizen-tool/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/hu553in/tizen-tool/releases
|
|
9
|
+
Author: Ruslan Khasanshin
|
|
10
|
+
Maintainer: Ruslan Khasanshin
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: automation,cli,deployment,developer-tools,docker,packaging,samsung-tv,signing,tizen,tizen-studio,tizen-tv,web-app,wgt
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Topic :: Software Development
|
|
26
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
27
|
+
Classifier: Topic :: Utilities
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: defusedxml==0.7.1
|
|
30
|
+
Requires-Dist: pathspec==1.0.4
|
|
31
|
+
Requires-Dist: pydantic-settings==2.13.1
|
|
32
|
+
Requires-Dist: typer==0.24.1
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# Tizen tool
|
|
36
|
+
|
|
37
|
+
[](https://github.com/hu553in/tizen-tool/actions/workflows/ci.yml)
|
|
38
|
+
|
|
39
|
+
- [License](./LICENSE)
|
|
40
|
+
- [How to contribute](./CONTRIBUTING.md)
|
|
41
|
+
- [Code of conduct](./CODE_OF_CONDUCT.md)
|
|
42
|
+
|
|
43
|
+
`tizen-tool` is a small CLI for building, re-signing, and installing Tizen web packages
|
|
44
|
+
through a Dockerized Tizen Studio environment.
|
|
45
|
+
|
|
46
|
+
It provides:
|
|
47
|
+
|
|
48
|
+
- a reproducible Tizen Studio setup inside Docker
|
|
49
|
+
- `build`, `resign`, and `install` commands
|
|
50
|
+
- strict configuration loading from CLI arguments and `.env`
|
|
51
|
+
- installer checksum verification
|
|
52
|
+
- Docker image reuse keyed by the tool version, required packages, and bundled Docker resources
|
|
53
|
+
|
|
54
|
+
The project is intentionally small. It is designed to remain predictable, easy to audit,
|
|
55
|
+
and simple to run from a single working directory.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## What it does
|
|
60
|
+
|
|
61
|
+
- Builds a `.wgt` package from a Tizen web app directory
|
|
62
|
+
- Re-signs an existing `.wgt` package with a configured profile
|
|
63
|
+
- Installs a `.wgt` package on a TV over `sdb`
|
|
64
|
+
- Builds and reuses a local Docker image with Tizen Studio and the required Tizen packages
|
|
65
|
+
|
|
66
|
+
Typical workflow:
|
|
67
|
+
|
|
68
|
+
1. Configure `.env`
|
|
69
|
+
2. Build or re-sign a package
|
|
70
|
+
3. Install it on a TV
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Requirements
|
|
75
|
+
|
|
76
|
+
- Python 3.10 or newer
|
|
77
|
+
- Docker with Linux image support
|
|
78
|
+
- [uv](https://docs.astral.sh/uv/)
|
|
79
|
+
- a valid Tizen signing profile directory containing `profiles.xml`
|
|
80
|
+
|
|
81
|
+
The default local development version is Python 3.14, as defined in
|
|
82
|
+
[`.python-version`](./.python-version). CI also runs on Python 3.14.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Installation
|
|
87
|
+
|
|
88
|
+
### Install as a tool
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv tool install tizen-tool
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You can also use `pipx`:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pipx install tizen-tool
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Local development
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
make install_deps
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
The tool reads `.env` from the current working directory. CLI arguments override `.env` values.
|
|
111
|
+
|
|
112
|
+
| Name | Required | Description |
|
|
113
|
+
| ------------------------------------------------------------------ | ---------------- | ---------------------------------------------------------------------------------------------------- |
|
|
114
|
+
| `TIZEN_VERSION` | Yes | Tizen Studio version used to resolve the installer URL. |
|
|
115
|
+
| `REQUIRED_PACKAGES` | Yes | JSON array of Tizen package IDs installed into the Docker image. |
|
|
116
|
+
| `TIZEN_INSTALLER_SHA256` | Yes | Expected SHA-256 checksum for the installer binary. |
|
|
117
|
+
| `PROFILES_DIR` | Build / resign | Directory containing `profiles.xml`. Relative paths are resolved from the current working directory. |
|
|
118
|
+
| `PROFILE` | Build / resign | Signing profile name from `profiles.xml`. |
|
|
119
|
+
| `TV_IP` | Install | TV address or serial. Accepted forms: `host`, `host:port`, `IPv4`, or `[IPv6]:port`. |
|
|
120
|
+
| `BUILD_SRC_DIR` or `SRC_DIR` | Build fallback | Source directory for the app when not passed on the CLI. |
|
|
121
|
+
| `BUILDIGNORE_FILE` or `BUILD_IGNORE_FILE` | Build fallback | Optional gitignore-style exclude file for the build copy step. |
|
|
122
|
+
| `BUILD_REBUILD`, `INSTALL_REBUILD`, `RESIGN_REBUILD`, or `REBUILD` | No | Forces Docker image rebuilding for the corresponding command. |
|
|
123
|
+
| `INSTALL_PACKAGE_FILE` or `PACKAGE_FILE` | Install fallback | `.wgt` package path used when not passed on the CLI. |
|
|
124
|
+
| `RESIGN_PACKAGE_FILE` or `PACKAGE_FILE` | Resign fallback | `.wgt` package path used when not passed on the CLI. |
|
|
125
|
+
|
|
126
|
+
See [`.env.example`](./.env.example) for a complete example.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Commands
|
|
131
|
+
|
|
132
|
+
Build a package:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
tizen-tool build /path/to/app
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Build with explicit package overrides:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
tizen-tool build /path/to/app \
|
|
142
|
+
--required-package TV-Samsung_Public_6.0 \
|
|
143
|
+
--required-package TV-Samsung_Wearable_6.0
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Re-sign a package:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
tizen-tool resign /path/to/app.wgt
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Install a package on the configured TV:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
tizen-tool install /path/to/app.wgt
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Override the TV target from the CLI:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
tizen-tool install /path/to/app.wgt --tv-ip 192.168.1.100
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Force rebuilding the Docker image:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
tizen-tool build /path/to/app --rebuild
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
You can also run the package directly from a checkout:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
uv run tizen-tool --help
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Outputs and runtime behavior
|
|
179
|
+
|
|
180
|
+
- `build` copies the app into a temporary directory, runs `tizen build-web`,
|
|
181
|
+
and writes the final `.wgt` to `dist/` inside the source directory
|
|
182
|
+
- `resign` writes the new package to `resigned/` next to the source package
|
|
183
|
+
- `install` mounts the package directory read-only and installs by package name over `sdb`
|
|
184
|
+
- temporary files are stored under `.tizen-tool/tmp/` in the current working directory
|
|
185
|
+
- the Docker image is reused unless its identifying labels no longer match the requested configuration
|
|
186
|
+
|
|
187
|
+
During image build, the installer helper tries both known Tizen installer URL patterns
|
|
188
|
+
and stops at the first successful match.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Development
|
|
193
|
+
|
|
194
|
+
Useful commands:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
make install_deps
|
|
198
|
+
make lint
|
|
199
|
+
make check_types
|
|
200
|
+
make check
|
|
201
|
+
make check_deps_updates
|
|
202
|
+
make check_deps_vuln
|
|
203
|
+
make build
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The development toolchain uses:
|
|
207
|
+
|
|
208
|
+
- `ruff`
|
|
209
|
+
- `ty`
|
|
210
|
+
- `prek`
|
|
211
|
+
- `pysentry-rs`
|
|
212
|
+
- `bandit`
|
|
213
|
+
|
|
214
|
+
Run the full local check suite:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
make check
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Release
|
|
223
|
+
|
|
224
|
+
Create a release from the `main` branch with a clean working tree:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
make release V=0.1.0
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
The `release` target:
|
|
231
|
+
|
|
232
|
+
- installs dependencies
|
|
233
|
+
- runs the local checks
|
|
234
|
+
- builds distributions
|
|
235
|
+
- updates the version if `V` differs from the current project version
|
|
236
|
+
- commits and pushes the version bump when needed
|
|
237
|
+
- creates and pushes the annotated tag `v<V>`
|
|
238
|
+
|
|
239
|
+
GitHub Actions publishes tagged releases to PyPI from
|
|
240
|
+
[`.github/workflows/ci.yml`](./.github/workflows/ci.yml).
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Tizen tool
|
|
2
|
+
|
|
3
|
+
[](https://github.com/hu553in/tizen-tool/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
- [License](./LICENSE)
|
|
6
|
+
- [How to contribute](./CONTRIBUTING.md)
|
|
7
|
+
- [Code of conduct](./CODE_OF_CONDUCT.md)
|
|
8
|
+
|
|
9
|
+
`tizen-tool` is a small CLI for building, re-signing, and installing Tizen web packages
|
|
10
|
+
through a Dockerized Tizen Studio environment.
|
|
11
|
+
|
|
12
|
+
It provides:
|
|
13
|
+
|
|
14
|
+
- a reproducible Tizen Studio setup inside Docker
|
|
15
|
+
- `build`, `resign`, and `install` commands
|
|
16
|
+
- strict configuration loading from CLI arguments and `.env`
|
|
17
|
+
- installer checksum verification
|
|
18
|
+
- Docker image reuse keyed by the tool version, required packages, and bundled Docker resources
|
|
19
|
+
|
|
20
|
+
The project is intentionally small. It is designed to remain predictable, easy to audit,
|
|
21
|
+
and simple to run from a single working directory.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What it does
|
|
26
|
+
|
|
27
|
+
- Builds a `.wgt` package from a Tizen web app directory
|
|
28
|
+
- Re-signs an existing `.wgt` package with a configured profile
|
|
29
|
+
- Installs a `.wgt` package on a TV over `sdb`
|
|
30
|
+
- Builds and reuses a local Docker image with Tizen Studio and the required Tizen packages
|
|
31
|
+
|
|
32
|
+
Typical workflow:
|
|
33
|
+
|
|
34
|
+
1. Configure `.env`
|
|
35
|
+
2. Build or re-sign a package
|
|
36
|
+
3. Install it on a TV
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Python 3.10 or newer
|
|
43
|
+
- Docker with Linux image support
|
|
44
|
+
- [uv](https://docs.astral.sh/uv/)
|
|
45
|
+
- a valid Tizen signing profile directory containing `profiles.xml`
|
|
46
|
+
|
|
47
|
+
The default local development version is Python 3.14, as defined in
|
|
48
|
+
[`.python-version`](./.python-version). CI also runs on Python 3.14.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### Install as a tool
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
uv tool install tizen-tool
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You can also use `pipx`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pipx install tizen-tool
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Local development
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
make install_deps
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Configuration
|
|
75
|
+
|
|
76
|
+
The tool reads `.env` from the current working directory. CLI arguments override `.env` values.
|
|
77
|
+
|
|
78
|
+
| Name | Required | Description |
|
|
79
|
+
| ------------------------------------------------------------------ | ---------------- | ---------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `TIZEN_VERSION` | Yes | Tizen Studio version used to resolve the installer URL. |
|
|
81
|
+
| `REQUIRED_PACKAGES` | Yes | JSON array of Tizen package IDs installed into the Docker image. |
|
|
82
|
+
| `TIZEN_INSTALLER_SHA256` | Yes | Expected SHA-256 checksum for the installer binary. |
|
|
83
|
+
| `PROFILES_DIR` | Build / resign | Directory containing `profiles.xml`. Relative paths are resolved from the current working directory. |
|
|
84
|
+
| `PROFILE` | Build / resign | Signing profile name from `profiles.xml`. |
|
|
85
|
+
| `TV_IP` | Install | TV address or serial. Accepted forms: `host`, `host:port`, `IPv4`, or `[IPv6]:port`. |
|
|
86
|
+
| `BUILD_SRC_DIR` or `SRC_DIR` | Build fallback | Source directory for the app when not passed on the CLI. |
|
|
87
|
+
| `BUILDIGNORE_FILE` or `BUILD_IGNORE_FILE` | Build fallback | Optional gitignore-style exclude file for the build copy step. |
|
|
88
|
+
| `BUILD_REBUILD`, `INSTALL_REBUILD`, `RESIGN_REBUILD`, or `REBUILD` | No | Forces Docker image rebuilding for the corresponding command. |
|
|
89
|
+
| `INSTALL_PACKAGE_FILE` or `PACKAGE_FILE` | Install fallback | `.wgt` package path used when not passed on the CLI. |
|
|
90
|
+
| `RESIGN_PACKAGE_FILE` or `PACKAGE_FILE` | Resign fallback | `.wgt` package path used when not passed on the CLI. |
|
|
91
|
+
|
|
92
|
+
See [`.env.example`](./.env.example) for a complete example.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Commands
|
|
97
|
+
|
|
98
|
+
Build a package:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
tizen-tool build /path/to/app
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Build with explicit package overrides:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
tizen-tool build /path/to/app \
|
|
108
|
+
--required-package TV-Samsung_Public_6.0 \
|
|
109
|
+
--required-package TV-Samsung_Wearable_6.0
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Re-sign a package:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
tizen-tool resign /path/to/app.wgt
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Install a package on the configured TV:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
tizen-tool install /path/to/app.wgt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Override the TV target from the CLI:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
tizen-tool install /path/to/app.wgt --tv-ip 192.168.1.100
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Force rebuilding the Docker image:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
tizen-tool build /path/to/app --rebuild
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
You can also run the package directly from a checkout:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
uv run tizen-tool --help
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Outputs and runtime behavior
|
|
145
|
+
|
|
146
|
+
- `build` copies the app into a temporary directory, runs `tizen build-web`,
|
|
147
|
+
and writes the final `.wgt` to `dist/` inside the source directory
|
|
148
|
+
- `resign` writes the new package to `resigned/` next to the source package
|
|
149
|
+
- `install` mounts the package directory read-only and installs by package name over `sdb`
|
|
150
|
+
- temporary files are stored under `.tizen-tool/tmp/` in the current working directory
|
|
151
|
+
- the Docker image is reused unless its identifying labels no longer match the requested configuration
|
|
152
|
+
|
|
153
|
+
During image build, the installer helper tries both known Tizen installer URL patterns
|
|
154
|
+
and stops at the first successful match.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Development
|
|
159
|
+
|
|
160
|
+
Useful commands:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
make install_deps
|
|
164
|
+
make lint
|
|
165
|
+
make check_types
|
|
166
|
+
make check
|
|
167
|
+
make check_deps_updates
|
|
168
|
+
make check_deps_vuln
|
|
169
|
+
make build
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The development toolchain uses:
|
|
173
|
+
|
|
174
|
+
- `ruff`
|
|
175
|
+
- `ty`
|
|
176
|
+
- `prek`
|
|
177
|
+
- `pysentry-rs`
|
|
178
|
+
- `bandit`
|
|
179
|
+
|
|
180
|
+
Run the full local check suite:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
make check
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Release
|
|
189
|
+
|
|
190
|
+
Create a release from the `main` branch with a clean working tree:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
make release V=0.1.0
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The `release` target:
|
|
197
|
+
|
|
198
|
+
- installs dependencies
|
|
199
|
+
- runs the local checks
|
|
200
|
+
- builds distributions
|
|
201
|
+
- updates the version if `V` differs from the current project version
|
|
202
|
+
- commits and pushes the version bump when needed
|
|
203
|
+
- creates and pushes the annotated tag `v<V>`
|
|
204
|
+
|
|
205
|
+
GitHub Actions publishes tagged releases to PyPI from
|
|
206
|
+
[`.github/workflows/ci.yml`](./.github/workflows/ci.yml).
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tizen-tool"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "tizen-tool is a small CLI for building, re-signing, and installing Tizen web packages through a Dockerized Tizen Studio environment"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "Ruslan Khasanshin" }]
|
|
10
|
+
maintainers = [{ name = "Ruslan Khasanshin" }]
|
|
11
|
+
|
|
12
|
+
keywords = [
|
|
13
|
+
"tizen",
|
|
14
|
+
"tizen-studio",
|
|
15
|
+
"tizen-tv",
|
|
16
|
+
"samsung-tv",
|
|
17
|
+
"cli",
|
|
18
|
+
"docker",
|
|
19
|
+
"wgt",
|
|
20
|
+
"web-app",
|
|
21
|
+
"packaging",
|
|
22
|
+
"signing",
|
|
23
|
+
"deployment",
|
|
24
|
+
"developer-tools",
|
|
25
|
+
"automation",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
classifiers = [
|
|
29
|
+
"Development Status :: 4 - Beta",
|
|
30
|
+
"Environment :: Console",
|
|
31
|
+
"Intended Audience :: Developers",
|
|
32
|
+
"License :: OSI Approved :: MIT License",
|
|
33
|
+
"Operating System :: OS Independent",
|
|
34
|
+
"Programming Language :: Python :: 3",
|
|
35
|
+
"Programming Language :: Python :: 3.10",
|
|
36
|
+
"Programming Language :: Python :: 3.11",
|
|
37
|
+
"Programming Language :: Python :: 3.12",
|
|
38
|
+
"Programming Language :: Python :: 3.13",
|
|
39
|
+
"Programming Language :: Python :: 3.14",
|
|
40
|
+
"Topic :: Software Development",
|
|
41
|
+
"Topic :: Software Development :: Build Tools",
|
|
42
|
+
"Topic :: Utilities",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
dependencies = [
|
|
46
|
+
"defusedxml==0.7.1",
|
|
47
|
+
"pathspec==1.0.4",
|
|
48
|
+
"pydantic-settings==2.13.1",
|
|
49
|
+
"typer==0.24.1",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.scripts]
|
|
53
|
+
tizen-tool = "tizen_tool.cli:main"
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
Homepage = "https://github.com/hu553in/tizen-tool"
|
|
57
|
+
Repository = "https://github.com/hu553in/tizen-tool"
|
|
58
|
+
Issues = "https://github.com/hu553in/tizen-tool/issues"
|
|
59
|
+
Changelog = "https://github.com/hu553in/tizen-tool/releases"
|
|
60
|
+
|
|
61
|
+
[build-system]
|
|
62
|
+
requires = ["hatchling"]
|
|
63
|
+
build-backend = "hatchling.build"
|
|
64
|
+
|
|
65
|
+
[tool.hatch.build.targets.wheel]
|
|
66
|
+
packages = ["src/tizen_tool"]
|
|
67
|
+
|
|
68
|
+
[tool.hatch.build.targets.sdist]
|
|
69
|
+
include = ["/src/tizen_tool", "/README.md", "/LICENSE", "/pyproject.toml"]
|
|
70
|
+
|
|
71
|
+
[dependency-groups]
|
|
72
|
+
dev = [
|
|
73
|
+
"bandit==1.9.4",
|
|
74
|
+
"prek==0.3.6",
|
|
75
|
+
"pysentry-rs==0.4.3",
|
|
76
|
+
"ruff==0.15.7",
|
|
77
|
+
"ty==0.0.24",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[tool.ruff]
|
|
81
|
+
target-version = "py310"
|
|
82
|
+
line-length = 100
|
|
83
|
+
extend-exclude = [".venv"]
|
|
84
|
+
|
|
85
|
+
[tool.ruff.lint]
|
|
86
|
+
select = ["E", "F", "I", "UP", "B", "SIM", "ARG", "PL", "RUF"]
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint.isort]
|
|
89
|
+
split-on-trailing-comma = false
|
|
90
|
+
|
|
91
|
+
[tool.ruff.format]
|
|
92
|
+
quote-style = "double"
|
|
93
|
+
indent-style = "space"
|
|
94
|
+
skip-magic-trailing-comma = true
|
|
95
|
+
|
|
96
|
+
[tool.pysentry.defaults]
|
|
97
|
+
sources = "pypa,pypi,osv"
|
|
98
|
+
fail_on = "low"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Tizen tool."""
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
from importlib.resources import files
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
RESOURCE_PACKAGE = "tizen_tool.resources"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resource_bytes(relative_path: str) -> bytes:
|
|
11
|
+
return files(RESOURCE_PACKAGE).joinpath(relative_path).read_bytes()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def build_context_fingerprint() -> str:
|
|
15
|
+
hasher = hashlib.sha256()
|
|
16
|
+
for relative_path in ("Dockerfile", "install_tizen_studio.py"):
|
|
17
|
+
content = resource_bytes(relative_path)
|
|
18
|
+
hasher.update(relative_path.encode("utf-8"))
|
|
19
|
+
hasher.update(b"\0")
|
|
20
|
+
hasher.update(content)
|
|
21
|
+
hasher.update(b"\0")
|
|
22
|
+
return hasher.hexdigest()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def materialize_build_context(target_dir: Path) -> None:
|
|
26
|
+
target_dir.mkdir(parents=True, exist_ok=True)
|
|
27
|
+
(target_dir / "Dockerfile").write_bytes(resource_bytes("Dockerfile"))
|
|
28
|
+
(target_dir / "install_tizen_studio.py").write_bytes(resource_bytes("install_tizen_studio.py"))
|