-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: Xinference Restful Client (#2)
* init * remove blank.yaml * add dev packages * add cython for dev packages * add UT * Add README * Generate versioneer * reduce packages to install in CI
- Loading branch information
1 parent
12ae3eb
commit 50ed06a
Showing
27 changed files
with
5,085 additions
and
37 deletions.
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 @@ | ||
xinference_client/_version.py export-subst |
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,27 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "BUG" | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
### Describe the bug | ||
A clear and concise description of what the bug is. | ||
|
||
### To Reproduce | ||
To help us to reproduce this bug, please provide information below: | ||
|
||
1. Your Python version. | ||
2. The version of xinference you use. | ||
3. The version of xinference client you use. | ||
4. Versions of crucial packages. | ||
5. Full stack of the error. | ||
6. Minimized code to reproduce the error. | ||
|
||
### Expected behavior | ||
A clear and concise description of what you expected to happen. | ||
|
||
### Additional context | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
### Is your feature request related to a problem? Please describe | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
### Describe the solution you'd like | ||
A clear and concise description of what you want to happen. | ||
|
||
### Describe alternatives you've considered | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
### Additional context | ||
Add any other context or screenshots about the feature request here. |
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,10 @@ | ||
--- | ||
name: Other | ||
about: Submit other issues here. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
Note that the issue tracker is NOT the place for general support. |
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,9 @@ | ||
--- | ||
name: Question | ||
about: Ask a question here. | ||
title: 'QUESTION' | ||
labels: 'question' | ||
assignees: '' | ||
--- | ||
|
||
Note that the issue tracker is NOT the place for general support. |
This file was deleted.
Oops, something went wrong.
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,103 @@ | ||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
types: ['opened', 'reopened', 'synchronize'] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.10" ] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Set up Python environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: flake8 Lint | ||
uses: py-actions/flake8@v2 | ||
with: | ||
path: "xinference_client" | ||
args: "--config setup.cfg" | ||
- name: black | ||
uses: psf/black@stable | ||
with: | ||
src: "xinference_client" | ||
options: "--check" | ||
- uses: isort/isort-action@master | ||
with: | ||
sortPaths: "xinference_client" | ||
configuration: "--check-only --diff --sp setup.cfg" | ||
- name: mypy | ||
run: pip install mypy && mypy --install-types --non-interactive xinference_client | ||
- name: codespell | ||
run: pip install codespell && codespell xinference_client | ||
|
||
build_test_job: | ||
runs-on: ${{ matrix.os }} | ||
needs: lint | ||
env: | ||
CONDA_ENV: test | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] | ||
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | ||
module: [ "xinference_client" ] | ||
exclude: | ||
- { os: macos-latest, python-version: 3.9 } | ||
- { os: macos-latest, python-version: 3.10 } | ||
- { os: windows-latest, python-version: 3.9 } | ||
- { os: windows-latest, python-version: 3.10 } | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Set up conda ${{ matrix.python-version }} | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
activate-environment: ${{ env.CONDA_ENV }} | ||
|
||
- name: Install dependencies | ||
env: | ||
MODULE: ${{ matrix.module }} | ||
run: | | ||
pip install llama-cpp-python>=0.2.0 | ||
pip install torch | ||
pip install sentence-transformers | ||
pip install requests | ||
pip install xinference | ||
pip install -e ".[dev]" | ||
working-directory: . | ||
|
||
- name: Test with pytest | ||
env: | ||
MODULE: ${{ matrix.module }} | ||
run: | | ||
pytest --timeout=1500 \ | ||
-W ignore::PendingDeprecationWarning \ | ||
--cov-config=setup.cfg --cov-report=xml --cov=xinference_client xinference_client | ||
working-directory: . |
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,55 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
schedule: | ||
# trigger build every day at 4:30 UTC | ||
- cron: '30 4 * * *' | ||
push: | ||
tags: | ||
- '*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
build-publish: | ||
name: Build and publish Python distribution to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- uses: actions/checkout@v3 | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python3 -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
# if is xorbitsai repo, upload to pypi | ||
- uses: pypa/[email protected] | ||
if: github.repository == 'xorbitsai/inference-client' | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
# if is not xorbitsai repo, upload to test | ||
- uses: pypa/[email protected] | ||
if: github.repository != 'xorbitsai/inference-client' | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_PASSWORD }} | ||
verbose: true | ||
repository_url: https://test.pypi.org/legacy/ |
Oops, something went wrong.