From c1c8582744e5eb00665adf1c96e2f9ef0845ecbb Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 8 Jan 2025 12:43:20 -0800 Subject: [PATCH] Feature/py versions (#122) * Update setup.cfg - drop support for 3.9 - add support for 3.13 * V1.3.0 - updating refs from 1.2.0 --> 1.3.0 * Python Versions - bumping 3.10 --> 3.11 - adding a matrix for tests * Update tests.yml - try coverage on all platforms * Update tests.yml - run now? * Update tests.yml - use the with * Update tests.yml - fix mac path * Update tests.yml - deps for all oses * Update tests.yml - fix windows path --- .../workflows/build_and_publish_to_pypi.yml | 4 +-- .../build_and_publish_to_test_pypi.yml | 4 +-- .github/workflows/sphinx_build.yml | 4 +-- .github/workflows/tests.yml | 33 ++++++++++++++++--- README.md | 2 +- setup.cfg | 10 ++++-- sphinx_docs_build/source/conf.py | 2 +- 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_and_publish_to_pypi.yml b/.github/workflows/build_and_publish_to_pypi.yml index aeeaed3..084f4d1 100644 --- a/.github/workflows/build_and_publish_to_pypi.yml +++ b/.github/workflows/build_and_publish_to_pypi.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install pypa/build run: >- diff --git a/.github/workflows/build_and_publish_to_test_pypi.yml b/.github/workflows/build_and_publish_to_test_pypi.yml index a596a43..e9933de 100644 --- a/.github/workflows/build_and_publish_to_test_pypi.yml +++ b/.github/workflows/build_and_publish_to_test_pypi.yml @@ -32,10 +32,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install pypa/build run: >- diff --git a/.github/workflows/sphinx_build.yml b/.github/workflows/sphinx_build.yml index 9c4f481..7152af5 100644 --- a/.github/workflows/sphinx_build.yml +++ b/.github/workflows/sphinx_build.yml @@ -33,10 +33,10 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Python 3.10 env for sphinx... + - name: Set up Python 3.11 env for sphinx... uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install python3/os requirements... uses: carlkidcrypto/os-specific-runner@v2.1.1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb5efba..2c49835 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,22 +28,39 @@ jobs: setup.cfg tests: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] needs: check-source-changes if: needs.check-source-changes.outputs.run_job == 'true' steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Python 3.10 env for running unittest tests... + - name: Set up Python ${{ matrix.python-version }} env for running unittest tests... uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "${{ matrix.python-version }}" - name: Install python3 requirements... uses: carlkidcrypto/os-specific-runner@v2.1.1 with: - linux: cd /home/runner/work/purpleair_api/purpleair_api/ ; + linux: cd /home/runner/work/purpleair_api/purpleair_api/ ; + python -m pip install --upgrade wheel ; + python -m pip install --upgrade setuptools ; + python -m pip install --upgrade pip ; + python -m pip install coverage ; + python -m pip install requests_mock ; + macos: cd /Users/runner/work/purpleair_api/purpleair_api/ ; + python -m pip install --upgrade wheel ; + python -m pip install --upgrade setuptools ; + python -m pip install --upgrade pip ; + python -m pip install coverage ; + python -m pip install requests_mock ; + windows: cd D:\a\purpleair_api\purpleair_api\ ; python -m pip install --upgrade wheel ; python -m pip install --upgrade setuptools ; python -m pip install --upgrade pip ; @@ -54,9 +71,15 @@ jobs: uses: carlkidcrypto/os-specific-runner@v2.1.1 with: linux: cd /home/runner/work/purpleair_api/purpleair_api/tests ; - coverage run -m unittest && coverage json ; + coverage run -m unittest && coverage json -o coverage_linux_${{ matrix.os }}_${{ matrix.python-version }}.json ; + macos: cd /Users/runner/work/purpleair_api/purpleair_api/tests ; + coverage run -m unittest && coverage json -o coverage_macos_${{ matrix.os }}_${{ matrix.python-version }}.json ; + windows: cd D:\a\purpleair_api\purpleair_api\tests ; + coverage run -m unittest && coverage json -o coverage_windows_${{ matrix.os }}_${{ matrix.python-version }}.json ; - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 + with: + files: coverage_*.json env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 17e489e..87e0302 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ To use the PurpleAirAPI (PAA) api keys are required. You can get API keys by sen | [![PyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml) | [![TestPyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml) | [![Black](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml) | | --------------- | --------------- | --------------- | -| [![Tests](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml) | [![total download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/total.svg?style=flat-square&label=all%20downloads)](https://github.com/carlkidcrypto/purpleair_api/releases) | [![latest release download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/v1.2.0/total.svg?style=flat-square)](https://github.com/carlkidcrypto/purpleair_api/releases/tag/v1.2.0) | +| [![Tests](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml) | [![total download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/total.svg?style=flat-square&label=all%20downloads)](https://github.com/carlkidcrypto/purpleair_api/releases) | [![latest release download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/v1.3.0/total.svg?style=flat-square)](https://github.com/carlkidcrypto/purpleair_api/releases/tag/v1.3.0) | | --------------- | --------------- | --------------- | ## How to Support This Project diff --git a/setup.cfg b/setup.cfg index 9b0fd7a..1fb7bab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ description-file = README.md license_files = LICENSE name = purpleair_api -version = 1.2.0 +version = 1.3.0 author = Carlos Santos author_email = dose.lucky.sake@cloak.id license = MIT @@ -20,6 +20,10 @@ long_description_content_type = text/markdown platforms = Windows 32/64, Linux 32/64, MacOS 32/64 [options] -python_requires = >=3.8 packages = purpleair_api -install_requires = requests \ No newline at end of file +install_requires = requests +python_requires = >=3.9,<3.14 + +[tool:black] +line-length = 100 +target-version = ['py39', 'py310', 'py311', 'py312', 'py313'] \ No newline at end of file diff --git a/sphinx_docs_build/source/conf.py b/sphinx_docs_build/source/conf.py index 591a09e..f47fe5c 100644 --- a/sphinx_docs_build/source/conf.py +++ b/sphinx_docs_build/source/conf.py @@ -23,7 +23,7 @@ author = "carlkidcrypto" # The full version, including alpha/beta/rc tags -release = "V1.2.0" +release = "V1.3.0" # -- General configuration ---------------------------------------------------