ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 626 forks source link

Add basic, mostly empty pre-commit and ruff #939

Closed boxydog closed 8 months ago

boxydog commented 8 months ago

Also run it in the github tests.

boxydog commented 8 months ago

After merging this, the next step would be to start uncommenting the ruff rules and letting it fix them, or fixing them manually if need be. pyupgrade and django-upgrade also very helpful.

This will change hundreds of lines of code in shallow ways to be closer to python 3 best practices. For example, using foo.a instead of getattr(foo, "a").

boxydog commented 8 months ago

Again, personally I would squash-commit all PRs, but it's your project.

boxydog commented 8 months ago

FYI, this passed: https://github.com/boxydog/askbot-devel/actions. Not sure why it doesn't show up on the PR. Different repo, I guess.

evgenyfadeev commented 8 months ago

@boxydog I'll be reviewing these Fri-Mon, but possibly earlier. Thank you!

boxydog commented 8 months ago

Note with this new pyproject.toml, it works to replace the deprecated python setup.py install with python -m pip install .. See also https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#setup-py-deprecated.

Also, you can use pip-compile to create a real requirements.txt with all requirements pinned.