Skip to content

Commit

Permalink
Separates external test modules dependencies
Browse files Browse the repository at this point in the history
Tidy up
  • Loading branch information
Afxentios Hadjiminas committed Oct 27, 2018
1 parent e0c917d commit 7a67dfa
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,9 @@ language: python
sudo: false
python:
- "2.7"
- "3.0"
- "3.6"
- "3.7"

branches:
only:
Expand Down
18 changes: 0 additions & 18 deletions CHANGELOG.md

This file was deleted.

29 changes: 29 additions & 0 deletions CHANGELOG.rst
@@ -0,0 +1,29 @@
History of changes
====================

Version 1.1.1 (27/10/18)
------------------------

- Separates external test modules dependencies
- Tidy up

Version 1.1.0 (22/10/18)
------------------------

- Support for Python 3, 3.6 and 3.7

Version 1.0.2 (05/06/17)
------------------------

- Includes support for extra custom attributes

Version 1.0.1 (08/05/17)
------------------------

- Provides predefined logging level-filters.
- Currently available filters for writing logs only on the same level file and on same or lower level files.

Version 1.0.0 (31/01/17)
------------------------

- First working release
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1,3 +1,3 @@
include README.rst
include LICENSE.txt
include CHANGELOG.md
include CHANGELOG.rst
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -119,7 +119,7 @@ License

This project is licensed under the MIT license.

.. _Changelog: https://github.com/afxentios/config-logger/blob/master/CHANGELOG.md
.. _Changelog: https://github.com/afxentios/config-logger/blob/master/CHANGELOG.rst
.. _Issue tracker: https://github.com/afxentios/config-logger/issues
.. _latest release: https://github.com/afxentios/config-logger/releases
.. _Configuration dictionary schema: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema
Expand Down
1 change: 0 additions & 1 deletion config_logger/__init__.py
Expand Up @@ -2,5 +2,4 @@
from .logger import Logger

__all__ = ['Logger']
__version__ = '1.1.0'
__author__ = 'Afxentios Hadjiminas'
16 changes: 11 additions & 5 deletions config_logger/logger.py
Expand Up @@ -6,11 +6,17 @@
try:
from config_manager import ConfigManager, FileFormatError
except ImportError:
sys.exit("""
The config_manager module is needed to read the logging configurations,
install it from https://pypi.org/project/config-manager/
or run pip install config-manager.
""")
if sys.version_info < (3, 0, 0):
print("[-] The config_manager module is needed to read the logging configurations"
"\ninstall it from https://pypi.org/project/config-manager/"
"\nor run `pip install config-manager`.")
raise
else:
sys.exit("""
The config_manager module is needed to read the logging configurations,
install it from https://pypi.org/project/config-manager/
or run `pip install config-manager`.
""")


class Logger(object):
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
@@ -0,0 +1,5 @@
[metadata]
description-file =
README.rst
CHANGELOG.rst

22 changes: 14 additions & 8 deletions setup.py
@@ -1,24 +1,29 @@
from setuptools import setup, find_packages

import config_logger
from setuptools import find_packages
from setuptools import setup


def readme():
with open("README.rst") as f:
with open('README.rst') as f:
return f.read()


setup(name='config-logger',
version=config_logger.__version__,
version='1.1.1',
description='A simple configurable logger for python projects',
long_description=readme(),
url='https://github.com/afxentios/config-logger',
license='MIT',
author=config_logger.__author__,
author='Afxentios Hadjiminas',
author_email='afxentios@hadjimina.com',
keywords=["logging", "configurable", "configuration"],
keywords=['logging', 'configurable', 'configuration'],
packages=find_packages(),
install_requires=['PyYAML', 'config-manager', 'testfixtures'],
install_requires=['pyyaml',
'config-manager'],
extras_require={
'test': ['unittest2',
'mock',
'testfixtures']
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand All @@ -29,5 +34,6 @@ def readme():
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules']
)
17 changes: 16 additions & 1 deletion tests/filters_test.py
@@ -1,9 +1,24 @@
import sys

try:
import unittest2 as unittest
except ImportError:
import unittest

from mock import Mock
try:
from mock import Mock
except ImportError:
if sys.version_info < (3, 0, 0):
print("[-] The mock module is needed to create mock objects,"
"\ninstall it from https://pypi.org/project/mock/"
"\nor run `pip install mock`.")
raise
else:
sys.exit("""
The mock module is needed to create mock objects,
install it from https://pypi.org/project/mock/
or run `pip install mock`.
""")

from config_logger import SameLevelFilter, LessEqualLevelFilter

Expand Down
18 changes: 17 additions & 1 deletion tests/logger_test.py
@@ -1,3 +1,5 @@
import sys

try:
import unittest2 as unittest
except ImportError:
Expand All @@ -6,7 +8,21 @@
import logging

from config_manager import ConfigManager
from mock import patch

try:
from mock import patch
except ImportError:
if sys.version_info < (3, 0, 0):
print("[-] The mock module is needed to create mock objects,"
"\ninstall it from https://pypi.org/project/mock/"
"\nor run `pip install mock`.")
raise
else:
sys.exit("""
The mock module is needed to create mock objects,
install it from https://pypi.org/project/mock/
or run `pip install mock`.
""")
from testfixtures import log_capture

from config_logger import Logger
Expand Down

0 comments on commit 7a67dfa

Please sign in to comment.