[med-svn] [Git][med-team/python-easydev][master] 9 commits: Fix watch file

Andreas Tille gitlab at salsa.debian.org
Wed Jan 9 16:16:42 GMT 2019


Andreas Tille pushed to branch master at Debian Med / python-easydev


Commits:
ece40df1 by Andreas Tille at 2019-01-09T15:47:26Z
Fix watch file

- - - - -
13c5498f by Andreas Tille at 2019-01-09T15:47:47Z
New upstream version 0.9.37
- - - - -
2f467fae by Andreas Tille at 2019-01-09T15:47:47Z
Update upstream source from tag 'upstream/0.9.37'

Update to upstream version '0.9.37'
with Debian dir 649ce69d20c65b254b0f03b8dd71daa5dd817bad
- - - - -
2e355ec6 by Andreas Tille at 2019-01-09T15:47:47Z
New upstream version

- - - - -
c1d5723e by Andreas Tille at 2019-01-09T15:47:47Z
debhelper 11

- - - - -
97f9200b by Andreas Tille at 2019-01-09T15:52:51Z
Activate Testsuite field

- - - - -
4605f41d by Andreas Tille at 2019-01-09T15:55:14Z
Point Vcs fields to salsa.debian.org

- - - - -
13ce6875 by Andreas Tille at 2019-01-09T15:55:14Z
Standards-Version: 4.3.0

- - - - -
86679fcb by Andreas Tille at 2019-01-09T15:55:15Z
Remove trailing whitespace in debian/copyright

- - - - -


15 changed files:

- PKG-INFO
- README.rst
- debian/changelog
- debian/compat
- debian/control
- debian/copyright
- debian/watch
- easydev/__init__.py
- easydev/config_tools.py
- easydev/logging_tools.py
- easydev/misc.py
- easydev/timer.py
- setup.cfg
- setup.py
- test/test_url.py


Changes:

=====================================
PKG-INFO
=====================================
@@ -1,12 +1,13 @@
 Metadata-Version: 1.1
 Name: easydev
-Version: 0.9.35
+Version: 0.9.37
 Summary: Common utilities to ease the development of Python packages
 Home-page: ['http://packages.python.org/easydev/']
 Author: Thomas Cokelaer
 Author-email: cokelaer at ebi.ac.uk
 License: new BSD
 Download-URL: ['http://pypi.python.org/pypi/easydev']
+Description-Content-Type: UNKNOWN
 Description: easydev
         ##########
         
@@ -28,7 +29,7 @@ Description: easydev
         :contributions: Please join https://github.com/cokelaer/easydev
         :source: Please use https://github.com/cokelaer/easydev
         :issues: Please use https://github.com/cokelaer/easydev/issues
-        :Python version supported: 2.6, 2.7, 3.3, 3.4, 3.5, 3.6
+        :Python version supported: 2.7, 3.3, 3.4, 3.5, 3.6
         
         
         The  `easydev <http://pypi.python.org/pypi/easydev/>`_ package 


=====================================
README.rst
=====================================
@@ -19,7 +19,7 @@ easydev
 :contributions: Please join https://github.com/cokelaer/easydev
 :source: Please use https://github.com/cokelaer/easydev
 :issues: Please use https://github.com/cokelaer/easydev/issues
-:Python version supported: 2.6, 2.7, 3.3, 3.4, 3.5, 3.6
+:Python version supported: 2.7, 3.3, 3.4, 3.5, 3.6
 
 
 The  `easydev <http://pypi.python.org/pypi/easydev/>`_ package 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+python-easydev (0.9.37-1) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Fix watch file
+  * debhelper 11
+  * Activate Testsuite field
+  * Point Vcs fields to salsa.debian.org
+  * Standards-Version: 4.3.0
+  * Remove trailing whitespace in debian/copyright
+
+ -- Andreas Tille <tille at debian.org>  Wed, 09 Jan 2019 16:45:57 +0100
+
 python-easydev (0.9.35+dfsg-2) unstable; urgency=medium
 
   * Correct ITP bug number in previous changelog entry


=====================================
debian/compat
=====================================
@@ -1 +1 @@
-9
+11


=====================================
debian/control
=====================================
@@ -1,36 +1,32 @@
 Source: python-easydev
