From b82c8de0ff76ee64e37fb3e472877614598c8665 Mon Sep 17 00:00:00 2001 From: Gijs Wobben Date: Mon, 22 Jan 2024 11:07:09 +0100 Subject: [PATCH 1/5] Added a `py.typed` file (empty) to mark this package for type exports. --- src/firebase_functions/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/firebase_functions/py.typed diff --git a/src/firebase_functions/py.typed b/src/firebase_functions/py.typed new file mode 100644 index 0000000..e69de29 From f05836e13772509c226ffb3d15c8297fa0f6310a Mon Sep 17 00:00:00 2001 From: Gijs Wobben Date: Mon, 22 Jan 2024 11:07:33 +0100 Subject: [PATCH 2/5] Added the `py.typed` file to the package data to ensure it is included in the wheel --- setup.py | 71 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/setup.py b/setup.py index f1fc72a..4137c04 100644 --- a/setup.py +++ b/setup.py @@ -18,50 +18,65 @@ from setuptools import find_packages, setup install_requires = [ - 'flask>=2.1.2', 'functions-framework>=3.0.0', 'firebase-admin>=6.0.0', - 'pyyaml>=6.0', 'typing-extensions>=4.4.0', 'cloudevents==1.9.0', - 'flask-cors>=3.0.10', 'pyjwt[crypto]>=2.5.0', 'google-events>=0.5.0', - 'google-cloud-firestore>=2.11.0' + "flask>=2.1.2", + "functions-framework>=3.0.0", + "firebase-admin>=6.0.0", + "pyyaml>=6.0", + "typing-extensions>=4.4.0", + "cloudevents==1.9.0", + "flask-cors>=3.0.10", + "pyjwt[crypto]>=2.5.0", + "google-events>=0.5.0", + "google-cloud-firestore>=2.11.0", ] dev_requires = [ - 'pytest>=7.1.2', 'setuptools>=63.4.2', 'pylint>=2.16.1', - 'pytest-cov>=3.0.0', 'mypy>=1.0.0', 'sphinx>=6.1.3', - 'sphinxcontrib-napoleon>=0.7', 'yapf>=0.32.0', 'toml>=0.10.2', - 'google-cloud-tasks>=2.13.1' + "pytest>=7.1.2", + "setuptools>=63.4.2", + "pylint>=2.16.1", + "pytest-cov>=3.0.0", + "mypy>=1.0.0", + "sphinx>=6.1.3", + "sphinxcontrib-napoleon>=0.7", + "yapf>=0.32.0", + "toml>=0.10.2", + "google-cloud-tasks>=2.13.1", ] # Read in the package metadata per recommendations from: # https://packaging.python.org/guides/single-sourcing-package-version/ -init_path = path.join(path.dirname(path.abspath(__file__)), 'src', - 'firebase_functions', '__init__.py') +init_path = path.join( + path.dirname(path.abspath(__file__)), "src", "firebase_functions", "__init__.py" +) version = {} with open(init_path) as fp: exec(fp.read(), version) # pylint: disable=exec-used long_description = ( - 'The Firebase Functions Python SDK provides an SDK for defining' - ' Cloud Functions for Firebase.') + "The Firebase Functions Python SDK provides an SDK for defining" + " Cloud Functions for Firebase." +) setup( - name='firebase_functions', - version=version['__version__'], - description='Firebase Functions Python SDK', + name="firebase_functions", + version=version["__version__"], + description="Firebase Functions Python SDK", long_description=long_description, - url='https://github.com/firebase/firebase-functions-python', - author='Firebase Team', - keywords=['firebase', 'functions', 'google', 'cloud'], - license='Apache License 2.0', + url="https://github.com/firebase/firebase-functions-python", + author="Firebase Team", + keywords=["firebase", "functions", "google", "cloud"], + license="Apache License 2.0", install_requires=install_requires, - extras_require={'dev': dev_requires}, - packages=find_packages(where='src'), - package_dir={'': 'src'}, - python_requires='>=3.10', + extras_require={"dev": dev_requires}, + packages=find_packages(where="src"), + package_dir={"": "src"}, + package_data={"firebase_functions": ["py.typed"]}, + python_requires=">=3.10", classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Build Tools', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], ) From 22379aced2b41a3fcc8eb65eb353e4492809ce9b Mon Sep 17 00:00:00 2001 From: Gijs Wobben Date: Mon, 22 Jan 2024 11:31:46 +0100 Subject: [PATCH 3/5] Make sure to include the package data when distributing --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4137c04..826b5c8 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ extras_require={"dev": dev_requires}, packages=find_packages(where="src"), package_dir={"": "src"}, + include_package_data=True, package_data={"firebase_functions": ["py.typed"]}, python_requires=">=3.10", classifiers=[ From 319a9ee62961020d502dc07fc2cdfd7ad018d541 Mon Sep 17 00:00:00 2001 From: Gijs Wobben Date: Mon, 22 Jan 2024 11:35:58 +0100 Subject: [PATCH 4/5] Revert auto-formatting --- setup.py | 72 +++++++++++++++++++++++--------------------------------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/setup.py b/setup.py index 826b5c8..01cd6a1 100644 --- a/setup.py +++ b/setup.py @@ -18,66 +18,52 @@ from setuptools import find_packages, setup install_requires = [ - "flask>=2.1.2", - "functions-framework>=3.0.0", - "firebase-admin>=6.0.0", - "pyyaml>=6.0", - "typing-extensions>=4.4.0", - "cloudevents==1.9.0", - "flask-cors>=3.0.10", - "pyjwt[crypto]>=2.5.0", - "google-events>=0.5.0", - "google-cloud-firestore>=2.11.0", + 'flask>=2.1.2', 'functions-framework>=3.0.0', 'firebase-admin>=6.0.0', + 'pyyaml>=6.0', 'typing-extensions>=4.4.0', 'cloudevents==1.9.0', + 'flask-cors>=3.0.10', 'pyjwt[crypto]>=2.5.0', 'google-events>=0.5.0', + 'google-cloud-firestore>=2.11.0' ] dev_requires = [ - "pytest>=7.1.2", - "setuptools>=63.4.2", - "pylint>=2.16.1", - "pytest-cov>=3.0.0", - "mypy>=1.0.0", - "sphinx>=6.1.3", - "sphinxcontrib-napoleon>=0.7", - "yapf>=0.32.0", - "toml>=0.10.2", - "google-cloud-tasks>=2.13.1", + 'pytest>=7.1.2', 'setuptools>=63.4.2', 'pylint>=2.16.1', + 'pytest-cov>=3.0.0', 'mypy>=1.0.0', 'sphinx>=6.1.3', + 'sphinxcontrib-napoleon>=0.7', 'yapf>=0.32.0', 'toml>=0.10.2', + 'google-cloud-tasks>=2.13.1' ] # Read in the package metadata per recommendations from: # https://packaging.python.org/guides/single-sourcing-package-version/ -init_path = path.join( - path.dirname(path.abspath(__file__)), "src", "firebase_functions", "__init__.py" -) +init_path = path.join(path.dirname(path.abspath(__file__)), 'src', + 'firebase_functions', '__init__.py') version = {} with open(init_path) as fp: exec(fp.read(), version) # pylint: disable=exec-used long_description = ( - "The Firebase Functions Python SDK provides an SDK for defining" - " Cloud Functions for Firebase." -) + 'The Firebase Functions Python SDK provides an SDK for defining' + ' Cloud Functions for Firebase.') setup( - name="firebase_functions", - version=version["__version__"], - description="Firebase Functions Python SDK", + name='firebase_functions', + version=version['__version__'], + description='Firebase Functions Python SDK', long_description=long_description, - url="https://github.com/firebase/firebase-functions-python", - author="Firebase Team", - keywords=["firebase", "functions", "google", "cloud"], - license="Apache License 2.0", + url='https://github.com/firebase/firebase-functions-python', + author='Firebase Team', + keywords=['firebase','functions','google','cloud'], + license='Apache License 2.0', install_requires=install_requires, - extras_require={"dev": dev_requires}, - packages=find_packages(where="src"), - package_dir={"": "src"}, + extras_require={'dev': dev_requires}, + packages=find_packages(where='src'), + package_dir={'': 'src'}, include_package_data=True, - package_data={"firebase_functions": ["py.typed"]}, - python_requires=">=3.10", + package_data={'firebase_functions': ['py.typed']}, + python_requires='>=3.10', classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Topic :: Software Development :: Build Tools', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], ) From ea75c5c3abe445863c47d89085e4efdef4a4865a Mon Sep 17 00:00:00 2001 From: Gijs Wobben Date: Mon, 22 Jan 2024 11:36:31 +0100 Subject: [PATCH 5/5] Formatting issue --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 01cd6a1..3294bc5 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ long_description=long_description, url='https://github.com/firebase/firebase-functions-python', author='Firebase Team', - keywords=['firebase','functions','google','cloud'], + keywords=['firebase', 'functions', 'google', 'cloud'], license='Apache License 2.0', install_requires=install_requires, extras_require={'dev': dev_requires},