Skip to content

Commit

Permalink
pypi publish & github actions (#2)
Browse files Browse the repository at this point in the history
* setup has long description

* wip

* add github actions
  • Loading branch information
cthacker authored Aug 30, 2021
1 parent 3bedaa6 commit 1f68ca0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: main deployment to pypi
on:
workflow_dispatch:
push:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: pip install kfp
run: |
pip install --upgrade build
pip install --upgrade twine
- name: build files
run: |
python -m build
- name: push to pypi
run: |
python -m twine upload dist/* -u "__token__" -p ${{ secrets.PYPI_SECRET }}
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: always()
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took,message
custom_payload: |
{
username: 'github-actions',
icon_emoji: ':octocat:',
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO} by ${process.env.AS_AUTHOR} finished in ${process.env.AS_TOOK}\nMessage: ${process.env.AS_MESSAGE}`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Empty file added ivi_sdk/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from setuptools import setup
from setuptools.command.build_py import build_py
import subprocess
import os

cwd = os.path.dirname(os.path.abspath(__file__))

class ivi_build_py(build_py):
def run(self):
Expand Down Expand Up @@ -46,13 +48,19 @@ def find_package_modules(self, package, package_dir):

base_requires = ['grpcio==1.34.0', 'protobuf<4.0dev,>=3.5.0.post1']

with open(os.path.join(cwd, "README.md"), encoding="utf-8") as f:
long_description = f.read()

setup(
name='ivi_sdk',
version='0.1',
description='Simple IVI gRPC stream API wrapper',
long_description=long_description,
long_description_content_type="text/markdown",
packages=[''],
package_dir={'': 'ivi_sdk'},
install_requires=base_requires,
setup_requires=base_requires + ['grpcio-tools==1.34.0'],
test_requires=base_requires + ['pytest', 'pytest-asyncio'],
python_requires='>=3.6',
cmdclass={'build_py': ivi_build_py})

0 comments on commit 1f68ca0

Please sign in to comment.