Bug 902125 - Add a version config/flag for Python Marionette. r=dburns

--HG--
extra : commitid : I4bJUgDeGUI
extra : rebase_source : 5e7498834bd35cfc0c6fcffd5135eb4dceddd2c2
This commit is contained in:
Julien Pagès 2015-07-13 18:33:23 +02:00
parent f583ebf23b
commit 1781b3e4cc
3 changed files with 23 additions and 7 deletions

View File

@ -2,6 +2,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
__version__ = '0.16'
from .marionette_test import MarionetteTestCase, MarionetteJSTestCase, CommonTestCase, expectedFailure, skip, SkipTest
from .runner import (
B2GTestCaseMixin,

View File

@ -4,6 +4,7 @@
import sys
from marionette import __version__
from marionette.marionette_test import MarionetteTestCase, MarionetteJSTestCase
from mozlog import structured
from marionette.runner import (
@ -35,7 +36,8 @@ def startTestRunner(runner_class, options, tests):
return runner
def cli(runner_class=MarionetteTestRunner, parser_class=MarionetteOptions):
parser = parser_class(usage='%prog [options] test_file_or_dir <test_file_or_dir> ...')
parser = parser_class(usage='%prog [options] test_file_or_dir <test_file_or_dir> ...',
version='%prog ' + __version__)
structured.commandline.add_logging_group(parser)
options, tests = parser.parse_args()
parser.verify_usage(options, tests)

View File

@ -1,13 +1,23 @@
import os
import re
from setuptools import setup, find_packages
version = '0.16'
# dependencies
with open('requirements.txt') as f:
deps = f.read().splitlines()
THIS_DIR = os.path.dirname(os.path.realpath(__name__))
def read(*parts):
with open(os.path.join(THIS_DIR, *parts)) as f:
return f.read()
def get_version():
return re.findall("__version__ = '([\d\.]+)'",
read('marionette', '__init__.py'), re.M)[0]
setup(name='marionette_client',
version=version,
version=get_version(),
description="Marionette test automation client",
long_description='See http://marionette-client.readthedocs.org/',
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
@ -25,5 +35,5 @@ setup(name='marionette_client',
[console_scripts]
marionette = marionette.runtests:cli
""",
install_requires=deps,
install_requires=read('requirements.txt').splitlines(),
)