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 error on attributes-of-attributes in except (...): clauses #109

Merged
merged 3 commits into from Jan 6, 2020
Merged

Fix error on attributes-of-attributes in except (...): clauses #109

merged 3 commits into from Jan 6, 2020

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Jan 6, 2020

CC @cooperlees and @AlexandreYang

As well as fixing the bug, I've added some fuzz-tests that should catch any similar issues before release next time.
(in this case they don't, meaning that (a) I need to improve Hypothesmith, and (b) there is no affected code in the standard library or any third-party packages in my dev environment. Rare bug!)

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does hypothesmith contain Python 3.8 only code?

@Zac-HD
Copy link
Member Author

Zac-HD commented Jan 6, 2020

hypothesis 5.1.0 has requirement attrs>=19.2.0, but you'll have attrs 18.2.0 which is incompatible.

You can fix this for now by clearing the Travis cache, or fix it for good by pinning transitive dependencies with pip-compile.

@cooperlees
Copy link
Collaborator

I’m always a fan of just moving forward so I feel we should just fix bugbear.py to work with >=19.2.0 if you’d like to use that module. I can’t image it being a huge PR.

@Zac-HD
Copy link
Member Author

Zac-HD commented Jan 6, 2020

Done - it already works with attrs>=19.2.0; not it requires that as a minimum version for easy compatibility with test dependencies.

Does hypothesmith contain Python 3.8 only code?

For completeness, no - it's 3.6+ and the issue was a stale package cache on Travis tripping Hypothesis' minimum attrs version.

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining. This all makes sense and I’ll merge.

@@ -38,7 +38,7 @@
py_modules=["bugbear"],
zip_safe=False,
python_requires=">=3.6",
install_requires=["flake8 >= 3.0.0", "attrs"],
install_requires=["flake8 >= 3.0.0", "attrs>=19.2.0"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is not a hard requirement for flake8-bugbear, I might move this to .travis.yml if anyone opens an Issue about needing to run it with an older attrs.

@cooperlees cooperlees merged commit 238001d into PyCQA:master Jan 6, 2020
@Zac-HD Zac-HD deleted the fix-attr-error branch January 6, 2020 02:09
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.

None yet

2 participants