Skip to content

Commit

Permalink
Add pypi support (#17)
Browse files Browse the repository at this point in the history
* Add `release.yml`

* Update `version`

* Fix bug

* Update `release.yml`

* Update
  • Loading branch information
james77777778 authored Jan 19, 2024
1 parent 03d84b4 commit 22136f9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
- name: Pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
Expand All @@ -56,7 +56,7 @@ jobs:
with:
python-version: '3.9'
- name: Get pip cache dir
id: pip-cache
id: Pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
release:
types: [published]

jobs:
pypi-publish:
strategy:
fail-fast: false
name: Build wheel file and upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off --upgrade
pip install -e ".[tests]" --progress-bar off --upgrade
- name: Build wheels
shell: bash
run: |
pip install --upgrade pip setuptools wheel twine build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
2 changes: 1 addition & 1 deletion kimm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from kimm import models # force to add models to the registry
from kimm.utils.model_registry import list_models

__version__ = "0.1.0"
__version__ = "0.1.1"

0 comments on commit 22136f9

Please sign in to comment.