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

Isort does not honor skip directories #2273

Open
alex-morgun opened this issue Jun 30, 2024 · 1 comment
Open

Isort does not honor skip directories #2273

alex-morgun opened this issue Jun 30, 2024 · 1 comment

Comments

@alex-morgun
Copy link

alex-morgun commented Jun 30, 2024

Problem:
I have a python project, trying to skip directories, somehow it gos to .cache and ignores all my efforts to skip it.

I guess my .venv may have a link to .cache, but why don't isort check directory path?

isort . --skip=".cache" --interactive

--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  20

isort . --skip-glob="**/.cache/*" --interactive
--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  2024-06-30 02:59:45.979922

isort --settings-path ./pyproject.toml --interactive .

--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  2024-06-30 02:59:45.979922
[tool.isort]
profile = "black"
skip = [".venv", "node_modules"]
skip_glob = ["*/.cache/*", "*/.venv/*", "*/node_modules/*"]

Solution:

isort package_path/
@darthwalsh
Copy link

@alex-morgun .cache is not a directory entry under . -- only part of the path after resolving a link?

i.e. I can run isort . --show-file and it shows .serverless/requirements/cryptography/__init__.py
On my mac, .serverless/requirements is a link to~/Library/Caches/serverless-python-requirements/blah_blah

As a workaround, it's easy to skip all of serverless:

skip = [".serverless", ".venv", "node_modules"]

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

No branches or pull requests

2 participants