Skip to content

Commit

Permalink
feat: added codes and publish python package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
limcheekin committed Sep 27, 2023
1 parent d814983 commit b70867b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Python Package

on:
workflow_dispatch:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools scikit-build
- name: Build source distribution
run: |
python setup.py sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,8 @@ cython_debug/
# model
intfloat/
universal-sentence-encoder-large/
BAAI/
BAAI/

# publishing files
MANIFEST.in
_skbuild/
38 changes: 38 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from skbuild import setup

from pathlib import Path

this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding="utf-8")

setup(
name="open_text_embeddings",
description="Open Source Text Embedding Models with OpenAI API-Compatible Endpoint",
long_description=long_description,
long_description_content_type="text/markdown",
version="1.0.0",
author="Lim Chee Kin",
author_email="[email protected]",
license="MIT",
package_dir={"open.text.embeddings": "open/text/embeddings",
"open.text.embeddings.server": "open/text/embeddings/server"},
packages=["open.text.embeddings", "open.text.embeddings.server"],
install_requires=["langchain>=0.0.200"],
extras_require={
"server": ["uvicorn>=0.22.0",
"fastapi>=0.100.0",
"pydantic-settings>=2.0.1",
"sse-starlette>=1.6.1",
"sentence_transformers>=2.2.2",
],
},
python_requires=">=3.7",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
)

0 comments on commit b70867b

Please sign in to comment.