Skip to content

Commit

Permalink
Python packaging added
Browse files Browse the repository at this point in the history
Signed-off-by: Aravinda Vishwanathapura <[email protected]>
  • Loading branch information
aravindavk committed Feb 7, 2023
1 parent 2919328 commit 8ee377d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/on-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,19 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload Python files to the release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sdk/python/kadalu_volgen/*.py
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload setup.py to the release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sdk/python/setup.py
tag: ${{ github.ref }}
overwrite: true
file_glob: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bin
lib
__pycache__
__pycache__
*.egg-info
dist
6 changes: 6 additions & 0 deletions extras/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/disperse.vo
curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/replica2.vol.j2 -o /tmp/replica2.vol.j2
curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/replica3.vol.j2 -o /tmp/replica3.vol.j2
curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/storage_unit.vol.j2 -o /tmp/storage_unit.vol.j2
curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/__init__.py -o /tmp/__init__.py
curl -fsSL https://github.com/kadalu/volgen/releases/latest/download/setup.py -o /tmp/setup.py

install -m 700 /tmp/disperse.vol.j2 /var/lib/kadalu/templates/
install -m 700 /tmp/replica2.vol.j2 /var/lib/kadalu/templates/
install -m 700 /tmp/replica3.vol.j2 /var/lib/kadalu/templates/
install -m 700 /tmp/storage_unit.vol.j2 /var/lib/kadalu/templates/
install /tmp/kadalu-volgen /usr/bin/kadalu-volgen
mkdir -p /tmp/python/kadalu_volgen
mv /tmp/__init__.py /tmp/python/kadalu_volgen/
mv /tmp/setup.py /tmp/python/
cd /tmp/python/ && python3 setup.py install
35 changes: 35 additions & 0 deletions sdk/python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from setuptools import setup

# def version():
# with open("VERSION") as version_file:
# return version_file.read().strip()

def version():
return "v0.2.0"

setup(
name="kadalu_volgen",
version=version(),
packages=["kadalu_volgen"],
include_package_data=True,
install_requires=[],
platforms="linux",
zip_safe=False,
author="Kadalu Authors",
author_email="[email protected]",
description="Kadalu Volfile Generation",
license="GPL-3.0",
keywords="kadalu, volgen, volfile",
url="https://github.com/kadalu/volgen",
long_description="""
Kadalu Volgen - CLI to generate Volfiles for
Kadalu Storage or GlusterFS
""",
classifiers=[
"Topic :: Utilities",
"Environment :: Console",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
],
)

0 comments on commit 8ee377d

Please sign in to comment.