Skip to content

Commit b70867b

Browse files
committed
feat: added codes and publish python package workflow
1 parent d814983 commit b70867b

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.github/workflows/publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Python Package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- created
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.10"
20+
21+
- name: Install Python dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools scikit-build
25+
26+
- name: Build source distribution
27+
run: |
28+
python setup.py sdist
29+
30+
- name: Publish distribution to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,8 @@ cython_debug/
162162
# model
163163
intfloat/
164164
universal-sentence-encoder-large/
165-
BAAI/
165+
BAAI/
166+
167+
# publishing files
168+
MANIFEST.in
169+
_skbuild/

setup.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from skbuild import setup
2+
3+
from pathlib import Path
4+
5+
this_directory = Path(__file__).parent
6+
long_description = (this_directory / "README.md").read_text(encoding="utf-8")
7+
8+
setup(
9+
name="open_text_embeddings",
10+
description="Open Source Text Embedding Models with OpenAI API-Compatible Endpoint",
11+
long_description=long_description,
12+
long_description_content_type="text/markdown",
13+
version="1.0.0",
14+
author="Lim Chee Kin",
15+
author_email="[email protected]",
16+
license="MIT",
17+
package_dir={"open.text.embeddings": "open/text/embeddings",
18+
"open.text.embeddings.server": "open/text/embeddings/server"},
19+
packages=["open.text.embeddings", "open.text.embeddings.server"],
20+
install_requires=["langchain>=0.0.200"],
21+
extras_require={
22+
"server": ["uvicorn>=0.22.0",
23+
"fastapi>=0.100.0",
24+
"pydantic-settings>=2.0.1",
25+
"sse-starlette>=1.6.1",
26+
"sentence_transformers>=2.2.2",
27+
],
28+
},
29+
python_requires=">=3.7",
30+
classifiers=[
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3.7",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
],
38+
)

0 commit comments

Comments
 (0)