Skip to content

Commit

Permalink
new: usr: Dropped support from Python 2.7. Latest version to support …
Browse files Browse the repository at this point in the history
…it is 1.4.1.
  • Loading branch information
carlos-jenkins committed Jan 24, 2020
1 parent 1ff935f commit e4d98dd
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -21,7 +21,7 @@ License

::

Copyright (C) 2015-2018 KuraLabs S.R.L
Copyright (C) 2015-2020 KuraLabs S.R.L

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 8 additions & 0 deletions doc/requirements.txt
@@ -0,0 +1,8 @@
# Purpose:
#
# This requirements are Python packages that need to be installed in order
# to successfully generate the project's documentation.

sphinx
plantweb
sphinx_rtd_theme
5 changes: 1 addition & 4 deletions examples/apinode.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,9 +19,6 @@
Example usage of the APINode class.
"""

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

import readline # noqa
from code import InteractiveConsole
from logging import basicConfig, DEBUG
Expand Down
5 changes: 1 addition & 4 deletions lib/autoapi/__init__.py
Expand Up @@ -15,13 +15,10 @@
# specific language governing permissions and limitations
# under the License.

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

from .apinode import __doc__, APINode # noqa

__author__ = 'KuraLabs S.R.L'
__email__ = 'info@kuralabs.io'
__version__ = '1.4.1'
__version__ = '2.0.0'

__all__ = ['APINode']
11 changes: 4 additions & 7 deletions lib/autoapi/apinode.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,15 +71,12 @@
to any of other categories.
"""

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

from logging import getLogger
from pkgutil import iter_modules
from traceback import format_exc
from importlib import import_module
from pkgutil import iter_modules
from inspect import isclass, isfunction
from collections import OrderedDict
from inspect import isclass, isfunction


log = getLogger(__name__)
Expand Down Expand Up @@ -162,7 +159,7 @@ def __init__(self, name, directory=None):
try:
subnode = APINode(subname, self.directory)
self.subnodes.append(subnode)
except Exception as e:
except Exception:
log.error('Failed to import {}'.format(subname))
log.error(format_exc())
self.subnodes_failed.append(subname)
Expand Down
7 changes: 2 additions & 5 deletions lib/autoapi/sphinx.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,9 +19,6 @@
Glue for Sphinx API.
"""

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

from inspect import getdoc
from functools import wraps
from traceback import format_exc
Expand Down Expand Up @@ -71,7 +68,7 @@ def filter_summary(obj):
summary = doc.split('\n').pop(0)
summary.replace('\\', '\\\\') # Escape backslash in RST
return summary
except Exception as e:
except Exception:
log.error(
'AutoApi failed to determine summary for obj: {}'.format(obj)
)
Expand Down
7 changes: 0 additions & 7 deletions requirements.dev.txt

This file was deleted.

5 changes: 2 additions & 3 deletions setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -84,10 +84,9 @@ def find_requirements(filename):
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
)
6 changes: 6 additions & 0 deletions test/pytest.ini
@@ -0,0 +1,6 @@
[pytest]
log_cli=true
log_cli_level=INFO
log_date_format=%Y-%m-%dT%H:%M:%S
log_cli_format=%(asctime)s,%(msecs)03.0f | %(levelname)-8s | %(processName)s | %(name)-5s:%(lineno)-4d | %(message)s
junit_family=xunit1
25 changes: 25 additions & 0 deletions test/requirements.txt
@@ -0,0 +1,25 @@
# Purpose:
#
# This requirements are Python packages that need to be installed to
# successfully run tests, debug them or collect metrics from the run.

#######################
# Debugging #
#######################

ipdb

#######################
# Coding style #
#######################

flake8
pep8-naming

#######################
# Testing #
#######################

pytest
pytest-cov
deepdiff
5 changes: 1 addition & 4 deletions test/test_autoapi.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,9 +21,6 @@
See http://pythontesting.net/framework/pytest/pytest-introduction/#fixtures
"""

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

import pytest # noqa

from autoapi import __version__
Expand Down
5 changes: 1 addition & 4 deletions test/test_autoapi_apinode.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 KuraLabs S.R.L
# Copyright (C) 2015-2020 KuraLabs S.R.L
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,9 +21,6 @@
See http://pythontesting.net/framework/pytest/pytest-introduction/#fixtures
"""

from __future__ import unicode_literals, absolute_import
from __future__ import print_function, division

import pytest # noqa

from autoapi import APINode
Expand Down
20 changes: 10 additions & 10 deletions tox.ini
@@ -1,12 +1,16 @@
[tox]
envlist = py27, py34, py35, coverage, doc
envlist = test, doc


[testenv]
basepython = python3
changedir = {envtmpdir}
passenv = http_proxy https_proxy no_proxy HOME


[testenv:test]
deps =
-rrequirements.dev.txt
changedir = {envtmpdir}
-rtest/requirements.txt
commands =
{envpython} -c "import autoapi; print(autoapi.__file__)"
flake8 {toxinidir}
Expand All @@ -16,12 +20,12 @@ commands =
--cov-report xml \
--cov-report html \
--cov-report term \
{toxinidir}/test \
{envsitepackagesdir}/autoapi
{toxinidir}/test


[testenv:doc]
basepython = python3
deps =
-rdoc/requirements.txt
whitelist_externals =
dot
commands =
Expand All @@ -30,7 +34,3 @@ commands =

[flake8]
exclude = .git,.tox,.cache,__pycache__,*.egg-info


[pytest]
addopts = --doctest-modules

0 comments on commit e4d98dd

Please sign in to comment.