wyuenho / emacs-python-isort Goto Github PK
View Code? Open in Web Editor NEWReformat python-mode buffer with isort
License: GNU General Public License v3.0
Reformat python-mode buffer with isort
License: GNU General Public License v3.0
I noticed there are three isort relevant packges: py-isort
, isortify
, and python-isort
. It seems that all these packages are designed to do the similar work: Use isort
to sort the imports in a Python buffer. Considering that there are already similar projects, why do you still decide to create this new project? So, I want to know what're the differences among these isort
relevant packages: py-isort
, isortify
, and python-isort
.
Regards,
HZ
When using --profile black
, isort will add a line break to separate different import blocks. Whether or not imports are correctly read as from a local module, and therefore in a separate block, depends on the working directory / src path. This means that if the src path isn't set, isort will behave inconsistently if triggered by this package or run locally.
Ideally this package would determine the src path dynamically for a given buffer and then pass that as a command-line argument to the isort command
If users include a pyproject.toml or .isort.cfg with the appropriate configuration block then this is not necessary
See configuration documentation here: https://pycqa.github.io/isort/docs/configuration/options#src-paths
When I run python-isort-buffer
in a buffer, the following error is output:
Traceback (most recent call last):
File "/home/thomashisch/.cache/pre-commit/repol3458474/py_env-python3/bin/isort", line 8, in <module>
sys.exit(main())
File "/home/thomashisch/.cache/pre-commit/repol3458474/py_env-python3/lib/python3.9/site-packages/isort/main.py", line 343, in main
SortImports(file_=file_, write_to_stdout=True, **arguments)
TypeError: isort.isort.SortImports() got multiple values for keyword argument 'write_to_stdout'
in a *python-isort errors*
buffer.
(note that the default value of python-isort-arguments
is used)
Currently I can't upgrade to a newer isort version because I have to use this isort version for my projects.
Do you know how I can debug this? I wanted to reproduce this error on the command line by running
cat myfile | /home/thomashisch/.cache/pre-commit/repol3458474/py_env-python3/bin/isort --stdout --atomic -
but this worked.
Note that I don't have problems when I use python-isort-on-save-mode
, but my --settings-path
is not taken into account (I have included this path in `python-isort-arguements, but it is ignored)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.