Skip to content

Commit 84c0b11

Browse files
committed
Closes UNB-2029 Add to PyPI (and does a github actions deploy)
1 parent 777bf5b commit 84c0b11

File tree

5 files changed

+84
-29
lines changed

5 files changed

+84
-29
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: publish
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.9
16+
- name: Install unboxapi
17+
run: >-
18+
pip install -e .
19+
- name: Install pypa/build
20+
run: >-
21+
python -m pip install build --user
22+
- name: Build a binary wheel and a source tarball
23+
run: >-
24+
python -m build --sdist --wheel --outdir dist/ .
25+
# ======================
26+
- name: Publish distribution 📦 to Test PyPI
27+
uses: pypa/gh-action-pypi-publish@master
28+
with:
29+
user: __token__
30+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
31+
repository_url: https://test.pypi.org/legacy/
32+
- name: Publish distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
user: __token__
37+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ unboxapi.egg-info/
33
data/
44
.ipynb_checkpoints/
55
.DS_Store
6+
.eggs/
67
build
78
dist
89
template_model.py

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=59.0",
4+
"wheel",
5+
]
6+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[metadata]
2+
name = unboxapi
3+
version = attr: unboxapi.__version__
4+
description = The official Python API library for Unbox: the Testing and Debugging Platform for AI
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
url = https://github.com/unboxai/unboxapi-python-client
8+
author = Unbox Inc.
9+
classifiers =
10+
Operating System :: OS Independent
11+
Programming Language :: Python :: 3
12+
Programming Language :: Python :: 3 :: Only
13+
Programming Language :: Python :: 3.7
14+
Programming Language :: Python :: 3.8
15+
Programming Language :: Python :: 3.9
16+
Programming Language :: Python :: Implementation :: CPython
17+
Topic :: Scientific/Engineering :: Artificial Intelligence
18+
Topic :: Software Development :: Libraries
19+
keywords = MLOps, AI, Unbox
20+
project_urls =
21+
Documentation = https://docs.unbox.ai/
22+
Unbox User Slack Group = https://l.linklyhq.com/l/1DG73
23+
24+
[options]
25+
packages = unboxapi
26+
install_requires =
27+
bentoml==0.13.1
28+
jupyter
29+
pandas
30+
requests
31+
tqdm
32+
python_requires = >=3.7
33+
include_package_data = True
34+
setup_requires =
35+
setuptools>=59.0
36+
wheel
37+
zip_safe = False

setup.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
#!/usr/bin/env python3
22

3-
import pathlib
4-
from distutils.util import convert_path
3+
import setuptools
54

6-
import pkg_resources
7-
from setuptools import find_packages, setup
8-
9-
with pathlib.Path("requirements.txt").open() as requirements_txt:
10-
install_requires = [
11-
str(requirement)
12-
for requirement in pkg_resources.parse_requirements(requirements_txt)
13-
]
14-
15-
main_ns = {}
16-
ver_path = convert_path("unboxapi/version.py")
17-
with open(ver_path) as ver_file:
18-
exec(ver_file.read(), main_ns)
19-
20-
setup(
21-
name="unboxapi",
22-
version=main_ns["__version__"],
23-
description="The official Python client library for Unbox, the Testing and Debugging Platform for AI",
24-
url="https://github.com/unboxai/unboxapi-python-client",
25-
author="Unbox",
26-
license="BSD",
27-
packages=find_packages(exclude=["js", "node_modules", "tests"]),
28-
python_requires=">=3.7",
29-
install_requires=install_requires,
30-
include_package_data=True,
31-
zip_safe=False,
32-
)
5+
if __name__ == "__main__":
6+
setuptools.setup()

0 commit comments

Comments
 (0)