-
Notifications
You must be signed in to change notification settings - Fork 70
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
Replace functools.wraps with six.wraps #674
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the If you want to re-run tests or request review, you can use following commands as a comment:
Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
3ee84c0
to
a69c164
Compare
Adding reference for the orig issue discussion on pytest upstream pytest-dev/pytest#2782 Fix seems good. I will wait for test results. |
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.
There is currently big backlog for jobs on jenkins, so let's wait. But our tests passed, so approving.
Previously we have been using functools.wraps. However if any decorator that uses functools.wraps is used, some code that relies on __wrapped__ being present, e.g. pytest, will fail on Python2. Switching to six.wraps will solve this problem, as it introduces this change as well and solves the missing __wrapped__ attribute. Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
a69c164
to
52de6da
Compare
## Packaging - Bump leapp-framework capability to 1.4 ## Framework ### Fixes - Replace functools.wraps with six.wraps (oamg#674) ### Enhancements - Add a stable report identifier (oamg#669) - Add a way to override default python version through environment variables (oamg#675) - Add a possibility to overwrite virtualenv name through environment variables (oamg#675) Related leapp-repository release: https://github.com/oamg/leapp-repository/releases/tag/v0.13.0
## Packaging - Bump leapp-framework capability to 1.4 ## Framework ### Fixes - Replace functools.wraps with six.wraps (oamg#674) ### Enhancements - Add a stable report identifier (oamg#669) - Add a way to override default python version through environment variables (oamg#675) - Add a possibility to overwrite virtualenv name through environment variables (oamg#675) Related leapp-repository release: https://github.com/oamg/leapp-repository/releases/tag/v0.13.0 # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Tue Feb 2 15:57:58 2021 +0100 # # On branch release/202102 # Your branch is up to date with 'drehak/release/202102'. # # No changes
## Packaging - Add JSON schema of leapp reports for validation (oamg#681) - Bump leapp-framework capability to 1.4 (oamg#684) ## Framework ### Fixes - Fix Py2/Py3 issues for unit-tests relying on __wrapped__ for decorators (oamg#674) ### Enhancements - Add a stable report identifier for each generated report (oamg#669) ## Additional changes interesting for devels - Add a possibility to overwrite virtualenv name for testing `$VENVNAME` (oamg#675) - Add a way to override default python version using `$PYTHON_VENV` (oamg#675) Related leapp-repository release: https://github.com/oamg/leapp-repository/releases/tag/v0.13.0
## Packaging - Add JSON schema of leapp reports for validation (oamg#681) - Bump leapp-framework capability to 1.4 (oamg#684) ## Framework ### Fixes - Fix Py2/Py3 issues for unit-tests relying on __wrapped__ for decorators (oamg#674) ### Enhancements - Add a stable report identifier for each generated report (oamg#669) ## Additional changes interesting for devels - Add a possibility to overwrite virtualenv name for testing `$VENVNAME` (oamg#675) - Add a way to override default python version using `$PYTHON_VENV` (oamg#675) Related leapp-repository release: https://github.com/oamg/leapp-repository/releases/tag/v0.13.0
## Packaging - Add JSON schema of leapp reports for validation (#681) - Bump leapp-framework capability to 1.4 (#684) ## Framework ### Fixes - Fix Py2/Py3 issues for unit-tests relying on __wrapped__ for decorators (#674) ### Enhancements - Add a stable report identifier for each generated report (#669) ## Additional changes interesting for devels - Add a possibility to overwrite virtualenv name for testing `$VENVNAME` (#675) - Add a way to override default python version using `$PYTHON_VENV` (#675) Related leapp-repository release: https://github.com/oamg/leapp-repository/releases/tag/v0.13.0
Previously we have been using functools.wraps. However if any decorator
that uses functools.wraps is used, some code that relies on wrapped
being present, e.g. pytest, will fail on Python2. Switching to six.wraps
will solve this problem, as it introduces this change as well and solves
the missing wrapped attribute.
Signed-off-by: Vinzenz Feenstra vfeenstr@redhat.com