Since we decided to support only py3.7+ (and possibly 3.6) this PR aims to clean the code base from python2 old-style and compatibility constructs, including:
old-style unicode literals (u'', u"")
encoding declarations (comments # -*- coding: UTF-8 -*- at the top of a file)
explicit class inheritance from object
inheritance of the features already included in python 3.6+: unicode_literals, absolute_import, division, print_function (i.e. constructs in form from __future__ import "<feature>")
allure_commons._compat.format_exception_only function and allure_commons._compat module altogether (traceback.format_exception_only is used instead)
six compatability library:
Branches depending on six.PY2 was removed
six.with_metaclass replaced with metaclass= in object class declarations
six.text_type is always str in py3
six.string_types is always str in py3
enum32 dependency of allure-python-commons: backport of enums for py3.4
py2-related unicode-encoded json file writing algorithm in allure_commons.logger.AllureFileLogger._report_item
allure_commons.utils.escape_non_unicode_symbols function (returns an argument itself in python3)
allure_commons.getargspec function (inspect.getfullargspec is used in py3 instead)
Also made some refactorings and small changes:
Replace %-formatting and str.format with string interpolation (f-strings) where is improves readability
Add supported python version classifiers in setup.py files
Update python version to 3.11 in linting step of the build workflow
Add py3.11 to build&test matrix of the build workflow
Update checkout to v3 and setup-python to v4 in the release workflow
Factor out link formatting in allure_pytest.helper.AllureTestHelper.decorate_as_link and allure_pytest.listener.AllureListener.add_link to allure_pytest.utils.format_allure_link (following DRY)
Fix allure_test/test/acceptance/fixture/yield_fixture_test.py::test_yield_fixture test to actually check a yield-fixture (not a usual one) - Fixes #551
Refactor a link creation in allure_robotframework.listener.utils, make parse_link a module-level function (it has no dependencies on local variables)
Remove dependency on dict keys ordering in py3.6 since it's an implementation detail of the CPython 3.6. Insertion order preservation became a part of the spec in py3.7. See here and here.
Since we decided to support only py3.7+ (and possibly 3.6) this PR aims to clean the code base from python2 old-style and compatibility constructs, including:
u''
,u""
)# -*- coding: UTF-8 -*-
at the top of a file)object
unicode_literals
,absolute_import
,division
,print_function
(i.e. constructs in formfrom __future__ import "<feature>"
)allure_commons._compat.format_exception_only
function andallure_commons._compat
module altogether (traceback.format_exception_only
is used instead)six
compatability library:six.PY2
was removedsix.with_metaclass
replaced withmetaclass=
in object class declarationssix.text_type
is alwaysstr
in py3six.string_types
is alwaysstr
in py3enum32
dependency ofallure-python-commons
: backport of enums for py3.4allure_commons.logger.AllureFileLogger._report_item
allure_commons.utils.escape_non_unicode_symbols
function (returns an argument itself in python3)allure_commons.getargspec
function (inspect.getfullargspec
is used in py3 instead)Also made some refactorings and small changes:
%-formatting
andstr.format
with string interpolation (f-strings
) where is improves readabilitybuild
workflowbuild
workflowcheckout
to v3 andsetup-python
to v4 in therelease
workflowallure_pytest.helper.AllureTestHelper.decorate_as_link
andallure_pytest.listener.AllureListener.add_link
toallure_pytest.utils.format_allure_link
(following DRY)allure_test/test/acceptance/fixture/yield_fixture_test.py::test_yield_fixture
test to actually check a yield-fixture (not a usual one) - Fixes #551allure_robotframework.listener.utils
, makeparse_link
a module-level function (it has no dependencies on local variables)