aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-03-08 22:45:11 +0100
committerMatěj Cepl <mcepl@redhat.com>2012-03-08 22:45:11 +0100
commitbf17bdcec33de1b1218849134ed7ae468f75e946 (patch)
treeaad1799ae677c832db3a07f14139175f80d82e42
parent8b7616af6e43a0bce728aa43aa987c3b19d3cbba (diff)
downloadyamlish-bf17bdcec33de1b1218849134ed7ae468f75e946.tar.gz
Initial version uploaded to the Cheeseshop.0.2
-rw-r--r--.gitignore4
-rw-r--r--NEWS.txt7
-rw-r--r--README6
-rw-r--r--README.txt13
-rw-r--r--setup.py63
-rw-r--r--test/__init__.py10
-rw-r--r--yamlish.py2
7 files changed, 88 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 7471e64..4ceff34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*.py[ocw]
*~
-pyyaml/upstream-repo/
+MANIFEST
+build/
+dist/
diff --git a/NEWS.txt b/NEWS.txt
new file mode 100644
index 0000000..9607e2e
--- /dev/null
+++ b/NEWS.txt
@@ -0,0 +1,7 @@
+0.1 2012-03-08
+ * Initial version: tests succeed
+
+0.2 2012-03-08
+ * Just a packaging issue, don't play with strings too much in setup.py
+ version=yamlish.__version__ and that's it. No fancy formatting.
+ \ No newline at end of file
diff --git a/README b/README
deleted file mode 100644
index 0f580f9..0000000
--- a/README
+++ /dev/null
@@ -1,6 +0,0 @@
-Based on Data-YAML version 0.0.6 (Copyright (C) 2007, Andy Armstrong), but it
-is so thoroughly rewritten that I don't consider it derived work and I don't
-feel the need to resolve what "This library is free software; you can
-redistribute it and/or modify it under the same terms as Perl itself." actually
-means.
-
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..698f5de
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,13 @@
+YAMLish is a small subset of YAML that TAP producers may use to embed machine readable
+information in TAP diagnostics. See TAP diagnostic syntax for information about how
+YAMLish embeds in TAP.
+
+----------------------------
+Based on Data-YAML version 0.0.6 (Copyright (C) 2007, Andy Armstrong), but it
+is so thoroughly rewritten that I don't consider it derived work and I don't
+feel the need to resolve what "This library is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself." actually
+means.
+
+Whole this package is licensed under MIT/X11 license (see header of yamlish.py
+for details).
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..9dad10d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,63 @@
+# coding: utf-8
+from __future__ import absolute_import, print_function, unicode_literals
+from distutils.core import setup, Command
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+import os.path
+import yamlish
+
+class RunTests(Command):
+ """New setup.py command to run all tests for the package.
+ """
+ description = "run all tests for the package"
+
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ loader = unittest.TestLoader()
+ loader.discover('.')
+ suite = loader.suiteClass()
+ result = unittest.TestResult()
+ suite.run(result)
+
+def read(fname):
+ with open(os.path.join(os.path.dirname(__file__), fname)) as inf:
+ return "\n" + inf.read().replace("\r\n", "\n")
+ # private
+
+def get_long_description():
+ return read("README.txt") \
+ + "\nChangelog:\n" + "=" * 10 + "\n" \
+ + read("NEWS.txt")
+
+setup(
+ name='yamlish',
+ version=yamlish.__version__,
+ description='Python implementation of YAMLish',
+ author='Matej Cepl',
+ author_email='mcepl@redhat.com',
+ url='https://gitorious.org/yamlish',
+ py_modules=['yamlish'],
+ long_description=get_long_description(),
+ keywords=['TAP', 'YAML', 'yamlish'],
+ cmdclass={'test': RunTests},
+ classifiers=[
+ "Programming Language :: Python",
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: Information Technology",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Text Processing :: Markup",
+ ]
+)
+
diff --git a/test/__init__.py b/test/__init__.py
index 1ebe41b..cf6dcde 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -7,7 +7,6 @@ import yaml
import tempfile
import textwrap
from textwrap import dedent
-logging.basicConfig(level=logging.INFO)
INPUT = 1
OUTPUT = 2
@@ -28,9 +27,6 @@ def _create_input_test(test_src, tested_function):
Execute a test by calling a tested_function on test_src data.
"""
self.maxDiff = None
- if ('skip' in test_src) and test_src['skip']:
- logging.info("test_src skipped!")
- return
got = ""
if 'error' in test_src:
@@ -58,10 +54,6 @@ def _create_output_test(test_src, tested_function):
Execute a test by calling a tested_function on test_src data.
"""
self.maxDiff = None
- if ('skip' in test_src) and test_src['skip']:
- logging.info("test_src skipped!")
- return
-
# We currently don't throw any exceptions in Writer, so this
# this is always false
@@ -89,7 +81,7 @@ def generate_testsuite(test_data, test_case_shell, test_fce, direction=INPUT):
"""
for in_test in test_data:
if ('skip' in in_test) and in_test['skip']:
- logging.info("test %s skipped!", in_test['name'])
+ logging.debug("test %s skipped!", in_test['name'])
continue
name = _generate_test_name(in_test['name'])
if direction == INPUT:
diff --git a/yamlish.py b/yamlish.py
index fda3f74..e3a9061 100644
--- a/yamlish.py
+++ b/yamlish.py
@@ -113,7 +113,7 @@ Read more about TAP and YAMLish here: L<http://testanything.org/wiki>
import logging
import yaml
-__version__ = "0.1"
+__version__ = "0.2"
__author__ = "Matěj Cepl <mcepl_at_redhat_dot_com>"
class _YamlishLoader(yaml.loader.SafeLoader):