-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fffa67
commit 828b4c4
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
) |