Remove old python2-related code and add python 3.11 support#715
Merged
Remove old python2-related code and add python 3.11 support#715
Conversation
delatrie
commented
Nov 28, 2022
sseliverstov
approved these changes
Nov 28, 2022
skhomuti
approved these changes
Nov 28, 2022
beckerGil
pushed a commit
to beckerGil/allure-python
that referenced
this pull request
Apr 10, 2023
beckerGil
pushed a commit
to beckerGil/allure-python
that referenced
this pull request
Apr 10, 2023
IvanBuruyane
pushed a commit
to IvanBuruyane/allure-python
that referenced
this pull request
Mar 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)objectunicode_literals,absolute_import,division,print_function(i.e. constructs in formfrom __future__ import "<feature>")allure_commons._compat.format_exception_onlyfunction andallure_commons._compatmodule altogether (traceback.format_exception_onlyis used instead)sixcompatability library:six.PY2was removedsix.with_metaclassreplaced withmetaclass=in object class declarationssix.text_typeis alwaysstrin py3six.string_typesis alwaysstrin py3enum32dependency ofallure-python-commons: backport of enums for py3.4allure_commons.logger.AllureFileLogger._report_itemallure_commons.utils.escape_non_unicode_symbolsfunction (returns an argument itself in python3)allure_commons.getargspecfunction (inspect.getfullargspecis used in py3 instead)Also made some refactorings and small changes:
%-formattingandstr.formatwith string interpolation (f-strings) where is improves readabilitybuildworkflowbuildworkflowcheckoutto v3 andsetup-pythonto v4 in thereleaseworkflowallure_pytest.helper.AllureTestHelper.decorate_as_linkandallure_pytest.listener.AllureListener.add_linktoallure_pytest.utils.format_allure_link(following DRY)allure_test/test/acceptance/fixture/yield_fixture_test.py::test_yield_fixturetest to actually check a yield-fixture (not a usual one) - Fixes Allure-pytest: Yield_fixture test is invalid #551allure_robotframework.listener.utils, makeparse_linka module-level function (it has no dependencies on local variables)