diff --git a/Readme-Hacking.txt b/Readme-Hacking.txt index 70d310be..c6c9c933 100644 --- a/Readme-Hacking.txt +++ b/Readme-Hacking.txt @@ -9,32 +9,6 @@ This file is not completed now - any might be in future. There are some mandatory tools to do development for rmtoo: Debian 6: $ apt-get install make graphviz texlive-latex-extra -** Eclipse - For development of the source code, eclipse is used. - This has some advantages about the emacs / vi approach - especially - automated style and lint checking. - -*** OpenJDK - Install the openjdk to use for eclipse - only JRE is needed. - Debian 6: $ apt-get install openjdk-6-jre - -*** Eclipse - Goto http://www.eclipse.org/ and install latest version. - Be sure to use the non Java, non C++ version. - -*** PyDev - Goto http://pydev.org and install the latest version. - -*** PyLint - Install pylint - Debian 6: $ apt-get install pylint - In Eclipse goto: Preferences -> PyDev -> PyLint and enable pylint. - -*** PyUnit - In Eclipse goto: Preferences -> PyUnit and choose Nose Test runner. - - - * Testing ** Comparing XML @@ -61,28 +35,6 @@ This file is not completed now - any might be in future. It is defined that not only the (sub-) nodes should be equal but also the order in which they appear. -*** External Libraries - For some outputs external libraries are used. - -**** odfpy-svn20100810 - This is the currently used version. This is the latest known - working version which works with OpenOffice using the automatic - generated odf documents. - The problem with this library is, that the order of (sub-)nodes - is arbitrary and even some (intermediate) nodes can be named - different when using another computer. - Therefore it is mostly not possible to do a simple xml comparison - to check if documents are equal. - -**** odfpy-0.9.3 - This version does not support creating ODF files which are - generated by OpenOffice 3.2 (which is somewhat strange). - -*** Current 'solution' - Because of the problems comparing automated created XML documents, - the check is only done for the directly generated files. - - * Forks There are a couple of forks done during the last years; have a look diff --git a/Readme.rst b/Readme.rst index 83efe9ea..551ce737 100644 --- a/Readme.rst +++ b/Readme.rst @@ -84,7 +84,7 @@ Dependencies To use rmtoo, other software packages must be installed. rmtoo is written in python. At least version 2.7 of python is needed. -(Starting with version 24 python 3 will be supported.) +Starting with version 24 python >3.4 is also supported. When you want to create LaTeX or PDF documentation, LaTeX is needed. @@ -101,11 +101,7 @@ First Project The recommended way of starting is to copy the provided template project. -Using the provided template projects depends whether you use the deb -package or the tar package. Please consult the appropriate sections -how to use the template project. - -Nevertheless the basic steps are: +The basic steps are: 1) Copy over the template project to some other directory. 2) Set up the environment @@ -117,8 +113,8 @@ Note that during this document the project will be called 'MyNewProject'. Please adapt the name for your needs. -Using virtualenv -================ +Installation using virtualenv / pip +=================================== This is the preferred installation method - it takes care that at least the python dependencies are correctly installed. @@ -137,52 +133,40 @@ To install ``rmtoo`` in a virtualenv, execute the following steps: $ pip install --upgrade pip setuptools wheel $ pip install --only-binary=numpy,scipy numpy scipy $ pip install rmtoo - $ export RMTOO_CONTRIB=${PWD}/venv/rmtoo/contrib -Please see the section 'First Project' how to use the template -project. +This has only to be done once. - -Using tar package -================= +First Project +============= Installation ------------ -Just untar the downloaded package. You need not to be root to do -this. -Change to the directory where you want to install rmtoo to. -To refer to the current directory, it is called RMTOO_BASE_PATH. +Change to a directory where you want to create the new project. This +is needed only once. .. code:: bash - $ export RMTOO_BASE_PATH=$PWD - $ export RMTOO_PATH=${RMTOO_BASE_PATH}/rmtoo-YY - $ export RMTOO_CONTRIB=${RMTOO_PATH}/contrib - $ tar -xf rmtoo-YY.tar.gz - -To use rmtoo, you have to include -``${RMTOO_PATH}/bin`` to your path, include -``${RMTOO_PATH}`` to your ``PYTHONPATH``. -When you use the template project (see section 'First Project' some -lines below), the shell script ``setenv.sh`` is doing this for you. + # cd to virtualenv directory - if not already there + $ cd RMTOO + $ cp -r venv/rmtoo/contrib/template_project MyNewProject -First Project -============= +Usage +----- -Change to a directory where you want to create the new project. In -the following code, please replace ``${RMTOO_PATH}`` with ``VENV`` if -you are using virtualenv. +To create all the artifacts for the template project, execute .. code:: bash - $ cp -r ${RMTOO_CONTRIB}/template_project MyNewProject $ cd MyNewProject - $ source ./setenv.sh ${RMTOO_PATH} + $ source ./setenv.sh VENV $ make $ ls artifacts In the artifacts directory there are all the generated files. +A typical workflow is, to change or add requirements, topics or the +configuration in the ``MyNewProject`` directory, run ``make`` again +and check the artifacts. Man Pages ========= @@ -212,9 +196,7 @@ Additional Documentation ------------------------ Additional documentation can be found in the directories -``${RMTOO_PATH}/rmtoo-YY`` (especially the Readme files) -``${RMTOO_PATH}/rmtoo-YY/doc/other``. When using ``VENV`` the -documentation is stored in ``venv/rmtoo/doc``. +``RMTOO/venv/rmtoo/doc`` (especially the Readme files). Other Documentation =================== @@ -262,8 +244,8 @@ Emacs Mode for Editing Requirements When using the tar package, emacs mode can be loaded in emacs by: ``M-x load-file`` -point to ``${RMTOO_BASE_PATH}/rmtoo-YY/contrib/req-mode.el`` -All files with suffix .req will now use the requirements editing +point to ``RMTOO/venv/rmtoo/contrib/req-mode.el`` +All files with suffix ``.req`` will now use the requirements editing mode. Footer diff --git a/doc/release_notes/24.rst b/doc/release_notes/24.rst new file mode 100644 index 00000000..e1bdf42b --- /dev/null +++ b/doc/release_notes/24.rst @@ -0,0 +1,37 @@ +IMPORTANT +========= + +CONFIGURATION IS UNDERGOING A MAJOR RESTRUCTURING. +THE CURRENT VERSIONS (V22-V24) WILL (ONLY) BE ONE STEP IN THE +DIRECTION THE CONFIGURATION WILL CHANGE TO. +BECAUSE THE STRUCTURE CHANGED, THERE IS NO AUTOMATIC UPDATE +POSSIBLE. +IF YOU HAVE A RUNNING INSTALLED rmtoo THERE IS NO NEED TO UPDATE +DIRECTLY (IF YOU DO NOT NEED ANY OF THE NEW FEATURES). +IF YOU WANT TO USE THE NEW FEATURES, PLEASE FIRST READ THE +DOCUMENTATION (rmtoo-config3(5)). IF YOU HAVE PROBLEMS WITH THIS +FEEL FREE TO CONTACT OUR SUPPORT AT rmtoo@florath.net + + +24.0.0 +====== + +User visible changes +-------------------- + +* Support for python3. +* Support for virtualenv. +* Support for installation with pip (pypi). +* Removed dependency to legacy included versions of other projects + (async, git, gitdb, odfpy). +* Complete support for UTF-8. + + +Internal Changes +---------------- + +* Started pep8 cleanup: many small syntax changes. +* Introduced tox, clean up setup.py, introduced requirements.txt. +* Many, many code cleanups. +* CI / quality checks added: codecov.io, sonarqube.com, covertity, + codeclimate.com diff --git a/doc/release_notes/24.txt b/doc/release_notes/24.txt deleted file mode 100644 index 9c382a1a..00000000 --- a/doc/release_notes/24.txt +++ /dev/null @@ -1,32 +0,0 @@ -********************************************************************** -* CONFIGURATION IS UNDERGOING A MAJOR RESTRUCTURING. * -* THE CURRENT VERSIONS (V22-V24) WILL (ONLY) BE ONE STEP IN THE * -* DIRECTION THE CONFIGURATION WILL CHANGE TO. * -* BECAUSE THE STRUCTURE CHANGED, THERE IS NO AUTOMATIC UPDATE * -* POSSIBLE. * -* IF YOU HAVE A RUNNING INSTALLED rmtoo THERE IS NO NEED TO UPDATE * -* DIRECTLY (IF YOU DO NOT NEED ANY OF THE NEW FEATURES). * -* IF YOU WANT TO USE THE NEW FEATURES, PLEASE FIRST READ THE * -* DOCUMENTATION (rmtoo-config3(5)). IF YOU HAVE PROBLEMS WITH THIS * -* FEEL FREE TO CONTACT OUR SUPPORT AT rmtoo@florath.net * -********************************************************************** - -User visible changes --------------------- - -Support for python3. - -Removed dependency to legacy included versions of other projects -(async, git, gitdb, odfpy). - -Complete support for UTF-8. - - -Internal Changes ----------------- - -Started pep8 cleanup: many small syntax changes. - -Introduced tox, clean up setup.py, introduced requirements.txt. - -Many, many code cleanups. diff --git a/rmtoo/__init__.py b/rmtoo/__init__.py index ccd8e2cf..030f9281 100644 --- a/rmtoo/__init__.py +++ b/rmtoo/__init__.py @@ -1,19 +1,11 @@ -# -# rmtoo __init__.py -# -# (c) 2010,2017 by flonatel (rmtoo@florath.net) -# -# For licensing details see COPYING -# +''' + rmtoo + Free and Open Source Requirements Management Tool -__package__ = "rmtoo" -__all__ = ["modules", "lib", "tests", "outputs"] + Master __init__.py -# -# Add shared library path to sys.path -# -import os -import sys -sys.path.append(os.path.join(os.path.split(__file__)[0], sys.platform)) -del os -del sys + (c) 2011,2017 by flonatel GmbH & Co. KG + + For licensing details see COPYING +''' +__all__ = ["inputs", "lib", "tests", "outputs"] diff --git a/rmtoo/lib/RequirementSet.py b/rmtoo/lib/RequirementSet.py index f605ecd7..1ca9b3f1 100644 --- a/rmtoo/lib/RequirementSet.py +++ b/rmtoo/lib/RequirementSet.py @@ -616,35 +616,39 @@ def get_testcases(self): # Note: the following methods are of no use any more, # because the 'Solved by' will be gone in near future. + def __normalize_dependencies_one_req(self, req): + # Remove the old 'Depends on' + req.record.remove("Depends on") + + # Create the list of dependencies + onodes = [] + for n in req.outgoing: + onodes.append(n.name) + + # If the onodes is empty: There must no old 'Solved by' + # tag available - if so something completey strange has + # happens and it is better to stop directly. + if len(onodes) == 0: + assert not req.record.is_tag_available("Solved by") + # Looks that everything is ok: continue + return + + onodes.sort() + on = " ".join(onodes) + + # Check if there is already a 'Solved by' + try: + req.record.set_content("Solved by", on) + except ValueError: + req.record.append(RecordEntry( + u"Solved by", on, + u"Added by rmtoo-normalize-dependencies")) + return + def normalize_dependencies(self): '''Normalize the dependencies to 'Depends on'.''' for r in itervalues(self.__requirements): - # Remove the old 'Depends on' - r.record.remove("Depends on") - - # Create the list of dependencies - onodes = [] - for n in r.outgoing: - onodes.append(n.name) - - # If the onodes is empty: There must no old 'Solved by' - # tag available - if so something completey strange has - # happens and it is better to stop directly. - if len(onodes) == 0: - assert(not r.record.is_tag_available("Solved by")) - # Looks that everything is ok: continue - continue - - onodes.sort() - on = " ".join(onodes) - - # Check if there is already a 'Solved by' - try: - r.record.set_content("Solved by", on) - except ValueError: - r.record.append(RecordEntry( - u"Solved by", on, - u"Added by rmtoo-normalize-dependencies")) + self.__normalize_dependencies_one_req(r) return True def write_to_filesystem(self, directory): diff --git a/rmtoo/tests/RMTTest-Blackbox/RMTTest-BB001/RMTTest-BB001.py b/rmtoo/tests/RMTTest-Blackbox/RMTTest-BB001/RMTTest-BB001.py index 69238bad..d7915988 100644 --- a/rmtoo/tests/RMTTest-Blackbox/RMTTest-BB001/RMTTest-BB001.py +++ b/rmtoo/tests/RMTTest-Blackbox/RMTTest-BB001/RMTTest-BB001.py @@ -8,9 +8,9 @@ For licensing details see COPYING ''' - import os import time +import unittest from rmtoo.lib.RmtooMain import main_impl from rmtoo.tests.lib.BBHelper import prepare_result_is_dir, \ @@ -21,7 +21,7 @@ mdir = "tests/RMTTest-Blackbox/RMTTest-BB001" -class RMTTestBB001: +class RMTTestBB001(unittest.TestCase): def rmttest_pos_001(self): "BB Basic with one requirement - reqs only from git" diff --git a/rmtoo/tests/RMTTest-Unit/RMTTest-Core/RMTTest-StringHelper.py b/rmtoo/tests/RMTTest-Unit/RMTTest-Core/RMTTest-StringHelper.py index 04a4cb7c..53d92c3b 100644 --- a/rmtoo/tests/RMTTest-Unit/RMTTest-Core/RMTTest-StringHelper.py +++ b/rmtoo/tests/RMTTest-Unit/RMTTest-Core/RMTTest-StringHelper.py @@ -1,27 +1,28 @@ -# -# rmtoo -# Free and Open Source Requirements Management Tool -# -# Unit test for StringHelper -# -# (c) 2011,2017 on flonatel -# -# For licencing details see COPYING -# +''' + rmtoo + Free and Open Source Requirements Management Tool + + Unit test for StringHelper + + (c) 2011,2017 by flonatel GmbH & Co. KG + + For licensing details see COPYING +''' +import unittest from rmtoo.lib.StringHelper import StringHelper -class RMTTestStringHelper: +class RMTTestStringHelper(unittest.TestCase): def rmttest_pos_01(self): "StringHelper.join_ate with elements" s = StringHelper.join_ate("-", ["a", "b", "c", "d"]) - assert s == "a-b-c-d-" + self.assertEqual("a-b-c-d-", s) def rmttest_pos_02(self): "StringHelper.join_ate empty list" s = StringHelper.join_ate("-", []) - assert s == "" + self.assertEqual("", s) diff --git a/setup.py b/setup.py index 93aa5ed2..09572bc8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import sys package = 'rmtoo' -version = '23.90.2' +version = '24.0.0' add_data = []