-
-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tag-expressions: Remove deprecated method use_2to3 #1742
tag-expressions: Remove deprecated method use_2to3 #1742
Conversation
Method has been deprecated in setuptools>=58.0.0 Fixes cucumber#1736
You'll need to apply 2to3 to the source code and set a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll need to apply lib2to3 to the source code for your package to support py3
you could alternatively use https://github.com/PyCQA/modernize to keep python2 support |
actually it looks like 2to3 was redundant in this project: diff --git a/tag-expressions/python/cucumber_tag_expressions/__init__.py b/tag-expressions/python/cucumber_tag_expressions/__init__.py
index 45b88a343..0877fdfc4 100644
--- a/tag-expressions/python/cucumber_tag_expressions/__init__.py
+++ b/tag-expressions/python/cucumber_tag_expressions/__init__.py
@@ -13,7 +13,7 @@ Theses selected items are normally included in a test run.
.. _`behave: Gherkin`: https://behave.readthedocs.io/en/latest/philosophy.html#the-gherkin-language
"""
-from __future__ import absolute_import
+
from .parser import parse, TagExpressionParser, TagExpressionError
__version__ = "1.1.2"
diff --git a/tag-expressions/python/cucumber_tag_expressions/parser.py b/tag-expressions/python/cucumber_tag_expressions/parser.py
index 792c065ad..71aba994b 100644
--- a/tag-expressions/python/cucumber_tag_expressions/parser.py
+++ b/tag-expressions/python/cucumber_tag_expressions/parser.py
@@ -14,7 +14,7 @@ UNSUPPORTED:
* Support special tags w/ escaped-parens: ``@reqid\\(10\\)``
"""
-from __future__ import absolute_import
+
from enum import Enum
from cucumber_tag_expressions.model import Literal, And, Or, Not, True_
@@ -154,7 +154,7 @@ class TagExpressionParser(object):
"""
# pylint: disable=too-few-public-methods
TOKEN_MAP = {token.keyword: token
- for token in Token.__members__.values()}
+ for token in list(Token.__members__.values())}
@classmethod
def select_token(cls, text):
|
@krisgesling @graingert thanks a lot folks! 🤩 For the moment, we do not have much python contributors to the cucumber projects. So, thank you very much for your contribution! If you still have the possibility to submit other contribution, feel free to do so 😅 We have a dedicated slack workspace. Again, feel free to join! You can register then head over to #intro. Finally, note that there is an Open Collective for Cucumber. You can be pay for your contributions! |
Hi @krisgesling, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
* Prepare for next release * FIXES cucumber#1736 (with pull-request: cucumber#1742) * tox: Update to newer Python versions
Prepare for next release: `v4.0.1` * BUMP-VERSION: 4.0.1 (was: 4.0.0) * tox: Update to newer Python versions FIXES: * FIXES #1736 (with pull-request: #1742) OTHERWISE: * FIX: Incorrect version info * FIX README: Badge for CI build server status (was: Travis, but is now: CircleCI) * FIX README: Badge was using wrong LICENSE information.
Thanks @aslakhellesoy - this is a great welcome message for new contributors! I very much appreciate the great package you and the team have built too. |
Summary
Removes the call to
use_2to3
in setup.py as this method has been deprecated in setuptools>=58.0.0 (see changelog).Fixes #1736
Details
The standard library module lib2to3 is deprecated and will be removed in Python 3.10.
Further details about why this was deprecated can be found here:
pypa/setuptools#2086
Motivation and Context
Installation of cucumber-tag-expressions will fail if the system is using newer versions of setuptools. This is actively occuring on Github Actions.
How Has This Been Tested?
Types of changes
I haven't tested on Python2 and am not familiar with the details of
use_2to3
so this may be a breaking change.Checklist: