Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored the package version information so that the source of trut… #71

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
MAXIMUM_RETRIES, OUTPUT_LOG, LOG_PATH, LOG_FILE_PREFIX, PRINT_TO_CONSOLE, SIMULATE_API_CALLS
)

__version__ = '0.80.3'


class DashboardAPI(object):
"""
Expand Down
25 changes: 24 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
"""Setup script for meraki"""

import os.path
import re
from setuptools import setup, find_packages

HERE = os.path.abspath(os.path.dirname(__file__))
PACKAGE_INIT = os.path.abspath(os.path.join('meraki', '__init__.py'))

with open(os.path.join(HERE, 'README.md')) as fid:
README = fid.read()


def find_version(fname):
'''Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
'''
version = ''
with open(fname, 'r') as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)
if m:
version = m.group(1)
break
if not version:
raise RuntimeError('Cannot find version information')
return version


__version__ = find_version(PACKAGE_INIT)


setup(
name='meraki',
version='0.70.5',
version=__version__,
packages=find_packages(),
include_package_data=True,
install_requires=['requests'],
Expand Down