Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ _src_path: https://github.com/trobz/trobz-python-template.git
author_email: hailn@trobz.com
author_username: hailangvn
enable_github_action: true
package_name: deploy
package_name: trobz_deploy
project_description: CLI tool for deploying and managing applications on remote servers
over SSH.
project_name: deploy
project_name: trobz-deploy
project_type: cli
publish_to_pypi: false
repository_name: deploy
publish_to_pypi: true
repository_name: deploy.py
repository_namespace: trobz
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,35 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "actions@users.noreply.github.com"


publish:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest

permissions:
contents: write

id-token: write

environment:
name: pypi
url: https://pypi.org/p/trobz-deploy

steps:
- name: Check out at new tag
uses: actions/checkout@v6
with:
ref: ${{ needs.release.outputs.tag }}

- name: Set up the environment
uses: ./.github/actions/setup-python-env

- name: Build Package
run: make build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
packages-dir: dist
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "deploy"
name = "trobz-deploy"
version = "0.8.0"
description = "CLI tool for deploying and managing applications on remote servers over SSH."
authors = [{name = "hailangvn", email = "hailn@trobz.com"}]
Expand All @@ -17,7 +17,7 @@ dependencies = [
[project.urls]
Repository = "https://github.com/trobz/deploy.py"
[project.scripts]
deploy = "deploy.cli:cli"
deploy = "trobz_deploy.cli:cli"

[dependency-groups]
dev = [
Expand All @@ -37,7 +37,7 @@ requires = ["uv_build>=0.7.19,<0.8.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = "deploy"
module-name = "trobz_deploy"
module-root = ""


Expand All @@ -48,7 +48,7 @@ build = ["uv ~= 0.7.12"]
version_toml = ["pyproject.toml:project.version"]
build_command = """
python -m pip install -e '.[build]'
uv lock --upgrade-package deploy
uv lock --upgrade-package trobz-deploy
git add uv.lock
uv build
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from deploy.utils.config import parse_instance_name
from trobz_deploy.utils.config import parse_instance_name

# ---------------------------------------------------------------------------
# Valid names from the SPEC examples
Expand Down
6 changes: 3 additions & 3 deletions tests/test_update_watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from click.testing import CliRunner

from deploy.command.update import update
from trobz_deploy.command.update import update


@pytest.fixture
Expand All @@ -21,8 +21,8 @@ def _executor_mock():

def _invoke(runner, extra_args: list[str], side_effect=None):
with (
patch("deploy.command.update.Executor") as MockExecutor,
patch("deploy.command.update.load_config", return_value={}),
patch("trobz_deploy.command.update.Executor") as MockExecutor,
patch("trobz_deploy.command.update.load_config", return_value={}),
):
mock_exec = _executor_mock()
if side_effect:
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions deploy/cli.py → trobz_deploy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import click

from deploy.command.configure import configure
from deploy.command.status import status
from deploy.command.update import update
from trobz_deploy.command.configure import configure
from trobz_deploy.command.status import status
from trobz_deploy.command.update import update


@click.group()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import click

from deploy.utils.config import load_config, resolve_options
from deploy.utils.executor import Executor, ExecutorError
from deploy.utils.render import render_unit
from deploy.utils.venv import setup_odoo_venv, setup_package_venv, setup_python_venv
from trobz_deploy.utils.config import load_config, resolve_options
from trobz_deploy.utils.executor import Executor, ExecutorError
from trobz_deploy.utils.render import render_unit
from trobz_deploy.utils.venv import setup_odoo_venv, setup_package_venv, setup_python_venv


def _is_git_repo(executor: Executor, path: str) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions deploy/command/status.py → trobz_deploy/command/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import click

from deploy.utils.config import load_config
from deploy.utils.executor import Executor, ExecutorError
from trobz_deploy.utils.config import load_config
from trobz_deploy.utils.executor import Executor, ExecutorError


@click.command()
Expand Down
8 changes: 4 additions & 4 deletions deploy/command/update.py → trobz_deploy/command/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import click

from deploy.utils.addons import get_addons_path
from deploy.utils.config import load_config, resolve_options
from deploy.utils.executor import Executor, ExecutorError
from deploy.utils.venv import setup_python_deps, upgrade_package
from trobz_deploy.utils.addons import get_addons_path
from trobz_deploy.utils.config import load_config, resolve_options
from trobz_deploy.utils.executor import Executor, ExecutorError
from trobz_deploy.utils.venv import setup_python_deps, upgrade_package


@click.command()
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/utils/addons.py → trobz_deploy/utils/addons.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from deploy.utils.executor import Executor
from trobz_deploy.utils.executor import Executor


def get_addons_path(executor: Executor, instance_path: str) -> str:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/utils/render.py → trobz_deploy/utils/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def render_unit(template_name: str, **variables: Any) -> str:
Returns:
Rendered unit file content as a string.
"""
pkg = files("deploy.templates")
pkg = files("trobz_deploy.templates")
source = (pkg / f"{template_name}.service.j2").read_text(encoding="utf-8")
env = Environment(autoescape=select_autoescape(["html", "htm", "xml"]))
template = env.from_string(source)
Expand Down
2 changes: 1 addition & 1 deletion deploy/utils/venv.py → trobz_deploy/utils/venv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from deploy.utils.executor import Executor
from trobz_deploy.utils.executor import Executor


def setup_odoo_venv(executor: Executor, instance_path: str) -> None:
Expand Down
84 changes: 42 additions & 42 deletions uv.lock

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