Skip to content

Commit 3f58e43

Browse files
authored
🚀 publish python package (#109)
1 parent 6f117ba commit 3f58e43

File tree

109 files changed

+347
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+347
-260
lines changed

.github/workflows/docs_publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Publish docs
22
on:
3-
push:
4-
branches:
5-
- main
3+
release:
4+
types: [published]
5+
66
permissions:
77
contents: write
88
jobs:
@@ -12,6 +12,6 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.10'
16-
- run: pip install mkdocs-material
15+
python-version: "3.10"
16+
- run: pip install mkdocs-material
1717
- run: mkdocs gh-deploy --config-file docs/mkdocs/mkdocs.yml --force
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release PyPI Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release_package:
9+
permissions:
10+
contents: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python 3.9
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.9
22+
23+
- name: Install pypa/build
24+
run: >-
25+
python -m
26+
pip install
27+
build
28+
--user
29+
- name: Build a binary wheel and a source tarball
30+
run: >-
31+
python -m
32+
build
33+
--sdist
34+
--wheel
35+
--outdir dist/
36+
.
37+
38+
- name: Publish distribution 📦 to PyPI
39+
if: startsWith(github.ref, 'refs/tags')
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ check_data/
1212
*.db
1313
site/
1414
notebooks/
15-
test.ipynb
15+
test.ipynb
16+
dist/
17+
build/
18+
whitebox_sdk.egg-info

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ COPY . .
1212

1313
EXPOSE 8000
1414

15-
ENTRYPOINT ENV=dev uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
15+
ENTRYPOINT ENV=dev uvicorn whitebox.main:app --reload --host 0.0.0.0 --port 8000

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,35 @@ Design guidelines:
3737
- **Robust**: Get production-ready MLOps system.
3838
- **Kubernetes**: Get production-ready code. With automatic interactive documentation.
3939

40-
# How to use
40+
# Installation
41+
42+
Install the SDK with `pip`:
4143

42-
## Run the server
44+
```bash
45+
pip install whitebox-sdk
46+
```
4347

44-
The project is still in rapid development so to run the server clone the repo and run:
48+
Install whitebox server and all of its dependencies in your k8s cluster using `helm`
4549

4650
```bash
47-
python -m venv .venv
48-
pip install -r requirements.txt
49-
ENV=dev uvicorn src.main:app --reload
51+
helm repo add squaredev https://chartmuseum.squaredev.io/
52+
helm repo update
53+
helm install whitebox squaredev/whitebox
54+
```
55+
56+
# How to use
57+
58+
After you are done installing the server and the SDK, you can start using it.
59+
60+
After you get the API key, all you have to do is create an instance of the Whitebox class adding your host and API key as parameters:
61+
62+
```python
63+
from whitebox import Whitebox
64+
65+
wb = Whitebox(host="127.0.0.1:8000", api_key="some_api_key")
5066
```
5167

52-
In the near future you will be able to `pip install whitebox` and run `whitebox serve` to run whitebox.
68+
Now you're ready to start using Whitebox! Read the [documentation](https://squaredev-io.github.io/whitebox/) to learn more about the SDK.
5369

5470
## High level diagram of model set up
5571

@@ -85,7 +101,7 @@ pre-commit install
85101
### Run the server:
86102

87103
```bash
88-
ENV=dev uvicorn src.main:app --reload
104+
ENV=dev uvicorn whitebox.main:app --reload
89105
```
90106

91107
### Tests:
@@ -103,15 +119,6 @@ ENV=dev uvicorn src.main:app --reload
103119
mkdocs serve -f docs/mkdocs/mkdocs.yml -a localhost:8001
104120
```
105121

106-
# Helm chart
107-
You can install whitebox and all of its dependencies in your k8s cluster using helm
108-
109-
```bash
110-
helm repo add squaredev https://chartmuseum.squaredev.io/
111-
helm repo update
112-
helm install whitebox squaredev/whitebox
113-
```
114-
115122
# Contributing
116123

117124
We happily welcome contributions to Whitebox. You can start by opening a new issue!

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
pythonpath = .
33
log_cli=true
44
; log_cli_level = "INFO"
5-
; addopts = --ignore=src/tests/v1/**.py
5+
; addopts = --ignore=whitebox/tests/v1/**.py
66
markers = order

setup.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from setuptools import setup, find_packages
2+
import os
3+
4+
# get version from env variable
5+
VERSION = os.environ.get("VERSION")
6+
assert VERSION is not None, "VERSION env variable must be set"
7+
8+
DESCRIPTION = "Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes"
9+
LONG_DESCRIPTION = ""
10+
11+
# Setting up
12+
setup(
13+
# the name must match the folder name 'verysimplemodule'
14+
name="whitebox-sdk",
15+
version=VERSION,
16+
author="Squaredev",
17+
author_email="hello@squaredev.io",
18+
description=DESCRIPTION,
19+
long_description=LONG_DESCRIPTION,
20+
packages=find_packages(),
21+
install_requires=[], # add any additional packages that
22+
# needs to be installed along with your package. Eg: 'caer'
23+
keywords=["python", "model monitoring", "whitebox", "mlops"],
24+
classifiers=[
25+
"Programming Language :: Python :: 3",
26+
],
27+
)

src/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/crud/models.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/crud/users.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)