Skip to content

Commit

Permalink
Add standalone installation using zipapp
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil committed May 3, 2023
1 parent 3f04ee5 commit dd00b75
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
concurrency:
group: build-hatch-${{ github.head_ref }}

env:
STABLE_PYTHON_VERSION: '3.11'

jobs:
build:
name: Build wheels and source distribution
Expand Down Expand Up @@ -46,3 +49,33 @@ jobs:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_HATCH }}

build-zipapp:
name: Build zipapp
needs:
- build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ env.STABLE_PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}

- name: Upgrade pip, Install shiv
run: |
python -m pip install --upgrade pip
pip install shiv
- name: Build zipapp
run: shiv -c hatch -o ./hatch.pyz .

- name: Test zipapp
run: python ./hatch.pyz --version

- name: Upload to releases
uses: softprops/action-gh-release@v1
with:
files: hatch.pyz
4 changes: 4 additions & 0 deletions docs/history/hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

***Added:***

- Ship a [zipapp](https://docs.python.org/3/library/zipapp.html) of Hatch

## [1.7.0](https://github.com/pypa/hatch/releases/tag/hatch-v1.7.0) - 2023-04-03 ## {: #hatch-v1.7.0 }

***Changed:***
Expand Down
9 changes: 9 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ pip install hatch
pipx install hatch
```

## Standalone (via zipapp)

You can also use Hatch without installing it.
The zipapp can be downloaded from [Github releases](https://github.com/pypa/hatch/releases) and you can invoke it with a Python 3.7+ interpreter:

```
python hatch.pyz new --init
```

## Homebrew

See the [formula](https://formulae.brew.sh/formula/hatch) for more details.
Expand Down

0 comments on commit dd00b75

Please sign in to comment.