Skip to content
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

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Conversation

vinzenz
Copy link
Member

@vinzenz vinzenz commented Oct 27, 2020

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

@vinzenz vinzenz requested a review from pirat89 October 27, 2020 08:34
@leapp-bot
Copy link
Collaborator

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the
Leapp Guidelines and must pass all tests in order to be mergable.

If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run unit tests, copr build and e2e tests in OAMG CI
  • e2e tests to run unit tests, copr build and end-to-end tests in Murphy CI (OAMG members only) [OLD PIPELINE]
  • review please to notify leapp developers of review request

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.

@pirat89
Copy link
Member

pirat89 commented Oct 27, 2020

Adding reference for the orig issue discussion on pytest upstream pytest-dev/pytest#2782

Fix seems good. I will wait for test results.

pirat89
pirat89 previously approved these changes Oct 27, 2020
Copy link
Member

@pirat89 pirat89 left a 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>
@pirat89 pirat89 merged commit 56c3d65 into oamg:master Oct 27, 2020
drehak added a commit to drehak/leapp that referenced this pull request Feb 2, 2021
## 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
drehak added a commit to drehak/leapp that referenced this pull request Feb 2, 2021
## 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
@drehak drehak mentioned this pull request Feb 2, 2021
drehak added a commit to drehak/leapp that referenced this pull request Feb 4, 2021
## 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
drehak added a commit to drehak/leapp that referenced this pull request Feb 4, 2021
## 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
pirat89 pushed a commit that referenced this pull request Feb 4, 2021
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants