Skip to content

Commit

Permalink
Upgrade PyApp to 0.13.0 for binary builds (#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Jan 1, 2024
1 parent c4bb4b4 commit f89c577
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
CARGO: cargo
CARGO_BUILD_TARGET: ${{ matrix.job.target }}
PYAPP_REPO: pyapp
PYAPP_VERSION: "0.11.1"
PYAPP_VERSION: "0.13.0"
PYAPP_PIP_EXTERNAL: "true"
PYAPP_PASS_LOCATION: "true"

Expand Down
1 change: 1 addition & 0 deletions docs/history/hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- The reserved environment used for static analysis is now completely configurable
- Add the following methods to the `environment` interface for complete control over output during life cycle management: `app_status_creation`, `app_status_pre_installation`, `app_status_post_installation`, `app_status_project_installation`, `app_status_dependency_state_check`, `app_status_dependency_installation_check`, `app_status_dependency_synchronization`
- Upgrade Ruff to 0.1.9
- Upgrade PyApp to 0.13.0 for binary builds

***Fixed:***

Expand Down
6 changes: 2 additions & 4 deletions src/hatch/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from hatch.cli.publish import publish
from hatch.cli.python import python
from hatch.cli.run import run
from hatch.cli.self import self_command
from hatch.cli.shell import shell
from hatch.cli.status import status
from hatch.cli.version import version
Expand Down Expand Up @@ -207,14 +208,11 @@ def hatch(ctx: click.Context, env_name, project, verbose, quiet, color, interact
hatch.add_command(publish)
hatch.add_command(python)
hatch.add_command(run)
hatch.add_command(self_command)
hatch.add_command(shell)
hatch.add_command(status)
hatch.add_command(version)

__management_command = os.environ.get('PYAPP_COMMAND_NAME', '')
if __management_command:
hatch.add_command(click.Command(name=__management_command, help='Manage this application'))


def main(): # no cov
try:
Expand Down
18 changes: 18 additions & 0 deletions src/hatch/cli/self/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

import click

__management_command = os.environ.get('PYAPP_COMMAND_NAME', 'self')


@click.group(name=__management_command, short_help='Manage Hatch')
def self_command():
pass


if __management_command:
from hatch.cli.self.restore import restore
from hatch.cli.self.update import update

self_command.add_command(restore)
self_command.add_command(update)
17 changes: 17 additions & 0 deletions src/hatch/cli/self/restore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import click

if TYPE_CHECKING:
from hatch.cli.application import Application


@click.command(
short_help='Restore the installation', context_settings={'help_option_names': [], 'ignore_unknown_options': True}
)
@click.argument('args', nargs=-1)
@click.pass_obj
def restore(app: Application, *, args: tuple[str, ...]): # noqa: ARG001
app.abort('Hatch is not installed as a binary')
17 changes: 17 additions & 0 deletions src/hatch/cli/self/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import click

if TYPE_CHECKING:
from hatch.cli.application import Application


@click.command(
short_help='Install the latest version', context_settings={'help_option_names': [], 'ignore_unknown_options': True}
)
@click.argument('args', nargs=-1)
@click.pass_obj
def update(app: Application, *, args: tuple[str, ...]): # noqa: ARG001
app.abort('Hatch is not installed as a binary')

0 comments on commit f89c577

Please sign in to comment.