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

Can't ignore ".venv/" #20

Closed
KPLauritzen opened this issue Aug 10, 2023 · 3 comments · May be fixed by #22
Closed

Can't ignore ".venv/" #20

KPLauritzen opened this issue Aug 10, 2023 · 3 comments · May be fixed by #22
Labels
bug Something isn't working

Comments

@KPLauritzen
Copy link

Just discovered this tool, looks very cool! Thanks for developing it!

I'm running ptw . and I want to ignore any changes in my virtualenv (installed at .venv/ in the project root).
I've tried

  • `ptw . --ignore_patterns ".venv/"
  • `ptw . --ignore_patterns ".venv/*"
  • `ptw . --ignore_patterns ".venv*"

but none of them work.

I think I have identified the issue. In watcher.py in _is_event_watched there is call to match_any_paths.
In match_any_paths, case_sensitive is an optional keyword, but it defaults to True. I'm on a Windows machine, so all my paths are being converted to a PurePosixPath.

@olzhasar
Copy link
Owner

@KPLauritzen,
Thank you for reporting this and opening the PR!

I currently do not have a Windows machine to test proposed changes. I will find time a bit later to test it and get back.

@lcnittl
Copy link

lcnittl commented Nov 2, 2023

@KPLauritzen I am not sure case sensitivity is the root cause: If your venv dir is called .venv (lower case) then it should match on Windows if searched for .venv\* (lower case)

Have you tried prefixing your path with .\?

ptw reports changed paths and for me these do start with .\ on Windows (e,g,: .\.venv\.... Prefixing solved the problem in my case:

PS> ptw --ignore-patterns ".\.venv\*" .

@olzhasar
Copy link
Owner

I am closing this issue for now, because introducing case insensitive approach can lead to other problems as was mentioned in the PR

@KPLauritzen Feel free to reopen if you will find more information about your case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants