Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Question: how to exclude virtual environment? #63

@jamesbraza

Description

@jamesbraza

When adding the below to my .libcst.codemod.yaml:

blacklist_patterns: ['repo\/venv\/']

I get a bunch of FileNotFoundErrors:

Codemodding /Users/user/code/repo/venv/lib/python3.10/site-packages/Bio/Entrez/__init__.py
Traceback (most recent call last):
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/libcst/codemod/_cli.py", line 314, in _execute_transform
    newcode = invoke_formatter(config.formatter_args, newcode)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/libcst/codemod/_cli.py", line 56, in invoke_formatter
    subprocess.check_output(
  File "/Users/user/.pyenv/versions/3.10.13/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Users/user/.pyenv/versions/3.10.13/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/user/.pyenv/versions/3.10.13/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/user/.pyenv/versions/3.10.13/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user/code/repo/black'

I currently have Python 3.10.13 with:

autotyping==23.3.0
libcst==1.1.0

How can I exclude a virtual environment from autotyping when running:

python -m libcst.tool codemod autotyping.AutotypeCommand . --aggressive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions