From 94d4636c94d031514c66a850430471dda7d30bdb Mon Sep 17 00:00:00 2001 From: Debian Date: Tue, 18 Aug 2026 16:47:55 +0000 Subject: [PATCH 1/3] Modernize CI and publish 2.1.1 on merge --- .github/workflows/python-app.yml | 104 ++++++++++++++++----------- .github/workflows/python-publish.yml | 31 -------- pyfcm/__meta__.py | 2 +- 3 files changed, 64 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 791f41a..ee06cc2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,53 +1,75 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python application +name: CI and publish on: push: branches: - - '**' - create: - branches: - - '**' - tags: - - '**' + - master pull_request: branches: - - master # Run on pull requests targeting the master branch + - master + +permissions: + contents: read jobs: - build: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: pip + - name: Install lint tools + run: python -m pip install black==24.4.2 flake8 + - name: Lint + run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + - name: Check formatting + run: black --target-version py310 --check . + test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install package and test dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ".[test]" + - name: Test + run: python -m pytest + publish: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: + - lint + - test + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Check formatting - run: | - # stop the build if there are formatting is error in any python codes - # to check whether the codes are formatted or not before merge - pip install black==24.4.2 - pip install click==8.1.7 - python -m black -t py310 --check . - - name: Test with pytest - run: | - export GOOGLE_APPLICATION_CREDENTIALS=service-account.json - export FCM_TEST_PROJECT_ID=test - pip install . ".[test]" - python -m pytest . + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - name: Build package + run: | + python -m pip install --upgrade build + python -m build + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} + skip-existing: true diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 4e1ef42..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/pyfcm/__meta__.py b/pyfcm/__meta__.py index 1c3cdec..292d807 100644 --- a/pyfcm/__meta__.py +++ b/pyfcm/__meta__.py @@ -2,7 +2,7 @@ __summary__ = "Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)" __url__ = "https://github.com/olucurious/pyfcm" -__version__ = "2.1.0" +__version__ = "2.1.1" __author__ = "Emmanuel Adegbite" __email__ = "olucurious@gmail.com" From 8bcd33dc99d7b71f24d4a0bf38728644af949eec Mon Sep 17 00:00:00 2001 From: Debian Date: Tue, 18 Aug 2026 16:49:46 +0000 Subject: [PATCH 2/3] Fix matrix test dependencies and action runtimes --- .github/workflows/python-app.yml | 12 ++++++------ setup.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ee06cc2..7eacd8c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -15,8 +15,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: "3.10" cache: pip @@ -39,8 +39,8 @@ jobs: - "3.12" - "3.13" steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip @@ -58,8 +58,8 @@ jobs: - test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: "3.12" cache: pip diff --git a/setup.py b/setup.py index 80a33eb..5c1fb1d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def read(fname): "google-auth>=2.22.0", "aiohttp>=3.8.6", ] -tests_require = ["pytest"] +tests_require = ["pytest", "pytest-mock"] # We can't get the values using `from pyfcm import __meta__`, because this would import # the other modules too and raise an exception (dependencies are not installed at this point yet). From abd57c0ee094cd798e3c29a2a893ae4005193995 Mon Sep 17 00:00:00 2001 From: Debian Date: Tue, 18 Aug 2026 16:53:30 +0000 Subject: [PATCH 3/3] Bump pyasn1 to 0.6.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 58d273c..28f6872 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ aiohttp>=3.8.6 cachetools==5.5.2 google-auth==2.24.0 -pyasn1==0.6.1 +pyasn1==0.6.4 pyasn1-modules==0.4.2 rsa==4.9.1 requests>=2.6.0