Skip to content

Commit

Permalink
v0.4.0 (#38)
Browse files Browse the repository at this point in the history
This release mainly focuses on improving the packaging side.
`isd` now provides a desktop file and uses a standard size for the icon (fixes #29).

This release will also be available on PyPI. The main reason for publishing
to PyPI is to better support packaging for distros as mentioned in #18.
Due to a naming clash on PyPI, the Python project has been renamed
to `isd-tui`. However, the project will continue to be named `isd`
and the executable will continue to be called `isd`!

The Python wheel only includes the necessary files, including
the `.desktop` file and icon.
The `nix` derivation propagates the `.desktop` file and the icon and makes them
available for Desktops of `nix` users.
Due to a bug in `isd-appimage`, identical `nixpkgs` pins cannot be used for `isd`
(#37 is blocked).

This release also introduces _EXPERIMENTAL_ arm support!
I do _not_ have access to an arm-based machine, and as such, I cannot actually
test the arm-based `AppImage`. The `AppImage` was created by cross-compiling. 
However, I cannot run a cross-platform `AppImage` (should fix #36).
Please let me know if it works for you or not 🙏

At least the arm-based `nix` derivation can be run with QEMU, and it seems to work.

PS: This release also includes a workaround for a `Zellij` bug (fixes #34).
Though upstream already has a bug-fix available until a new version has
been published, `isd` will work around the Zellij issue.
  • Loading branch information
isd-project authored Feb 1, 2025
1 parent 369fd55 commit 5191c60
Show file tree
Hide file tree
Showing 17 changed files with 310 additions and 344 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ on:

jobs:
build:
runs-on: ubuntu-latest
# runs-on: [ubuntu-latest, ubuntu-24.04-arm]
# wait times for `-arm` are insane. Let's see how
# good cross-compilation works with nix
runs-on: [ubuntu-latest]
permissions:
contents: write # write required for action-gh-release
id-token: write
Expand All @@ -17,19 +20,17 @@ jobs:
uses: actions/checkout@v4
- name: Run `nix fmt`
run: nix fmt -- --check *
- name: Run `flake checks`
- name: Build all packages supported by the current architecture
run: nix flake check -L
- name: Create AppImage
run: nix build .#isd-AppImage
# Leads to:
# `cannot write uid_map: Operation not permitted`
# - name: Test appimage
# run: ./result --help
- name: Rename AppImage
if: startsWith(github.ref, 'refs/tags/')
run: cp ./result isd.AppImage
- name: Release AppImage
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: isd.AppImage
# - name: Rename AppImage
# if: startsWith(github.ref, 'refs/tags/')
# run: cp ./result isd.${{ runner.arch }}.AppImage
# - name: Release AppImage
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: isd.${{ runner.arch}}.AppImage
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ schema.json
config.yaml
drafts/
result
__pycache__
squashfs-root/
/_version.py
# config should be automatically generated when running vhs!
docs/config/*
# same for .cast/gif files!
Expand Down
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!drafts/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# isd – *i*nteractive *s*ystem*d*

<center>
<img src="./assets/isd.png" alt="isd logo" style="max-width: 50vh;">
<img src="./share/icons/hicolor/512x512/isd.png" alt="isd logo" style="max-width: 50vh;">
</center>

<!-- --8<-- [start:tagline] -->
Expand Down
Binary file removed assets/isd.png
Binary file not shown.
11 changes: 9 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ If you are interested, read on and take a look at the [recorded terminal session
To install [uv] have a look at the [official uv installation documentation](https://docs.astral.sh/uv/).

After installing [uv], you can _try_ `isd` by running:
`uvx --python=3.12 --from git+{{config['repo_url']}} isd`
`uvx --python=3.12 isd-tui`

To install and manage `isd` via [uv], run:
`uv tool install --python=3.12 git+{{config['repo_url']}}`
`uv tool install --python=3.12 isd-tui`

After installing the tool, the program `isd` and its alias[^alias] `isd-tui`
will be available.

`isd` requires `--python` to be set `>=3.12` and would fail
if the default Python version is older.
Expand Down Expand Up @@ -308,3 +311,7 @@ Checkout the other sections as well:
- [FAQ](./faq.md)
- [Security](./security.md)

[^alias]: The reason why the `isd-tui` alias exists is due to a naming conflict
on PyPI with a different package called `isd`. Providing the alias `isd-tui`
allows `uv` users to try it without having to write `uvx --from isd-tui isd`.

34 changes: 17 additions & 17 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
description = "interactive systemd flake";

inputs = {
# 24.11 does _not_ contain asciinema_3
# nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

pyproject-nix = {
Expand All @@ -22,7 +24,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};

systems.url = "github:nix-systems/x86_64-linux";
# Supports linux x86_64 and aarch64.
systems.url = "github:nix-systems/default-linux";
nix-filter.url = "github:numtide/nix-filter";
# pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
systemd-nix = {
Expand All @@ -31,6 +34,9 @@
};
nix-appimage = {
url = "github:ralismark/nix-appimage";
# nix-appimage cannot track nixos-unstable until this issue is resolved:
# - <https://github.com/ralismark/nix-appimage/issues/23>
# inputs.nixpkgs.follows = "nixpkgs";
};
};

Expand Down Expand Up @@ -143,23 +149,26 @@
let
# Package the virtual environment
# Enable no optional dependencies for production build.
venv = pythonSet.mkVirtualEnv "isd-env" workspace.deps.default;
venv = pythonSet.mkVirtualEnv "isd-tui-env" workspace.deps.default;
in
pkgs.stdenvNoCC.mkDerivation {
pname = "isd";
inherit version;
src = venv;
meta = {
mainProgram = "isd";
license = pkgs.lib.getLicenseFromSpdxId "GPL-3.0";
license = pkgs.lib.getLicenseFromSpdxId "GPL-3.0-or-later";
};
buildPhase = ''
mkdir -p $out/bin
ln -s $src/bin/isd $out/bin/
ln -s $src/share $out/
'';
};
isd = default;
isd-AppImage = inputs.nix-appimage.lib.${system}.mkAppImage {
isd-tui = isd;
"isd-AppImage" = inputs.nix-appimage.lib.${system}.mkAppImage {
pname = "isd.${system}";
program = pkgs.lib.getExe (
isd.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs or [ ] ++ [ pkgs.makeBinaryWrapper ];
Expand Down Expand Up @@ -279,7 +288,7 @@
# Build virtual environment, with local packages being editable.
#
# Enable all optional dependencies for development.
virtualenv = editablePythonSet.mkVirtualEnv "hello-world-dev-env" workspace.deps.all;
virtualenv = editablePythonSet.mkVirtualEnv "isd-tui-env" workspace.deps.all;
in
pkgs.mkShell {
packages = [
Expand Down
117 changes: 105 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
[project]
name = "isd"
version = "0.3.0"
description = "Interactive systemd TUI"
readme = "README.md"
name = "isd-tui"
requires-python = ">=3.12"
license = "GPL-3.0"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
readme = "README.md"
description = "Interactive systemd TUI"
keywords = ["systemd", "tui", "service-manager"]
classifiers = [
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: Unix",
"Programming Language :: Python",
"Topic :: System :: Monitoring",
"Topic :: System :: Systems Administration",
"Topic :: Terminals",
"Topic :: Utilities",
]

dependencies = [
"xdg-base-dirs>=6.0.0",
"pfzy>=0.3.4",
Expand All @@ -13,14 +27,26 @@ dependencies = [
"pydantic>=2.10.4",
"types-pyyaml>=6.0.12.20241221",
]
version = "0.4.0"

# # versioningit was great in theory
# # but it comes with too many issues for packaging
# # in other distros. :/
# # https://github.com/jwodder/versioningit
# dynamic = ["version"]
# [tool.hatch.version]
# source = "versioningit"
# [tool.versioningit]

[dependency-groups]
dev = [
"pylsp-mypy>=0.6.9",
"pylsp-rope>=0.1.17",
"python-lsp-isort>=0.2.0",
"python-lsp-ruff>=2.2.2",
"python-lsp-server>=1.12.0",
"bump-my-version>=0.30.1",
# Remove LSP deps
# "pylsp-mypy>=0.6.9",
# "pylsp-rope>=0.1.17",
# "python-lsp-isort>=0.2.0",
# "python-lsp-ruff>=2.2.2",
# "python-lsp-server>=1.12.0",
"textual-dev>=1.7.0",
]
docs = [
Expand All @@ -31,8 +57,75 @@ docs = [
]

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "editables"]
build-backend = "hatchling.build"

[project.scripts]
isd = "isd.isd:main"
isd = "isd_tui.isd:main"
# only for compatibility when running
# `uvx isd-tui`
isd-tui = "isd_tui.isd:main"

[project.urls]
Hompage = "https://github.com/isd-project/isd"
Documentation = "https://isd-project.github.io/isd/"
Repository = "https://github.com/isd-project/isd"
"Bug Tracker" = "https://github.com/isd-project/isd/issues"

# build.hooks.<HOOK_NAME> is global
# and applied to _all_ build targets
# [tool.hatch.build.hooks.custom]

[tool.hatch.build]
exclude = [
"docs/",
"docs_glossary/",
"flake.nix",
"flake.lock",
"mkdocs.yml",
"macros.py",
"*.tape",
"src/isd/*.md"
]

[tool.hatch.build.targets.wheel.shared-data]
"share/" = "share/"

[tool.bumpversion]
current_version = "0.4.0"
parse = """
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
(?P<patch>0|[1-9]\\d*)
(?:
- # dash separator for pre-release section
(?P<pre_l>[a-zA-Z-]+) # pre-release label
(?:0|[1-9]\\d*) # pre-release version number
)? # pre-release section is optional
"""
serialize = [
"{major}.{minor}.{patch}-{pre_l}{distance_to_latest_tag}",
"{major}.{minor}.{patch}",
]
search = """version = "{current_version}""""
replace = """version = "{new_version}""""
regex = false
ignore_missing_version = false
ignore_missing_files = false
# do not tag with bump, as I want to tag a merged PR on main
# and not the PR commit that will probably be squashed.
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = false
message = "Bump version: {current_version} → {new_version}"
moveable_tags = []
commit_args = ""
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []

[[tool.bumpversion.files]]
filename = "pyproject.toml"
10 changes: 10 additions & 0 deletions share/applications/isd.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=isd
GenericName=interactive systemd
Comment=A better way to work with systemd units
Icon=isd
Exec=isd
Terminal=true
Categories=System;Monitor;ConsoleOnly;
Keywords=systemd;tui;service-manager
Binary file added share/icons/hicolor/512x512/apps/isd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5191c60

Please sign in to comment.