Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
hg-misc-tools
Commits
ddeb2372
Commit
ddeb2372
authored
Feb 27, 2026
by
one
Browse files
[hytop] Add a github action for publishing
parent
81950065
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
11 deletions
+120
-11
.github/workflows/publish-hytop.yml
.github/workflows/publish-hytop.yml
+53
-0
projects/hytop/LICENSE
projects/hytop/LICENSE
+21
-0
projects/hytop/Makefile
projects/hytop/Makefile
+11
-3
projects/hytop/README.md
projects/hytop/README.md
+10
-3
projects/hytop/pyproject.toml
projects/hytop/pyproject.toml
+25
-5
No files found.
.github/workflows/publish-hytop.yml
0 → 100644
View file @
ddeb2372
name
:
Publish hytop to PyPI
on
:
release
:
types
:
[
published
]
permissions
:
contents
:
read
jobs
:
release-build
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v4
-
name
:
Install uv
uses
:
astral-sh/setup-uv@v5
-
name
:
Build release distributions
working-directory
:
projects/hytop
run
:
uv build
-
name
:
Upload distributions
uses
:
actions/upload-artifact@v4
with
:
name
:
release-dists
path
:
projects/hytop/dist/
pypi-publish
:
runs-on
:
ubuntu-latest
needs
:
-
release-build
permissions
:
# Required for Trusted Publishing (OIDC) - no PyPI token needed
# See: https://docs.pypi.org/trusted-publishers/
id-token
:
write
environment
:
name
:
pypi
url
:
https://pypi.org/project/hytop/${{ github.event.release.tag_name }}
steps
:
-
name
:
Retrieve release distributions
uses
:
actions/download-artifact@v4
with
:
name
:
release-dists
path
:
dist/
-
name
:
Publish release distributions to PyPI
uses
:
pypa/gh-action-pypi-publish@release/v1
with
:
packages-dir
:
dist/
projects/hytop/LICENSE
0 → 100644
View file @
ddeb2372
MIT License
Copyright (c) 2025 alephpiece
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
projects/hytop/Makefile
View file @
ddeb2372
.PHONY
:
help setup format lint test clean bump
.PHONY
:
help setup format lint test clean bump
build publish
help
:
help
:
@
echo
"Available targets:"
@
echo
"Available targets:"
...
@@ -7,7 +7,9 @@ help:
...
@@ -7,7 +7,9 @@ help:
@
echo
" make lint - Check code style and errors without modifying files (ruff)"
@
echo
" make lint - Check code style and errors without modifying files (ruff)"
@
echo
" make test - Run all unit tests (pytest)"
@
echo
" make test - Run all unit tests (pytest)"
@
echo
" make clean - Remove build caches and the virtual environment"
@
echo
" make clean - Remove build caches and the virtual environment"
@
echo
" make bump part=X - Bump version (patch/minor/major or X.Y.Z)"
@
echo
" make bump part=X - Bump version (patch/minor/major or set X.Y.Z)"
@
echo
" make build - Build wheel and sdist into dist/"
@
echo
" make publish - Upload dist/ to PyPI (requires UV_PUBLISH_TOKEN)"
setup
:
setup
:
@
echo
">> Initializing virtual environment and installing dependencies..."
@
echo
">> Initializing virtual environment and installing dependencies..."
...
@@ -32,4 +34,10 @@ clean:
...
@@ -32,4 +34,10 @@ clean:
find src tests
-type
d
-name
"__pycache__"
-delete
find src tests
-type
d
-name
"__pycache__"
-delete
bump
:
bump
:
uv run hytop-bump
$(part)
uv run python
-m
hytop._bump
$(part)
build
:
uv build
publish
:
uv publish
projects/hytop/README.md
View file @
ddeb2372
...
@@ -2,16 +2,23 @@
...
@@ -2,16 +2,23 @@
## Quick start
## Quick start
Use
`uv`
to run hytop
:
uv
:
```
bash
```
bash
uv run hytop
--help
uv run hytop
--help
```
```
Run hytop directly
:
pip
:
```
bash
```
bash
source
.venv/Scripts/activate
pip
install
.
hytop
--help
```
pipx:
```
bash
pipx
install
.
hytop
--help
hytop
--help
```
```
...
...
projects/hytop/pyproject.toml
View file @
ddeb2372
...
@@ -5,14 +5,31 @@ build-backend = "hatchling.build"
...
@@ -5,14 +5,31 @@ build-backend = "hatchling.build"
[project]
[project]
name
=
"hytop"
name
=
"hytop"
dynamic
=
["version"]
dynamic
=
["version"]
description
=
"
hytop toolkit
"
description
=
"
Lightweight monitoring toolkit for Hygon DCU clusters
"
readme
=
"README.md"
readme
=
"README.md"
license
=
{
text
=
"MIT"
}
authors
=
[
{
name
=
"alephpiece"
,
email
=
"wangan.cs@gmail.com"
}
]
requires-python
=
">=3.10"
requires-python
=
">=3.10"
dependencies
=
[
"rich>=13"
,
"typer>=0.12"
]
dependencies
=
[
"rich>=14"
,
"typer>=0.23"
]
keywords
=
[
"monitoring"
,
"gpu"
,
"dcu"
,
"hygon"
,
"hytop"
]
classifiers
=
[
"License :: OSI Approved :: MIT License"
,
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: 3.10"
,
"Programming Language :: Python :: 3.11"
,
"Programming Language :: Python :: 3.12"
,
"Programming Language :: Python :: 3.13"
,
"Operating System :: POSIX :: Linux"
,
"Environment :: Console"
,
]
[project.urls]
Homepage
=
"https://github.com/alephpiece/hg-misc-tools"
Repository
=
"https://github.com/alephpiece/hg-misc-tools"
Issues
=
"https://github.com/alephpiece/hg-misc-tools/issues"
[project.scripts]
[project.scripts]
hytop
=
"hytop.main:main"
hytop
=
"hytop.main:main"
hytop-bump
=
"hytop._bump:main"
[dependency-groups]
[dependency-groups]
dev
=
[
"pytest>=8"
,
"ruff>=0.15"
]
dev
=
[
"pytest>=8"
,
"ruff>=0.15"
]
...
@@ -23,6 +40,9 @@ path = "src/hytop/__init__.py"
...
@@ -23,6 +40,9 @@ path = "src/hytop/__init__.py"
[tool.hatch.build.targets.wheel]
[tool.hatch.build.targets.wheel]
packages
=
["src/hytop"]
packages
=
["src/hytop"]
[tool.hatch.build.targets.sdist]
exclude
=
[
"tests/__pycache__"
,
".ruff_cache"
,
".pytest_cache"
]
[tool.pytest.ini_options]
[tool.pytest.ini_options]
testpaths
=
["tests"]
testpaths
=
["tests"]
...
@@ -34,8 +54,8 @@ src = ["src", "tests"]
...
@@ -34,8 +54,8 @@ src = ["src", "tests"]
[tool.ruff.lint]
[tool.ruff.lint]
select
=
[
select
=
[
"F"
,
# pyflakes
"F"
,
# pyflakes
"E"
,
"E"
,
# pycodestyle errors
"W"
,
# pycodestyle
"W"
,
# pycodestyle
warnings
"I"
,
# isort
"I"
,
# isort
"UP"
,
# pyupgrade
"UP"
,
# pyupgrade
"B"
,
# flake8-bugbear
"B"
,
# flake8-bugbear
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment