Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 706928 - Refactor mozinfo, mozinstall and manifestdestiny to be p…
Browse files Browse the repository at this point in the history
…roper python

modules
  • Loading branch information
ahal-test committed Dec 1, 2011
1 parent b972ac9 commit 3c5d4bf
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 54 deletions.
38 changes: 38 additions & 0 deletions manifestdestiny/manifestparser/__init__.py
@@ -0,0 +1,38 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is manifestdestiny.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2010
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Jeff Hammel <jhammel@mozilla.com> (Original author)
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

from manifestparser import *
Expand Up @@ -1005,49 +1005,6 @@ def __call__(self, options, args):
for command in sorted(commands):
print ' %s : %s' % (command, commands[command].__doc__.strip())

class SetupCLI(CLICommand):
"""
setup using setuptools
"""
# use setup.py from the repo when you want to distribute to python!
# otherwise setuptools will complain that it can't find setup.py
# and result in a useless package

usage = '%prog [options] setup [setuptools options]'

def __call__(self, options, args):
sys.argv = [sys.argv[0]] + args
assert setup is not None, "You must have setuptools installed to use SetupCLI"
here = os.path.dirname(os.path.abspath(__file__))
try:
filename = os.path.join(here, 'README.txt')
description = file(filename).read()
except:
description = ''
os.chdir(here)

setup(name='ManifestDestiny',
version=version,
description="Universal manifests for Mozilla test harnesses",
long_description=description,
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='mozilla manifests',
author='Jeff Hammel',
author_email='jhammel@mozilla.com',
url='https://wiki.mozilla.org/Auto-tools/Projects/ManifestDestiny',
license='MPL',
zip_safe=False,
py_modules=['manifestparser'],
install_requires=[
# -*- Extra requirements: -*-
],
entry_points="""
[console_scripts]
manifestparser = manifestparser:main
""",
)


class UpdateCLI(CLICommand):
"""
update the tests as listed in a manifest from a directory
Expand Down Expand Up @@ -1081,8 +1038,6 @@ def __call__(self, options, args):
'help': HelpCLI,
'update': UpdateCLI,
'write': WriteCLI }
if setup is not None:
commands['setup'] = SetupCLI

def main(args=sys.argv[1:]):
"""console_script entry point"""
Expand Down
35 changes: 33 additions & 2 deletions manifestdestiny/setup.py
Expand Up @@ -41,6 +41,37 @@
# otherwise setuptools will complain that it can't find setup.py
# and result in a useless package

from setuptools import setup, find_packages
import sys
from manifestparser import SetupCLI
SetupCLI(None)(None, sys.argv[1:])
import os

here = os.path.dirname(os.path.abspath(__file__))
try:
filename = os.path.join(here, 'README.txt')
description = file(filename).read()
except:
description = ''

PACKAGE_NAME = "ManifestDestiny"
PACKAGE_VERSION = "0.5.4"

setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description="Universal manifests for Mozilla test harnesses",
long_description=description,
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='mozilla manifests',
author='Jeff Hammel',
author_email='jhammel@mozilla.com',
url='https://github.com/mozilla/mozbase/tree/master/manifestdestiny',
license='MPL',
zip_safe=False,
packages=find_packages(exclude=['legacy']),
install_requires=[
# -*- Extra requirements: -*-
],
entry_points="""
[console_scripts]
manifestparser = manifestparser:main
""",
)
2 changes: 1 addition & 1 deletion mozhttpd/setup.py
Expand Up @@ -36,7 +36,7 @@
# ***** END LICENSE BLOCK *****

import os
from setuptools import setup
from setuptools import setup, find_packages

try:
here = os.path.dirname(os.path.abspath(__file__))
Expand Down
39 changes: 39 additions & 0 deletions mozinfo/mozinfo/__init__.py
@@ -0,0 +1,39 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozinfo.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2010
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Jeff Hammel <jhammel@mozilla.com>
# Clint Talbert <ctalbert@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

from mozinfo import *
File renamed without changes.
5 changes: 2 additions & 3 deletions mozinfo/setup.py
Expand Up @@ -37,7 +37,7 @@


import os
from setuptools import setup
from setuptools import setup, find_packages

version = '0.3.3'

Expand Down Expand Up @@ -65,8 +65,7 @@
author_email='jhammel@mozilla.com',
url='https://wiki.mozilla.org/Auto-tools',
license='MPL',
py_modules=['mozinfo'],
packages=[],
packages=find_packages(exclude=['legacy']),
include_package_data=True,
zip_safe=False,
install_requires=deps,
Expand Down
38 changes: 38 additions & 0 deletions mozinstall/mozinstall/__init__.py
@@ -0,0 +1,38 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozinstall.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Clint Talbert <ctalbert@mozilla.com>
# Andrew Halberstadt <halbersa@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
from mozinstall import *
File renamed without changes.
5 changes: 2 additions & 3 deletions mozinstall/setup.py
Expand Up @@ -37,7 +37,7 @@
# ***** END LICENSE BLOCK *****

import os
from setuptools import setup
from setuptools import setup, find_packages

try:
here = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -66,8 +66,7 @@
author_email='mdas@mozilla.com',
url='https://github.com/mozilla/mozbase',
license='MPL',
py_modules=['mozinstall'],
packages=[],
packages=find_packages(exclude=['legacy']),
include_package_data=True,
zip_safe=False,
install_requires=deps,
Expand Down

0 comments on commit 3c5d4bf

Please sign in to comment.