1
- [tool .pytest .ini_options ]
2
- pythonpath = [
3
- " ." , " src/" ,
1
+ [build-system ]
2
+ requires = [" setuptools>=61.0" , " wheel" ]
3
+ build-backend = " setuptools.build_meta"
4
+
5
+ [project ]
6
+ name = " firebase_functions"
7
+ description = " Firebase Functions Python SDK"
8
+ readme = " README.md"
9
+ license = " Apache-2.0"
10
+ authors = [{name = " Firebase Team" }]
11
+ keywords = [" firebase" , " functions" , " google" , " cloud" ]
12
+ classifiers = [
13
+ " Development Status :: 4 - Beta" ,
14
+ " Intended Audience :: Developers" ,
15
+ " Topic :: Software Development :: Build Tools" ,
16
+ " Programming Language :: Python :: 3.10" ,
17
+ " Programming Language :: Python :: 3.11" ,
18
+ " Programming Language :: Python :: 3.12" ,
19
+ ]
20
+ requires-python = " >=3.10"
21
+ dynamic = [" version" ]
22
+ dependencies = [
23
+ " flask>=2.1.2" ,
24
+ " functions-framework>=3.0.0" ,
25
+ " firebase-admin>=6.0.0" ,
26
+ " pyyaml>=6.0" ,
27
+ " typing-extensions>=4.4.0" ,
28
+ " cloudevents>=1.2.0,<2.0.0" ,
29
+ " flask-cors>=3.0.10" ,
30
+ " pyjwt[crypto]>=2.5.0" ,
31
+ " google-events==0.5.0" ,
32
+ " google-cloud-firestore>=2.11.0" ,
33
+ ]
34
+
35
+ [project .optional-dependencies ]
36
+ dev = [
37
+ " pytest>=7.1.2" ,
38
+ " pytest-cov>=3.0.0" ,
39
+ " mypy>=1.0.0" ,
40
+ " sphinx>=6.1.3" ,
41
+ " sphinxcontrib-napoleon>=0.7" ,
42
+ " toml>=0.10.2" ,
43
+ " google-cloud-tasks>=2.13.1" ,
44
+ " ruff>=0.1.0" ,
45
+ " pre-commit>=3.0.0" ,
46
+ " tox>=4.0.0" ,
47
+ " build>=1.0.0" ,
48
+ ]
49
+ test = [
50
+ " pytest>=7.1.2" ,
51
+ " pytest-cov>=3.0.0" ,
52
+ " google-cloud-tasks>=2.13.1" ,
53
+ ]
54
+ docs = [
55
+ " sphinx>=6.1.3" ,
56
+ " sphinxcontrib-napoleon>=0.7" ,
4
57
]
58
+
59
+ [project .urls ]
60
+ Homepage = " https://github.com/firebase/firebase-functions-python"
61
+ Repository = " https://github.com/firebase/firebase-functions-python"
62
+ Issues = " https://github.com/firebase/firebase-functions-python/issues"
63
+
64
+ [tool .setuptools ]
65
+ packages = [" firebase_functions" , " firebase_functions.private" ]
66
+ package-dir = {"" = " src" }
67
+ include-package-data = true
68
+
69
+ [tool .setuptools .package-data ]
70
+ firebase_functions = [" py.typed" ]
71
+
72
+ [tool .setuptools .dynamic ]
73
+ version = {attr = " firebase_functions.__version__" }
74
+
75
+ [tool .pytest .ini_options ]
76
+ pythonpath = [" ." , " src/" ]
77
+ testpaths = [" tests" ]
78
+ addopts = " -v --cov=firebase_functions --cov-report=term-missing"
79
+
5
80
[tool .coverage ]
6
81
[tool .coverage .run ]
82
+ source = [" src/firebase_functions" ]
7
83
omit = [
8
- ' __init__.py' ,
9
- ' tests/*' ,
10
- ' */tests/*' ,
84
+ " __init__.py" ,
85
+ " tests/*" ,
86
+ " */tests/*" ,
11
87
]
12
88
13
89
[tool .coverage .report ]
14
90
skip_empty = true
15
- [tool .yapf ]
16
- based_on_style = " google"
17
- indent_width = 4
18
- [tool .yapfignore ]
19
- ignore_patterns = [
20
- " venv" ,
21
- " build" ,
22
- " dist" ,
91
+ show_missing = true
92
+ precision = 2
93
+
94
+ [tool .mypy ]
95
+ python_version = " 3.10"
96
+ exclude = [" build" , " dist" , " venv" , " docs" ]
97
+ ignore_missing_imports = true
98
+ enable_incomplete_feature = [" Unpack" ]
99
+ strict = true
100
+ warn_return_any = true
101
+ warn_unused_configs = true
102
+ disallow_untyped_defs = true
103
+ disallow_incomplete_defs = true
104
+ check_untyped_defs = true
105
+ no_implicit_optional = true
106
+ warn_redundant_casts = true
107
+ warn_unused_ignores = true
108
+ warn_no_return = true
109
+ warn_unreachable = true
110
+ strict_equality = true
111
+
112
+ [[tool .mypy .overrides ]]
113
+ module = " yaml.*"
114
+ ignore_missing_imports = true
115
+
116
+ [[tool .mypy .overrides ]]
117
+ module = " cloudevents.*"
118
+ ignore_missing_imports = true
119
+
120
+ [tool .ruff ]
121
+ target-version = " py310"
122
+ line-length = 100
123
+ indent-width = 4
124
+
125
+ [tool .ruff .lint ]
126
+ # Enable Pyflakes `E` and `F` codes by default, plus additional rules
127
+ select = [
128
+ " E" , # pycodestyle errors
129
+ " W" , # pycodestyle warnings
130
+ " F" , # pyflakes
131
+ " I" , # isort
132
+ " UP" , # pyupgrade
133
+ " B" , # flake8-bugbear
134
+ " C4" , # flake8-comprehensions
135
+ " PL" , # pylint
136
+ " PIE" , # flake8-pie
137
+ " RET" , # flake8-return
138
+ " SIM" , # flake8-simplify
139
+ " TCH" , # flake8-type-checking
140
+ " PTH" , # flake8-use-pathlib
141
+ " ERA" , # eradicate
142
+ " TRY" , # tryceratops
143
+ " RUF" , # Ruff-specific rules
23
144
]
145
+
146
+ # Disable specific rules to match existing pylint configuration
147
+ ignore = [
148
+ " PLR0913" , # Too many arguments
149
+ " PLR0912" , # Too many branches
150
+ " PLR0915" , # Too many statements
151
+ " PLR2004" , # Magic value used in comparison
152
+ " PLW0603" , # Using the global statement
153
+ " PLC0415" , # Import outside toplevel
154
+ " E501" , # Line too long (handled by formatter)
155
+ " TRY003" , # Avoid specifying long messages outside the exception class
156
+ " TRY400" , # Use logging.exception instead of logging.error
157
+ " B008" , # Do not perform function calls in argument defaults
158
+ " SIM108" , # Use ternary operator
159
+ " SIM114" , # Combine if branches using logical or
160
+ " RET504" , # Unnecessary variable assignment before return
161
+ " RET505" , # Unnecessary else after return
162
+ " RET506" , # Unnecessary else after raise
163
+ # Removed UP007 to allow modern Union type syntax
164
+ ]
165
+
166
+ # Enable Python 3.10+ specific rules
167
+ pyupgrade.keep-runtime-typing = false
168
+
169
+ [tool .ruff .lint .pylint ]
170
+ max-args = 10
171
+ max-branches = 20
172
+ max-returns = 10
173
+ max-statements = 100
174
+
175
+ [tool .ruff .lint .per-file-ignores ]
176
+ "tests/*" = [" PLR2004" , " PLR0913" ]
177
+ "setup.py" = [" ALL" ]
178
+
179
+ [tool .ruff .lint .isort ]
180
+ known-first-party = [" firebase_functions" ]
181
+ combine-as-imports = true
182
+ split-on-trailing-comma = false
183
+
184
+ [tool .ruff .format ]
185
+ quote-style = " double" # Consistent double quotes (Black-style)
186
+ indent-style = " space"
187
+ skip-magic-trailing-comma = false # Always add trailing commas for cleaner diffs
188
+ line-ending = " auto"
189
+ docstring-code-format = true # Format code examples in docstrings
0 commit comments