-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ohmrefresh/feature/fix-bug-get-version
Fix bug can't read version
- Loading branch information
Showing
4 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
VERSION = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
from setuptools import setup, find_packages | ||
import os | ||
import re | ||
|
||
# Read version from file without loading the module | ||
with open('GrafanaSnapshot/version.py', 'r') as version_file: | ||
version_match = re.search(r"^VERSION ?= ?['\"]([^'\"]*)['\"]", | ||
version_file.read(), re.M) | ||
|
||
def read(filename): | ||
return open(os.path.join(os.path.dirname(__file__), filename)).read() | ||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
if version_match: | ||
VERSION = version_match.group(1) | ||
else: | ||
VERSION = '0.1' # | ||
|
||
setup( | ||
name="grafana-snapshot", | ||
version=read('VERSION'), | ||
version=VERSION, | ||
author="Authapon Kongkaew, Nitipat Phiphatprathuang, Panchorn Lertvipada", | ||
author_email="[email protected], [email protected], [email protected]", | ||
description="Task a grafana snapshot", | ||
long_description=read('README.md'), | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/ascendcorp/GrafanaSnapshot.git", | ||
url="https://github.com/ohmrefresh/GrafanaSnapshot.git", | ||
license="MIT", | ||
packages=find_packages(), | ||
install_requires=['requests', 'grafana_api'], | ||
|