How to ignore changes in some folders when developing locally?
google-app-engine
Solution
Using:
Google Cloud SDK 197.0.0
app-engine-python 1.9.68
app-engine-python-extras 1.9.63
bq 2.0.31
core 2018.04.06
gsutil 4.30
From the App Engine Docs, you can pass an argument, `--watcher_ignore_re`, to `dev_appserver.py` when running from the command line.
Example
dev_appserver.py app.yaml --watcher_ignore_re="(.*\.data|.*\.vscode)"
This will ignore changes to the `.data` and `.vscode` directories, relative to the directory from which the command is run (CWD).
Edit 7th June 2018.
Using:
Google Cloud SDK 204.0.0
app-engine-python 1.9.70
app-engine-python-extras 1.9.69
bq 2.0.34
core 2018.06.04
gsutil 4.31
The `watcher_ignore_re` seems to not be working anymore.
Rather, what worked for me is to add a `skip_files` directive in the `app.yaml` file as stated here in the docs. The `dev_appserver.py` command will respect the definitions in this section.
Example
Inside `app.yaml` of the project:
...
...
skip_files:
# default from GAE
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
# custom entries
# dev-related files
- ptvsd
- pydev_startup.py
- .pylintrc
- .data
- .vscode
# version control files
- .git
- .gitignore
- .gitattributes
# non-application files
- README.md
- ^(.*/)?.*\.mwb(.bak)?$ # workbench models
Now, run project with command:
dev_appserver.py app.yaml
Problem
I'm using the Go SDK for the Google App Engine (it uses some parts of the Python SDK and calls into `dev_appserver.py` when running `goapp serve`). By default, it seems to watch all files and folders for changes. I have a crapload of bower dependencies in the static folder, and the SDK complains that it can't watch that many files. How to set the dev server to ignore changes in a folder? Edit. Reading `devappserver2/watcher_common.py`, it seems that it ignores directories starting with `.`. I suppose in the worst case scenario, I could prefix folders with `.`, but it's a hack. There should be a configuration option, and I can't seem to find it.