Update with parsing of a requirments file, changelog for this new refactoring stuff and setup.py for both of those.
This commit is contained in:
parent
54435c2557
commit
473cc39708
|
@ -1,3 +1,5 @@
|
|||
0.7.0:
|
||||
- Huge refactor [Joshua Harlow]
|
||||
0.6.4:
|
||||
- support relative path in AuthorizedKeysFile (LP: #970071).
|
||||
0.6.3:
|
||||
|
|
66
setup.py
66
setup.py
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/python
|
||||
# vi: ts=4 expandtab
|
||||
#
|
||||
# Distutils magic for ec2-init
|
||||
#
|
||||
# Copyright (C) 2009 Canonical Ltd.
|
||||
# Copyright (C) 2012 Yahoo! Inc.
|
||||
#
|
||||
# Author: Soren Hansen <soren@canonical.com>
|
||||
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3, as
|
||||
|
@ -17,24 +19,59 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from distutils.core import setup
|
||||
|
||||
from glob import glob
|
||||
import os.path
|
||||
import subprocess
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from distutils.core import setup
|
||||
from setuptools import find_packages
|
||||
|
||||
|
||||
def is_f(p):
|
||||
return(os.path.isfile(p))
|
||||
return os.path.isfile(p)
|
||||
|
||||
|
||||
def versions(fn="ChangeLog"):
|
||||
with open(fn, 'r') as fh:
|
||||
lines = fh.read().splitlines()
|
||||
versions = []
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if line.startswith("-") or not line:
|
||||
continue
|
||||
if not re.match(r"[\d]", line):
|
||||
continue
|
||||
line = line.strip(":")
|
||||
if (re.match(r"^[\d+]\.[\d+]\.[\d+]$", line) or
|
||||
re.match(r"^[\d+]\.[\d+]$", line)):
|
||||
versions.append(line)
|
||||
return versions
|
||||
|
||||
|
||||
def requires(fn='Requires'):
|
||||
requires = []
|
||||
with open(fn, 'r') as fh:
|
||||
lines = fh.read().splitlines()
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if not line or line[0] == '#':
|
||||
continue
|
||||
else:
|
||||
requires.append(line)
|
||||
return requires
|
||||
|
||||
|
||||
setup(name='cloud-init',
|
||||
version='0.6.3',
|
||||
version=versions()[0],
|
||||
description='EC2 initialisation magic',
|
||||
author='Scott Moser',
|
||||
author_email='scott.moser@canonical.com',
|
||||
url='http://launchpad.net/cloud-init/',
|
||||
packages=['cloudinit', 'cloudinit.CloudConfig' ],
|
||||
scripts=['cloud-init.py',
|
||||
'cloud-init-cfg.py',
|
||||
packages=find_packages(),
|
||||
scripts=['bin/cloud-init.py',
|
||||
'bin/cloud-init-cfg.py',
|
||||
'tools/cloud-init-per',
|
||||
],
|
||||
data_files=[('/etc/cloud', glob('config/*.cfg')),
|
||||
|
@ -42,11 +79,12 @@ setup(name='cloud-init',
|
|||
('/etc/cloud/templates', glob('templates/*')),
|
||||
('/etc/init', glob('upstart/*.conf')),
|
||||
('/usr/share/cloud-init', []),
|
||||
('/usr/lib/cloud-init',
|
||||
('/usr/lib/cloud-init',
|
||||
['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
|
||||
('/usr/share/doc/cloud-init', filter(is_f,glob('doc/*'))),
|
||||
('/usr/share/doc/cloud-init/examples', filter(is_f,glob('doc/examples/*'))),
|
||||
('/usr/share/doc/cloud-init/examples/seed', filter(is_f,glob('doc/examples/seed/*'))),
|
||||
('/usr/share/doc/cloud-init', filter(is_f, glob('doc/*'))),
|
||||
('/usr/share/doc/cloud-init/examples', filter(is_f, glob('doc/examples/*'))),
|
||||
('/usr/share/doc/cloud-init/examples/seed', filter(is_f, glob('doc/examples/seed/*'))),
|
||||
('/etc/profile.d', ['tools/Z99-cloud-locale-test.sh']),
|
||||
],
|
||||
install_requires=requires(),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue