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

Fix warnings with attrs 19.2 and fix object assertions #5902

Merged
merged 2 commits into from Oct 6, 2019

Conversation

@hynek
Copy link
Contributor

commented Oct 1, 2019

attrs 19.2 deprecated cmp in favor of the dataclass-ish eq/order duo.

This causes deprecation warnings that in turn break some of the cool new deep
object comparisons. Since we at attrs expected this to be a problem, it shipped
with helpers to write backward and forward compatible code.

This PR uses that and avoids changed to minimal versions.

As for your checklist, I think this qualifies as a trivial bug fix. Let me know if you need anything more.

Fixes #5901

attrs 19.2 deprecated cmp in favor of the dataclass-ish eq/order duo.

This causes deprecation warnings that in turn break some of the cool new deep
object comparisons. Since we at attrs expected this to be a problem, it shipped
with helpers to write backward and forward compatible code.

This PR uses that and avoids changed to minimal versions.
@hynek

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2019

One thing worth thinking about is that it might make sense to add a tox env for attrs 19.1 (or ideally the attrs that pytest has as minimal version).

@hynek

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2019

Which is probably the missing 0.03% of coverage. Please advice what action you'd prefer. :)

src/_pytest/compat.py Outdated Show resolved Hide resolved
Copy link
Member

left a comment

alternatively, maybe we should just >=19.2 on the features branch?

src/_pytest/assertion/util.py Outdated Show resolved Hide resolved
src/_pytest/compat.py Outdated Show resolved Hide resolved
src/_pytest/mark/structures.py Outdated Show resolved Hide resolved
Copy link
Member

left a comment

Hi @hynek, thanks a lot for the work here, we definitely appreciate it.

Could you please also add a CHANGELOG entry? I believe a file 5902.bugfix.rst like this would suffice:

Fix warnings about deprecated ``cmp`` attribute in ``attrs>=19.2``.
src/_pytest/compat.py Outdated Show resolved Hide resolved
src/_pytest/compat.py Outdated Show resolved Hide resolved
src/_pytest/mark/structures.py Outdated Show resolved Hide resolved
testing/test_assertion.py Outdated Show resolved Hide resolved
@asottile

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

@hynek let me know if you'd like one of us to make the changes requested here -- I hear you're busy with conference stuff :D

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

Second that. 😁

We should also cut a release right away.

@hynek

This comment has been minimized.

Copy link
Contributor Author

commented Oct 5, 2019

Yeah it’s true! I’m in the middle of PyGotham and the moment I come back I’ll be at PyCon DE in Berlin. So if you’re in a semi-hurry, feel free to take over. I don’t need any credit, I just felt guilty for breaking your stuff. ;)

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

@asottile want to take it over? Otherwise I can do it

@asottile

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

yep I got it 👍

Copy link
Member

left a comment

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

Awesome!

@nicoddemus nicoddemus merged commit 8c9ea5e into pytest-dev:master Oct 6, 2019
3 of 6 checks passed
3 of 6 checks passed
codecov/changes 1 file has unexpected coverage changes not visible in diff.
Details
codecov/patch 77.77% of diff hit (target 96.34%)
Details
codecov/project 96.33% (-0.02%) compared to 9a4c0b9
Details
WIP Ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pytest-CI #20191006.1 succeeded
Details
@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

Oh missed the changelog. 😞

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

I will prepare 5.2.1, and add the changelog there.

nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Oct 6, 2019
@blueyed blueyed referenced this pull request Oct 6, 2019
@asottile

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

Oh missed the changelog. 😞

ah shoot I knew I missed something

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

No worries, I missed myself when approving. 😅

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

5.2.1 released, thanks @hynek and everyone for the quick response!

@hynek hynek deleted the hynek:attrs-19-2 branch Oct 6, 2019
bors bot added a commit to rehandalal/therapist that referenced this pull request Oct 7, 2019
Merge #96
96: Update pytest to 5.2.1 r=rehandalal a=pyup-bot


This PR updates [pytest](https://pypi.org/project/pytest) from **5.2.0** to **5.2.1**.



<details>
  <summary>Changelog</summary>
  
  
   ### 5.2.1
   ```
   =========================

Bug Fixes
---------

- `5902 &lt;https://github.com/pytest-dev/pytest/issues/5902&gt;`_: Fix warnings about deprecated ``cmp`` attribute in ``attrs&gt;=19.2``.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
bors bot added a commit to duckinator/bork that referenced this pull request Oct 8, 2019
Merge #58
58: Update pytest to 5.2.1 r=nbraud a=pyup-bot


This PR updates [pytest](https://pypi.org/project/pytest) from **5.2.0** to **5.2.1**.



<details>
  <summary>Changelog</summary>
  
  
   ### 5.2.1
   ```
   =========================

Bug Fixes
---------

- `5902 &lt;https://github.com/pytest-dev/pytest/issues/5902&gt;`_: Fix warnings about deprecated ``cmp`` attribute in ``attrs&gt;=19.2``.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
mimi1vx added a commit to mimi1vx/pytest that referenced this pull request Oct 11, 2019
Fix warnings with attrs 19.2 and fix object assertions
mimi1vx added a commit to mimi1vx/pytest that referenced this pull request Oct 11, 2019
Fix warnings with attrs 19.2 and fix object assertions
nicoddemus added a commit that referenced this pull request Oct 11, 2019
[4.6] Fix warnings with attrs 19.2 and fix object assertions (#5902)
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Oct 11, 2019
@asottile

This comment has been minimized.

Copy link
Member

commented Oct 13, 2019

backported in #5944

@asottile asottile added backported and removed needs backport labels Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.