-Section: python
-Priority: optional
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Afif Elghraoui <afif at debian.org>
-Build-Depends:
-	debhelper (>= 9),
-	dh-python,
-	python-all,
-	python-setuptools,
-	python-appdirs,
-	python-colorama,
-	python-pexpect,
-	python-appdirs,
-	python3-all,
-	python3-setuptools,
-	python3-appdirs,
-	python3-colorama,
-	python3-pexpect,
-	python3-appdirs,
-Standards-Version: 4.1.3
+Section: python
+Testsuite: autopkgtest-pkg-python
+Priority: optional
+Build-Depends: debhelper (>= 11~),
+               dh-python,
+               python-all,
+               python-setuptools,
+               python-appdirs,
+               python-colorama,
+               python-pexpect,
+               python3-all,
+               python3-setuptools,
+               python3-appdirs,
+               python3-colorama,
+               python3-pexpect
+Standards-Version: 4.3.0
+Vcs-Browser: https://salsa.debian.org/med-team/python-easydev
+Vcs-Git: https://salsa.debian.org/med-team/python-easydev.git
 Homepage: https://easydev-python.readthedocs.io/en/latest/
-Vcs-Git: https://anonscm.debian.org/git/debian-med/python-easydev.git
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/python-easydev.git
-#Testsuite: autopkgtest-pkg-python
 
 Package: python-easydev
 Architecture: all
-Depends:
-	${python:Depends},
-	${misc:Depends},
-	python-pkg-resources,
-	python-appdirs,
+Depends: ${python:Depends},
+         ${misc:Depends},
+         python-pkg-resources,
+         python-appdirs
 Description: common utilities to ease the development of Python packages (Python 2)
  The package easydev provides miscellaneous functions that are often used in
  other Python packages. easydev should help developers in speeding up their
