Skip to content

Commit

Permalink
Rename to devman because devpod already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Oct 30, 2024
1 parent 7fe6e0e commit 53f0ab3
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 26 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: Stefan Tatschner
#
# SPDX-License-Identifier: CC0-1.0

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Install the project
run: |
uv sync --all-extras
- name: Build package
run: |
uv build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 0 additions & 2 deletions containers/arch/justfile

This file was deleted.

2 changes: 1 addition & 1 deletion containers/debian/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM docker.io/debian:trixie

LABEL org.opencontainers.image.authors="stefan@rumpelsepp.org"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.title="Debian Devpod"
LABEL org.opencontainers.image.title="Debian Devman"
LABEL org.opencontainers.image.base.name="docker.io/debian:trixie"

COPY debian-de.sources /etc/apt/sources.list.de/
Expand Down
2 changes: 0 additions & 2 deletions containers/debian/justfile

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion devpod/__main__.py → devman/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from importlib import metadata
from pathlib import Path

from devpod import cli
from devman import cli


try:
Expand Down
26 changes: 13 additions & 13 deletions devpod/cli.py → devman/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import argcomplete

from devpod import config
from devpod import podman
from devman import config
from devman import podman


def parse_args(conf: config.Config) -> tuple[argparse.Namespace, argparse.ArgumentParser]:
Expand All @@ -22,14 +22,14 @@ def parse_args(conf: config.Config) -> tuple[argparse.Namespace, argparse.Argume
"-c",
"--container",
default=conf.get_value(
"devpod.default_container", "ghcr.io/rumpelsepp/devpod:master",
"devman.default_container", "ghcr.io/rumpelsepp/devman:master",
),
help="specify container image for all commands",
)
parser.add_argument(
"--mount",
action="append",
default=conf.get_value("devpod.mounts"),
default=conf.get_value("devman.mounts"),
help="mount directory in $HOME into the container"
)
parser.add_argument(
Expand All @@ -40,36 +40,36 @@ def parse_args(conf: config.Config) -> tuple[argparse.Namespace, argparse.Argume
parser.add_argument(
"--version",
action="version",
version=f'%(prog)s {metadata.version("devpod")}',
version=f'%(prog)s {metadata.version("devman")}',
)

subparsers = parser.add_subparsers()

run_parser = subparsers.add_parser("run", help="run command in devpod container")
run_parser = subparsers.add_parser("run", help="run command in devman container")
run_parser.add_argument(
"CMD",
nargs="?",
default=conf.get_value(
"devpod.run.default_command",
"devman.run.default_command",
podman.get_default_cmd(),
),
help="command to run",
)
run_parser.add_argument(
"--ssh",
action=argparse.BooleanOptionalAction,
default=conf.get_value("devpod.run.ssh", False),
help="enable/disable ssh agent and credentials within the devpod",
default=conf.get_value("devman.run.ssh", False),
help="enable/disable ssh agent and credentials within the devman",
)
run_parser.add_argument(
"--gui",
default=conf.get_value("devpod.run.gui", False),
default=conf.get_value("devman.run.gui", False),
action=argparse.BooleanOptionalAction,
help="enable/disable support for wayland applications within the devpod",
help="enable/disable support for wayland applications within the devman",
)
run_parser.add_argument(
"--term",
default=conf.get_value("devpod.run.share_term", True),
default=conf.get_value("devman.run.share_term", True),
action=argparse.BooleanOptionalAction,
help="enable/disable sharing TERM variable with container",
)
Expand Down Expand Up @@ -110,7 +110,7 @@ def cmd_pull(args: argparse.Namespace) -> int:


def run() -> None:
conf, config_path = config.load_config_file("devpod.toml")
conf, config_path = config.load_config_file("devman.toml")
args, parser = parse_args(conf)
exitcode = 0

Expand Down
6 changes: 3 additions & 3 deletions devpod/config.py → devman/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_git_root() -> Path | None:


def get_config_dirs() -> list[Path]:
user_conf = user_config_path("devpod")
user_conf = user_config_path("devman")
git_root = get_git_root()
cwd = Path.cwd()
if git_root is not None:
Expand All @@ -54,8 +54,8 @@ def search_config(
filename: Path | None = None,
extra_paths: list[Path] | None = None,
) -> Path | None:
name = filename if filename is not None else Path("devpod.toml")
if (s := os.getenv("DEVPOD_CONFIG")) is not None:
name = filename if filename is not None else Path("devman.toml")
if (s := os.getenv("devman_CONFIG")) is not None:
if (path := Path(s)).exists():
return path
raise FileNotFoundError(s)
Expand Down
2 changes: 1 addition & 1 deletion devpod/podman.py → devman/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def create_args(
"/tmp:rw,size=787448k,mode=1777",
] # TODO: calculate size somehow?
args += ["--log-driver", "none"]
args += ["--hostname", "devpod"]
args += ["--hostname", "devman"]
args += ["--group-add", "keep-groups"]
args += ["--userns", "keep-id"]

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "devpod"
name = "devman"
version = "0.1.0"
description = "Manager for Development Containers with podman"
readme = "README.md"
Expand All @@ -27,7 +27,7 @@ dependencies = [
]

[project.scripts]
"devpod" = "devpod.__main__:main"
"devman" = "devman.__main__:main"

[tool.uv]
dev-dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

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

0 comments on commit 53f0ab3

Please sign in to comment.