File tree Expand file tree Collapse file tree 15 files changed +598
-45
lines changed
Expand file tree Collapse file tree 15 files changed +598
-45
lines changed Original file line number Diff line number Diff line change 2525 python3.10 -m venv venv
2626 source venv/bin/activate
2727 pip3 install --upgrade pip
28- python3.10 -m pip install -r requirements.txt
29- python3.10 setup.py install
28+ python3.10 -m pip install -e ".[dev]"
3029 - name : Test with pytest & coverage
3130 run : |
3231 source venv/bin/activate
4847 python3.10 -m venv venv
4948 source venv/bin/activate
5049 pip3 install --upgrade pip
51- python3.10 -m pip install -r requirements.txt
52- python3.10 setup.py install
50+ python3.10 -m pip install -e ".[dev]"
5351 - name : Lint with pylint
5452 run : |
5553 source venv/bin/activate
7270 python3.10 -m venv venv
7371 source venv/bin/activate
7472 pip3 install --upgrade pip
75- python3.10 -m pip install -r requirements.txt
76- python3.10 setup.py install
73+ python3.10 -m pip install -e ".[dev]"
7774 - name : Generate Reference Docs
7875 run : |
7976 source venv/bin/activate
9895 python3.10 -m venv venv
9996 source venv/bin/activate
10097 pip3 install --upgrade pip
101- python3.10 -m pip install -r requirements.txt
102- python3.10 setup.py install
98+ python3.10 -m pip install -e ".[dev]"
10399 - name : Check Formatting
104100 run : |
105101 source venv/bin/activate
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "projects": {
3+ "default": "python-functions-testing"
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ # Logs
2+ logs
3+ * .log
4+ npm-debug.log *
5+ yarn-debug.log *
6+ yarn-error.log *
7+ firebase-debug.log *
8+ firebase-debug. * .log *
9+
10+ # Firebase cache
11+ .firebase /
12+
13+ # Firebase config
14+
15+ # Uncomment this if you'd like others to create their own Firebase project.
16+ # For a team working on the same Firebase project(s), it is recommended to leave
17+ # it commented so all members can deploy to the same project(s) in .firebaserc.
18+ # .firebaserc
19+
20+ # Runtime data
21+ pids
22+ * .pid
23+ * .seed
24+ * .pid.lock
25+
26+ # Directory for instrumented libs generated by jscoverage/JSCover
27+ lib-cov
28+
29+ # Coverage directory used by tools like istanbul
30+ coverage
31+
32+ # nyc test coverage
33+ .nyc_output
34+
35+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36+ .grunt
37+
38+ # Bower dependency directory (https://bower.io/)
39+ bower_components
40+
41+ # node-waf configuration
42+ .lock-wscript
43+
44+ # Compiled binary addons (http://nodejs.org/api/addons.html)
45+ build /Release
46+
47+ # Dependency directories
48+ node_modules /
49+
50+ # Optional npm cache directory
51+ .npm
52+
53+ # Optional eslint cache
54+ .eslintcache
55+
56+ # Optional REPL history
57+ .node_repl_history
58+
59+ # Output of 'npm pack'
60+ * .tgz
61+
62+ # Yarn Integrity file
63+ .yarn-integrity
64+
65+ # dotenv environment variables file
66+ .env
Original file line number Diff line number Diff line change 1+ # Required to avoid a 'duplicate modules' mypy error
2+ # in monorepos that have multiple main.py files.
3+ # https://github.com/python/mypy/issues/4008
Original file line number Diff line number Diff line change 1+ {
2+ "functions" : [
3+ {
4+ "source" : " functions" ,
5+ "codebase" : " default" ,
6+ "ignore" : [
7+ " venv"
8+ ]
9+ }
10+ ]
11+ }
Original file line number Diff line number Diff line change 1+ # pyenv
2+ .python-version
3+
4+ # Installer logs
5+ pip-log.txt
6+ pip-delete-this-directory.txt
7+
8+ # Environments
9+ .env
10+ .venv
11+ venv /
12+ venv.bak /
13+ __pycache__
Original file line number Diff line number Diff line change 1+ """
2+ Example Firebase Functions for Firestore written in Python
3+ """
4+ from firebase_functions import firestore_fn , options
5+ from firebase_admin import initialize_app
6+
7+ initialize_app ()
8+
9+ options .set_global_options (region = options .SupportedRegion .EUROPE_WEST1 )
10+
11+
12+ @firestore_fn .on_document_written (document = "hello/{world}" )
13+ def onfirestoredocumentwritten (
14+ event : firestore_fn .Event [firestore_fn .Change ]) -> None :
15+ print ("Hello from Firestore document write event:" , event )
16+
17+
18+ @firestore_fn .on_document_created (document = "hello/world" )
19+ def onfirestoredocumentcreated (event : firestore_fn .Event ) -> None :
20+ print ("Hello from Firestore document create event:" , event )
21+
22+
23+ @firestore_fn .on_document_deleted (document = "hello/world" )
24+ def onfirestoredocumentdeleted (event : firestore_fn .Event ) -> None :
25+ print ("Hello from Firestore document delete event:" , event )
26+
27+
28+ @firestore_fn .on_document_updated (document = "hello/world" )
29+ def onfirestoredocumentupdated (
30+ event : firestore_fn .Event [firestore_fn .Change ]) -> None :
31+ print ("Hello from Firestore document updated event:" , event )
Original file line number Diff line number Diff line change 1+ # Not published yet,
2+ # firebase-functions-python >= 0.0.1
3+ # so we use a relative path during development:
4+ ./../../../
5+ # Or switch to git ref for deployment testing:
6+ # git+https://github.com/firebase/firebase-functions-python.git@main#egg=firebase-functions
7+
8+ firebase-admin >= 6.0.1
Original file line number Diff line number Diff line change 66# git+https://github.com/firebase/firebase-functions-python.git@main#egg=firebase-functions
77
88firebase-admin >= 6.0.1
9+ google-cloud-tasks >= 2.13.1
You can’t perform that action at this time.
0 commit comments