@@ -40,11 +36,10 @@ Description: common utilities to ease the development of Python packages (Python
 
 Package: python3-easydev
 Architecture: all
-Depends:
-	${python3:Depends},
-	${misc:Depends},
-	python3-pkg-resources,
-	python3-appdirs,
+Depends: ${python3:Depends},
+         ${misc:Depends},
+         python3-pkg-resources,
+         python3-appdirs
 Description: common utilities to ease the development of Python packages (Python 3)
  The package easydev provides miscellaneous functions that are often used in
  other Python packages. easydev should help developers in speeding up their


=====================================
debian/copyright
=====================================
@@ -86,15 +86,15 @@ License: BSD-3-Clause/SKL
     this software without specific prior written permission.
  .
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE HOLDERS OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 License: GPL-3.0


=====================================
debian/watch
=====================================
@@ -1,5 +1,3 @@
 version=4
 
-# releases on github don't keep up with pypi, but
-# pypi.debian.net seems to be down
-#https://pypi.debian.net/python-easydev/python-easydev-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+https://pypi.python.org/simple/easydev .*/easydev- at ANY_VERSION@@ARCHIVE_EXT@#sha256=.*


=====================================
easydev/__init__.py
=====================================
@@ -18,13 +18,17 @@
 from __future__ import print_function
 #from __future__ import absolute_import
 
-__version__ = "0.9.34"
 
-import pkg_resources
+__version__ = "0.9.36"
 try:
-    version = pkg_resources.require("easydev")[0].version
-except:
+    import pkg_resources
+except ImportError as err:
+    print(err)
+    print("version set to {} manually.".format(__version__))
     version = __version__
+else:
+    version = pkg_resources.require("easydev")[0].version
+    __version__ = version
 
 from . import browser
 from .browser import browse as onweb


=====================================
easydev/config_tools.py
=====================================
@@ -98,9 +98,11 @@ class ConfigExample(object):
 
 
     which can be read with ConfigParser as follows:
-    .. code-block:: python
 
-        >>> from ConfigParser import ConfigParser
+    .. doctest::
+
+        >>> # Python 3 code
+        >>> from configparser import ConfigParser
         >>> config = ConfigParser()
         >>> config.read("file.ini")
         []
@@ -133,13 +135,13 @@ class DynamicConfigParser(ConfigParser, object):
 
     You can now also directly access to an option as follows::
 
-        >>> c.General.tag
+        c.General.tag
 
     Then, you can add or remove sections (:meth:`remove_section`, :meth:`add_section`),
     or option from a section :meth:`remove_option`. You can save the instance into a file
     or print it::
 
-        >>> print(c)
+        print(c)
 
     .. warning:: if you set options manually (e.G. self.GA.test =1 if GA is a
         section and test one of its options), then the save/write does not work
@@ -231,8 +233,9 @@ class DynamicConfigParser(ConfigParser, object):
         Let us build up  a standard config file:
         .. code-block:: python
 
-            >>> import ConfigParser
-            >>> c = ConfigParser.ConfigParser()
+            >>> # Python 3 code
+            >>> from configparser import ConfigParser
+            >>> c = ConfigParser()
             >>> c.add_section('general')
             >>> c.set('general', 'step', str(1))
             >>> c.set('general', 'verbose', 'True')


=====================================
easydev/logging_tools.py
=====================================
@@ -14,77 +14,98 @@
 #
 ##############################################################################
 import logging
+import colorlog
 
 __all__ = ["Logging"]
 
 
-class Logging(object):
-    """logging utility.
+colors = {
+    'DEBUG':    'cyan',
+    'INFO':     'green',
+    'WARNING':  'yellow',
+    'ERROR':    'red',
+    'CRITICAL': 'bold_red'}
 
-    When using the logging utility, it works like a singleton.
-    So, once logging level is set, you cannot set it again easily.
-    Here is a class that allows to do that.
 
-    .. warning:: this is a bit of a hack. Maybe this is not a proper solution but
-        it seems to do the job.
+
+class Logging(object):
+    """logging utility.
 
     ::
 
-        >>> l = Logging("INFO")
+        >>> l = Logging("root", "INFO")
         >>> l.info("test")
         INFO:root:test
         >>> l.level = "WARNING"
         >>> l.info("test")
 
-
     """
-    # I think that we can not inherit from logging.
-    def __init__(self, level):
-        """.. rubric:: constructor
-
-        :param str level: valid levels are ["INFO", "DEBUG", "WARNING",
-            "CRITICAL", "ERROR"]. If set to True, level is internally set to
-            INFO. If set to False, level is seet internally to ERROR.
-        """
-        self._debugLevel = None
-        self.debugLevel = level
-        self.logging = logging
-        self.info = logging.info
-        self.warning = logging.warning
-        self.critical = logging.critical
-        self.error = logging.error
-        self.debug = logging.debug
+    def __init__(self, name="root", level="WARNING"):
+        self.name = name
+        formatter = colorlog.ColoredFormatter(
+             "%(log_color)s%(levelname)-8s[%(name)s]: %(reset)s %(blue)s%(message)s",
+             datefmt=None,
+             reset=True,
+             log_colors=colors,
+             secondary_log_colors={},
+             style='%'
+        )
+        handler = colorlog.StreamHandler()
+        handler.setFormatter(formatter)
+        logger = colorlog.getLogger(self.name)
+        if len(logger.handlers) == 0:
+            logger.addHandler(handler)
+            self._set_level(level)
 
     def _set_level(self, level):
-        valid_level = [True, False, "INFO", "DEBUG", "WARNING", "CRITICAL", "ERROR"]
-        if level is True:
-            level = "INFO"
-        if level is False:
-            level = "ERROR"
-        if level in valid_level:
-            self._debugLevel = level
-        else:
-            raise ValueError("The level of debugging must be in %s " %valid_level)
-        # I'm not sure this is the best solution, but basicConfig can be called
-        # only once and populatse root.handlers list with one instance of
-        # logging.StreamHandler. So, I reset it before calling basicConfig
-        # that effectively changes the logging behaviour
-        logging.root.handlers = []
-        logging.basicConfig(level=self._debugLevel)
+        if isinstance(level, bool):
+            if level is True:
+                level = "INFO"
+            if level is False:
+                level = "ERROR"
+        assert level in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
+        logging_level = getattr(colorlog.logging.logging, level)
+        colorlog.getLogger(self.name).setLevel(level)
+
     def _get_level(self):
-        return self._debugLevel
-    debugLevel = property(_get_level, _set_level,
-        doc="Read/Write access to the debug level. Must be one of INFO, " + \
-            "DEBUG, WARNING, CRITICAL, ERROR")
-    level = property(_get_level, _set_level,
-        doc="alias to :attr:`~easydev.logging_tools.Logging.debugLevel` (Read-only access)")
-
-    # Used copy/deepcopy module
-    def __copy__(self):
-        print("WARNING: easydev.logging_tools.__copy__ deprecated. use copy() instead")
-        s = Logging(self.level)
-        return s
-
-    def __deepcopy__(self, memo):
-        s = Logging(self.level)
-        return s
+        level = colorlog.getLogger(self.name).level
+        if level == 10:
+            return "DEBUG"
+        elif level == 20:
+            return "INFO"
+        elif level == 30:
+            return "WARNING"
+        elif level == 40:
+            return "ERROR"
+        elif level == 50:
+            return "CRITICAL"
+        else:
+            return level
+    level = property(_get_level, _set_level)
+
+    def debug(self, msg):
+        colorlog.getLogger(self.name).debug(msg)
+    def info(self, msg):
+        colorlog.getLogger(self.name).info(msg)
+    def warning(self, msg):
+        colorlog.getLogger(self.name).warning(msg)
+    def critical(self, msg):
+        colorlog.getLogger(self.name).critical(msg)
+    def error(self, msg):
+        colorlog.getLogger(self.name).error(msg)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


=====================================
easydev/misc.py
=====================================
@@ -15,7 +15,6 @@
 #  Documentation: http://easydev-python.readthedocs.io
 #
 ##############################################################################
-
 import os
 
 
@@ -23,6 +22,7 @@ __all__ = ['get_home', 'cmd_exists']
 
 
 def get_home():
+    """Return path of the HOME"""
     # This function should be robust
     # First, let us try with expanduser
     try:
@@ -42,6 +42,7 @@ def get_home():
 
 
 def cmd_exists(cmd):
+    """Return true if the command do exists in the environement"""
     try:
         import subprocess
         # for unix/max only


=====================================
easydev/timer.py
=====================================
@@ -19,7 +19,7 @@
 import time
 
 
-class Timer():
+class Timer(object):
     """Timer working with *with* statement
 
     ::


=====================================
setup.cfg
=====================================
@@ -3,7 +3,6 @@
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
 [global]
 
@@ -24,5 +23,5 @@ attr = !skip,!notravis
 upload_dir = doc/build/html/
 
 [tool:pytest]
-addopts = --durations=10 --verbose
+addopts = --cov=easydev --cov-report=term-missing --durations=10 --verbose
 


=====================================
setup.py
=====================================
@@ -7,7 +7,7 @@ import glob
 
 _MAJOR               = 0
 _MINOR               = 9
-_MICRO               = 35
+_MICRO               = 37
 version              = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
 release              = '%d.%d' % (_MAJOR, _MINOR)
 
@@ -66,7 +66,7 @@ setup(
                     "themes/cno/static/*",
                     "copybutton.js"]},
 
-    install_requires = ['colorama', 'pexpect'],
+    install_requires = ['colorama', 'pexpect', "colorlog"],
     extras_require = {
 	    'profiler': ["line_profiler_test"]
     },


=====================================
test/test_url.py
=====================================
@@ -5,7 +5,7 @@ from nose.plugins.attrib import attr
 def test_isurl():
     assert isurl_reachable("www.google.com") == True
     assert isurl_reachable("http://www.google.com") == True
-    assert isurl_reachable("https://fr.yahoo.com") == False # moved
+    #assert isurl_reachable("https://fr.yahoo.com") == False # moved
     assert isurl_reachable("wrong.co.ujj") == False
     assert isurl_reachable("http://wrong.co.ujj") == False
     assert isurl_reachable("http://wrong.co") == False



View it on GitLab: https://salsa.debian.org/med-team/python-easydev/compare/9f2eb670005e80cbc0f74d795f5738e00bdb05e3...86679fcbc6003db225eed512775a829159c07326

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-easydev/compare/9f2eb670005e80cbc0f74d795f5738e00bdb05e3...86679fcbc6003db225eed512775a829159c07326
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190109/26025927/attachment-0001.html>


More information about the debian-med-commit mailing list