Skip to content

Commit

Permalink
Update version in setup file
Browse files Browse the repository at this point in the history
  • Loading branch information
mverkerk-godaddy committed Jan 9, 2018
1 parent 281d616 commit 855afbf
Showing 1 changed file with 46 additions and 44 deletions.
90 changes: 46 additions & 44 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
#!/usr/bin/env python
from os import path
import re
from setuptools import setup, find_packages

REGEX = '^([\w\-\.]+)[\s]*([=<>\!]+)[\s]*([0-9\.]+)+(,[<>\!=]+[0-9\.]+)*'


def required_packages_list(file_name, exclude_version=False):
parent = path.abspath('.')
if not file_name:
raise RuntimeError('Pass the requirements.txt from where requires '
'list will be generated')
full_path = path.join(parent, file_name)
print("Requirements file %s" % full_path)
pattern = re.compile(REGEX)
requires_list = []
contents = None
with open(full_path) as f:
contents = f.read()

for line in contents.splitlines():
match = pattern.match(line)
if match:
if exclude_version:
requires_list.append(match.group(1))
else:
requires_list.append(match.group())

print('Requires List %r' % requires_list)
return requires_list


setup(
name='timingsclient',
description='Python client for the NPM based timings API (see https://github.com/godaddy/timings)',
url='https://github.com/godaddy/timings-client-py',
author='GoDaddy Operating Company, LLC',
author_email='mverkerk@godaddy.com',
license='MIT',
version='1.0.0',
install_requires=required_packages_list('requirements.txt'),
packages=find_packages(
exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']))
#!/usr/bin/env python
"""Standard PyPi setup file"""
from os import path
import re
from setuptools import setup, find_packages

REGEX = '^([\w\-\.]+)[\s]*([=<>\!]+)[\s]*([0-9\.]+)+(,[<>\!=]+[0-9\.]+)*'


def required_packages_list(file_name, exclude_version=False):
"""Check requirements file"""
parent = path.abspath('.')
if not file_name:
raise RuntimeError('Pass the requirements.txt from where requires '
'list will be generated')
full_path = path.join(parent, file_name)
print("Requirements file %s" % full_path)
pattern = re.compile(REGEX)
requires_list = []
contents = None
with open(full_path) as file:
contents = file.read()

for line in contents.splitlines():
match = pattern.match(line)
if match:
if exclude_version:
requires_list.append(match.group(1))
else:
requires_list.append(match.group())

print('Requires List %r' % requires_list)
return requires_list


setup(
name='timingsclient',
description='Python client for the timings API (see https://github.com/godaddy/timings)',
url='https://github.com/godaddy/timings-client-py',
author='GoDaddy Operating Company, LLC',
author_email='mverkerk@godaddy.com',
license='MIT',
version='1.0.1',
install_requires=required_packages_list('requirements.txt'),
packages=find_packages(
exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']))

0 comments on commit 855afbf

Please sign in to comment.