#TIL about #isort's `--profile` arg. No longer does it fight with Black for who gets to format a lengthy import statement.

#Python #DevX

#isort failing on #CI in #precommit in with this?

[extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'

It's fixed in https://github.com/PyCQA/isort/pull/2078, bump your isort to 5.12.0.

Update with:

pre-commit autoupdate

Or:

pre-commit autoupdate --repo https://github.com/PyCQA/isort

#python

Fix poetry pip-shims extras dependency by jooola · Pull Request #2078 · PyCQA/isort

With poetry-core>=1.5.0, the dependencies in extras must be present in the main dependency group. Fix #2077

GitHub

So…who do we know at the #PyCQA that can rush a PR approval on a Saturday? I’m betting a lot of people have a broken #isort #precommit plugin right now.

https://github.com/PyCQA/isort/issues/2077
https://github.com/PyCQA/isort/pull/2078

Build from source (e.g. via pre-commit) is broken by new poetry version · Issue #2077 · PyCQA/isort

Poetry-core 1.5.0, which was released 30 minutes ago, adds additional validation for the extras section, which causes this error when installing from source: % pip install --no-binary :all: -U isor...

GitHub

Time for a bit of #cleanup and #documentation for #repod

https://gitlab.archlinux.org/archlinux/repod/-/merge_requests/146
https://gitlab.archlinux.org/archlinux/repod/-/merge_requests/145

I wish #ruff was more compatible with #Python 3.10. Using a lot of match-case statements makes it explode sadly. Was a bit looking forward replacing #flake8, #isort, #pycodestyle and #pydocstyle with it.
I hope it improves in the future. It looks really promising (and fast!).

#archlinux #sundaythings

Improve linting and checks (!146) · Merge requests · Arch Linux / repod · GitLab

Add pydocstyle, improving documentation. Add documentation for tests. Fix various small issues.

GitLab

#Darker is a #Python tool to only apply #Black and #isort to your modified bits of code, but it can also be used to
run other lint tools like the otherwise noisy #pylint!

Useful for incremental improvement of large codebases.

From Andrea Guarino's #EuroPython talk:

https://youtu.be/KK2GZFZ9_uA?t=1018

Managing the code quality of your project. Leave the past behind: Focus on new code - Andrea Guarino

YouTube

#isort to sort your imports
#pylint to yell at you for leaving in unused imports
pycln to remove the extras
black to fix the whitespace between imports

#pycharm then hides all of it in a collapsed region and you never see it.

#python

If you have encountered a bug where our #isort extension for #vscode won't stop showing a 💡 on every selected line, we believe we have a fix and will be pushing out a new version tomorrow. Until then you can always disable, uninstall, or try an older version of the extension if it's bothering you too much.

TIL: reorder-python-imports by @[email protected]

This import sorter for #Python is much faster than #isort, can globally add, remove, and rename imported modules, all while having no config to worry about! pre-commit support is there, too!

https://pypi.org/project/reorder-python-imports/

Definitely using this on all my projects from now on.

reorder-python-imports

Tool for reordering python imports

PyPI

Anyone happen to know the #isort maintainers? For #vscode we are running into some issues programmatically calling isort and we're trying to find out if there's a better way to do things.

https://github.com/PyCQA/isort/issues/1940
https://github.com/PyCQA/isort/issues/1989

Recommended way to invoke isort programatically · Issue #1940 · PyCQA/isort

I work on the vscode-python extension, we have a isort extension based on LSP as mentioned here #1904. We have few users complaining that the behavior they see with isort is different from what the...

GitHub

FYI for the #vscode users out there: having extensions install other extensions is part of the design, and it will happen implicitly and automatically.

Been getting some haters because the #Python extension installs the new #isort extension automatically because we didn't ask for permission. But this functionality is by design. This also allows us to update isort independent of the main extension as well as let you disable/uninstall. Plus the perf is now way better thanks to LSP support.