honeybadger-io / honeybadger-python

Send Python and Django errors to Honeybadger.
https://www.honeybadger.io/
MIT License
15 stars 25 forks source link

chore 🧹: PEP8 linting #149

Closed dotysan closed 1 year ago

dotysan commented 1 year ago

Simply ran autopep8 --max-line-length=127 --in-place --recursive .

subzero10 commented 1 year ago

Cool! How do we make sure that all new code has gone through a linter before pushing to main branch? Can we run this on the CI workflow and fail if code has not been linted?

dotysan commented 1 year ago

I was about to create a 2nd github action, as I've done this before with flake8. But just now, I finally got tox performing the entire CI/tests. And from what I've learned, it will be a synch to add linting too. See upcoming PR...

dotysan commented 1 year ago

So the first step is to approve this chore PR.

That way the code conforms to some basic level of PEP8.

Then we can begin auto-linting. I've definitely got ideas/examples in that realm too...

subzero10 commented 1 year ago

I initially approved, but then noticed that tests are failing 🤔

dotysan commented 1 year ago

Those tests ran successfully previously, so the error is apparently unrelated.

ERROR: Ignored the following versions that require a different python version: 5.3.0 Requires-Python >=3.8; 5.3.0rc1 Requires-Python >=3.8; 5.3.0rc2 Requires-Python >=3.8
ERROR: Could not find a version that satisfies the requirement kombu<6.0,>=5.3.0 (from versions: 0.1.0, 0.2.0, 0.9.0, 0.9.1, 0.9.2, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 1.0.0b1, 1.0.0b2, 1.0.0b3, 1.0.0b4, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.1.8, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.4.10, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7, 2.5.8, 2.5.9, 2.5.10, 2.5.11, 2.5.12, 2.5.13, 2.5.14, 2.5.15, 2.5.16, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.0.10, 3.0.11, 3.0.12, 3.0.13, 3.0.14, 3.0.15, 3.0.16, 3.0.17, 3.0.18, 3.0.19, 3.0.20, 3.0.21, 3.0.22, 3.0.23, 3.0.24, 3.0.25, 3.0.26, 3.0.27, 3.0.28, 3.0.29, 3.0.30, 3.0.31, 3.0.32, 3.0.33, 3.0.34, 3.0.35, 3.0.36, 3.0.37, 4.0.0rc3, 4.0.0rc4, 4.0.0rc5, 4.0.0rc6, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.2.0, 4.2.1, 4.2.2.post1, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.6.4, 4.6.5, 4.6.6, 4.6.7, 4.6.8, 4.6.9, 4.6.10, 4.6.11, 5.0.0, 5.0.1, 5.0.2, 5.1.0b1, 5.1.0, 5.2.0rc1, 5.2.0, 5.2.1, 5.2.2, 5.2.3, 5.2.4, 5.3.0a1, 5.3.0b1, 5.3.0b2, 5.3.0b3)
ERROR: No matching distribution found for kombu<6.0,>=5.3.0
error: Command '['/opt/hostedtoolcache/Python/3.7.16/x64/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpcrtr8tc5', '--quiet', 'kombu<6.0,>=5.3.0']' returned non-zero exit status 1.
##[error]Process completed with exit code 1.

And both Celery (and its dependency kombu) were just released recently.

https://pypi.org/project/celery/#history https://pypi.org/project/kombu/#history

Maybe we need a quick CI patch to pin those to older revs.

dotysan commented 1 year ago

Yep that was it. Back-hacked my new logic from here: https://github.com/dotysan/honeybadger-python/blob/be6fc44ff386b211b9990885e7af8e3b988a1f02/requirements.txt#L15-L18 Into here: https://github.com/dotysan/honeybadger-python/blob/f02c3cd06d7089f40e5a21d2dce19f67a0a373da/setup.py#L8

I'll cherry-pick that commit into new PR too...

subzero10 commented 1 year ago

Nice find, thanks!