Skip to content

Commit

Permalink
Merge pull request #10 from ohmrefresh/feature/fix-bug-get-version
Browse files Browse the repository at this point in the history
Fix bug can't read version
  • Loading branch information
ohmrefresh authored Aug 29, 2019
2 parents 059938a + 6fb4a04 commit f560356
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ deploy:
provider: pypi
user: ohmrefresh
password:
secure: YiB17hLi0ZgGXnV07/8PKhgo5UgyKKLIXYSSMwhoDJnc4GaFB3bynxfDpFevMQgzkmecLYh/opAQtLn8GNYErmQruEWhU50Zw12rQQIi6SLdC+9iLYtZKNlVdiOkxV6M3Xc0k6so3oUa7BmEHsSXa4crZfwzY7iOI08Ak3hj4H33skbuW7ojw72GllvRq2AFIf7ld4fXYvyBmMaWNBISRazD9EEFC6L6eh55+Zw4Z9XUHm4Ud6nQ4eVvSTiZG12runf7pUpm8lUIIrksdFyqpF2wwIXOOC+mAzhW8cqPgPJ7eNCiasr09oMmTWVi8Aj6i3AAIM+tcE9m75tMi/lTOJ7Dl7cbEjTJPR/Nfl5dUnsASHLk/izjTJkIOT8g1ev7N3dO3zEkgGL6LfeRNUaekKg1T9q0nBJsxjxPqp8ZfPo/2hJsI57BZsze2W1wYSowjr6X+RvsDx+GgSm6J/mJjlXxamHNTK5B8HF9yHRLvpst/gRSKE0NGOtzAkucMdng7dAypi2vf3aycNVix/xNTEmUUF53uAn3AkYayqYE4fqPGRgl+oqZaNSbDkQN5qILaFkcrIJUH/CIenErP2Ojx1/TegsL0XLQihlpRiCFYYjcryjLYs7DXdR5En3Xq/8yCUs/KTID18l6k+Tql28UcxhiT8X4MTM0MwQ2QPNbbEM=
secure: IfYpQNthr+P+GvCXxb77CQ3CVd+1puT/7g1mB+48DXt3oCnRQBNzGikkEktBxvLpQkoApuotsMOmoTJaqhF6sNRO4HAHnpx5xQ2bRqS2iV1areO1jHJjRqcAf/33bI4DQiM2zLEoqLqN6DW50QmkkVF/OJ2bIH9E13Ku+IePK0PFVo9ywPozyFZJqVCaXZqDm01WP3D0gzq3fB2ugUfaeHrz3ZBbv3KfyQXpTyOdKV3npCPt0RQydpOJSD7OCBHRkFN1vuJXUOf2DVcQ5/bljH5gXKG/ut/03Tyn7KCX1gvrYo0VKRWKPuBVJf9TaPkeAerebrJRNXOZXXk1WsjdgglanE+m4L+idjjZYOSSJwaS05FN8mVSRmzUELjxYkj5kY4nq8DbK/v/+unSu469F3X/dKeAAflIZz9sPtRQh+l2MAs9pEY0KK6kYAmuJhsdgzUeokLunx74g7JZyTMlmzEH4mHFP5jrC1XaZRwX98BUBopyjDv+ID8v7w2nNGSQeOUHFdteSc/egUGpcwbDO/Epif3CL/nb+Jiga+770UmrhHSR7Es+iGZxR/2OeykDh0haSu7ivU8oyMdk6gyYaqDmp5jl1XCuUDm9SjJb8tqFXawT6glo58XFPCEUZM5oy+63AaYQNqH8nbEY4FbrNB4ysV9N3i0bCUpEMjfuq2g=
on:
tags: true
distributions: sdist bdist_wheel
repo: ascendcorp/grafana-snapshot
repo: ohmrefresh/GrafanaSnapshot
3 changes: 3 additions & 0 deletions GrafanaSnapshot/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
VERSION = "0.2"
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

20 changes: 14 additions & 6 deletions setup.py
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'],
Expand Down

0 comments on commit f560356

Please sign in to comment.