Skip to content

Commit

Permalink
Automated Version setup.py 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sakib committed Mar 7, 2021
1 parent c4a4fa3 commit 7c7ddf2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
12 changes: 12 additions & 0 deletions UpStorageApiClient/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os


def string():
try:
with open(os.path.dirname(__file__) + "/VERSION", "r", encoding="utf-8") as fh:
version = fh.read().strip()
if version:
return version
except:
pass
return "unknown (git checkout)"
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
from setuptools import setup, find_packages
import os
import codecs
import setuptools
import subprocess

project_version = subprocess.run(['git', 'describe', '--tags'], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
assert "." in project_version

assert os.path.isfile("UpStorageApiClient/version.py")
with open("UpStorageApiClient/VERSION", "w", encoding="utf-8") as fh:
fh.write(f"{project_version}\n")


def read_file(filename):
with open(os.path.join(os.path.dirname(__file__), filename)) as file:
return file.read()


VERSION = '0.4'

# Setting up
setup(
name="UpStorageApiClient",
version=VERSION,
version=project_version,
author="Sakib (Florian Dedov)",
author_email="<[email protected]>",
long_description_content_type="text/markdown",
long_description=read_file('README.md'),
description='UpStorage Api Client.',
packages=find_packages(),
url='https://github.com/QuackCoding/UpStorageApiClient',
package_data={'UpStorageApiClient': ['VERSION']},
install_requires=['requests'],
keywords=['python', 'storage', 'api', 'upstorage', 'UpStorageApiClient'],
classifiers=[
Expand Down

0 comments on commit 7c7ddf2

Please sign in to comment.