Skip to content

Commit 6651fff

Browse files
author
Zav
committed
Added pypi package
1 parent 52b3079 commit 6651fff

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
on:
6+
release:
7+
types: [created]
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install setuptools wheel twine
21+
- name: Prepare version
22+
run: |
23+
echo "Version number: ${GITHUB_REF##*/}"
24+
echo "${GITHUB_REF##*/}" > package_version.txt || exit $?
25+
ls
26+
env:
27+
GITHUB_BRANCH: ${{ github.ref }}
28+
- name: Build and publish
29+
env:
30+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32+
run: |
33+
python setup.py sdist bdist_wheel
34+
twine upload dist/*

CHANGES

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

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ An airflow job operator that executes a task as a Kubernetes job on a cluster, g
2121

2222
This repository is in beta testing. Any contributions are welcome.
2323

24-
# Install (for now, directly from the git repo)
24+
# Install
25+
26+
To install using pip @ ,
27+
28+
```shell
29+
pip install airflow_kubernetes_job_operator
30+
```
2531

2632
To install from master branch,
2733

setup.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,23 @@
1919

2020
here = os.path.abspath(os.path.dirname(__file__))
2121

22+
23+
def get_version():
24+
version_file_path = os.path.join(here, "package_version.txt")
25+
if not os.path.isfile(version_file_path):
26+
return "debug"
27+
version = None
28+
with open(version_file_path, "r") as raw:
29+
version = raw.read()
30+
31+
return version
32+
33+
2234
setup(
2335
name="airflow_kubernetes_job_operator",
24-
version="0.2.10",
36+
version=get_version(),
2537
description="An airflow job operator that executes a task as a Kubernetes job on a cluster, given a job yaml configuration or an image uri.",
26-
long_description="Please see readme.md",
38+
long_description="Please see readme.md @ https://github.com/LamaAni/KubernetesJobOperator",
2739
classifiers=[],
2840
author="Zav Shotan",
2941
author_email="",

0 commit comments

Comments
 (0)