Skip to content

Commit

Permalink
prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Feb 16, 2024
1 parent 7fffa67 commit 828b4c4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Python Package to PyPI

on:
push:
tags:
- "v*"

jobs:
build-n-publish:
name: Build and publish Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install wheel
- name: Extract tag name
id: tag
run: |
echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: |
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
- name: Build a binary wheel
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
25 changes: 24 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
from setuptools import setup, find_packages
from pathlib import Path

PY_TGI_VERSION = "0.1.0"

common_setup_kwargs = {
"author": "Ilyas Moutawwakil",
"author_email": "ilyas.moutawwakil@gmail.com",
"description": "A Python wrapper around TGI",
"keywords": ["python", "tgi", "llm", "huggingface", "docker"],
"url": "https://github.com/IlyasMoutawwakil/py-tgi",
"long_description_content_type": "text/markdown",
"long_description": (Path(__file__).parent / "README.md").read_text(
encoding="UTF-8"
),
"platforms": ["linux", "windows", "macos"],
"classifiers": [
"Environment :: GPU :: NVIDIA CUDA :: 11.8",
"Environment :: GPU :: NVIDIA CUDA :: 12",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Natural Language :: English",
],
}

setup(
name="py-tgi",
version="0.0.1",
version=PY_TGI_VERSION,
packages=find_packages(),
install_requires=["docker", "huggingface-hub"],
)

0 comments on commit 828b4c4

Please sign in to comment.