Skip to content

Commit

Permalink
Merge branch 'release/2.8.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharoon Thomas committed Sep 5, 2013
2 parents c7f25e8 + 6ec3a78 commit 5294030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 85 deletions.
89 changes: 5 additions & 84 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:copyright: (c) 2013 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
from setuptools import setup, Command
from setuptools import setup
import re
import os
import ConfigParser
Expand All @@ -17,80 +17,6 @@
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


class xmltests(Command):
"""Runs the tests and save the result to an XML file
Running this requires unittest-xml-reporting which can
be installed using::
pip install unittest-xml-reporting
"""
description = "Run nosetests with coverage"

user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
import coverage
import xmlrunner
cov = coverage.coverage(source=["trytond.modules.magento"])
cov.start()
from tests import suite
xmlrunner.XMLTestRunner(output="xml-test-results").run(suite())
cov.stop()
cov.save()
cov.xml_report(outfile="coverage.xml")


class run_audit(Command):
"""Audits source code using PyFlakes for following issues:
- Names which are used but not defined or used before they are defined.
- Names which are redefined without having been used.
"""
description = "Audit source code with PyFlakes"
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
import os
import sys
try:
import pyflakes.scripts.pyflakes as flakes
except ImportError:
print "Audit requires PyFlakes installed in your system."
sys.exit(-1)

warns = 0
# Define top-level directories
dirs = ('.')
for dir in dirs:
for root, _, files in os.walk(dir):
if root.startswith(('./build', './doc', './pyenv')):
continue
for file in files:
if not file.endswith(('__init__.py', 'upload.py')) \
and file.endswith('.py'):
warns += flakes.checkPath(os.path.join(root, file))
if warns > 0:
print "Audit finished with total %d warnings." % warns
sys.exit(-1)
else:
print "No problems found in sourcecode."
sys.exit(0)


config = ConfigParser.ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
Expand Down Expand Up @@ -125,11 +51,10 @@ def run(self):
setup(
name='trytond_%s' % module_name,
version=info.get('version', '0.0.1'),
description=info.get('description', ''),
author=info.get('author', ''),
author_email=info.get('email', ''),
url=info.get('website', ''),
download_url='https://github.com/openlabs/trytond-magento.git',
description='Tryton Magento Integration',
author='Openlabs Technologies 7 Consulting (P) Limited',
author_email='info@openlabs.co.in',
url='https://github.com/openlabs/trytond-magento.git',
package_dir={'trytond.modules.%s' % module_name: '.'},
packages=[
'trytond.modules.%s' % module_name,
Expand Down Expand Up @@ -163,9 +88,5 @@ def run(self):
%s = trytond.modules.%s
""" % (module_name, module_name),
test_suite='tests',
cmdclass={
'xmltests': xmltests,
'audit': run_audit,
},
test_loader='trytond.test_loader:Loader',
)
2 changes: 1 addition & 1 deletion tryton.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tryton]
version=2.8.0.1
version=2.8.0.2
depends:
sale
party
Expand Down

0 comments on commit 5294030

Please sign in to comment.