diff --git a/.github/workflows/behave_tests.yml b/.github/workflows/behave_tests.yml index a89a70f..f98a0f1 100644 --- a/.github/workflows/behave_tests.yml +++ b/.github/workflows/behave_tests.yml @@ -38,21 +38,21 @@ jobs: python -m pip install --upgrade setuptools ; python -m pip install --upgrade pip ; python -m pip install -r behave_tests/requirements.txt ; - python setup.py install + python -m pip install . --user linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/ ; python -m pip install --upgrade wheel ; python -m pip install --upgrade setuptools ; python -m pip install --upgrade pip ; python -m pip install -r behave_tests/requirements.txt ; - python setup.py install + python -m pip install . --user windows: cd D:\a\purpleair_data_logger\purpleair_data_logger\ ; python -m pip install --upgrade wheel ; python -m pip install --upgrade setuptools ; python -m pip install --upgrade pip ; python -m pip install -r behave_tests/requirements.txt ; - python setup.py install --user + python -m pip install . --user - name: Run behave tests... env: diff --git a/.github/workflows/sphinx_build.yml b/.github/workflows/sphinx_build.yml index af042a6..1ef1ab3 100644 --- a/.github/workflows/sphinx_build.yml +++ b/.github/workflows/sphinx_build.yml @@ -19,7 +19,7 @@ jobs: with: python-version: "3.10" - - name: Install python3 requirements and run sphinx... + - name: Install python3 requirements... uses: knicknic/os-specific-run@v1.0.4 with: linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/ && @@ -27,11 +27,15 @@ jobs: python -m pip install --upgrade setuptools && python -m pip install --upgrade pip && python -m pip install -r sphinx_docs_build/requirements.txt && - python setup.py install --user && - cd sphinx_docs_build && - make html + python -m pip install . --user + + - name: Run sphinx... + uses: knicknic/os-specific-run@v1.0.4 + with: + linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/sphinx_docs_build ; + make html - uses: actions/upload-artifact@v3 with: - name: Upload HTML Documentation + name: HTML Documentation path: docs/ \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78032a7..72438d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Tests +name: Unit Tests on: push: @@ -8,17 +8,23 @@ on: branches: [ main ] jobs: - tests: - runs-on: ubuntu-latest + Unit_Tests: + name: ${{ matrix.os }} using Python ${{ matrix.python-version }} + 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'] 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 env for running unit tests... uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} - name: Install python3 requirements... uses: knicknic/os-specific-run@v1.0.4 @@ -30,14 +36,37 @@ jobs: python -m pip install coverage ; python -m pip install requests_mock ; python -m pip install purpleair_api ; + + macos: cd /Users/runner/work/purpleair_data_logger/purpleair_data_logger/ ; + 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 ; + python -m pip install purpleair_api ; + + windows: cd D:\a\purpleair_data_logger\purpleair_data_logger\ ; + 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 ; + python -m pip install purpleair_api ; - name: Run unit tests... uses: knicknic/os-specific-run@v1.0.4 with: linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/tests ; - coverage run -m unittest && coverage json ; + coverage run -m unittest && coverage json -o ${{matrix.os}}_${{matrix.python-version}}_coverage.json; + + macos: cd /Users/runner/work/purpleair_data_logger/purpleair_data_logger/tests ; + coverage run -m unittest && coverage json -o ${{matrix.os}}_${{matrix.python-version}}_coverage.json; + + windows: cd D:\a\purpleair_data_logger\purpleair_data_logger\tests ; + coverage run -m unittest && coverage json -o ${{matrix.os}}_${{matrix.python-version}}_coverage.json; - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: + name: ${{matrix.os}}_${{matrix.python-version}}_coverage_report CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index d09a0f9..65c02c4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You can install PurpleAir Data Logger by cloning down this repo. ```bash git clone https://github.com/carlkidcrypto/purpleair_data_logger.git cd purpleair_data_logger -python3 setup.py install +python3 -m pip install . ``` ## Usage PurpleAirPSQLDataLogger.py diff --git a/setup.cfg b/setup.cfg index ab12e93..9aa8b69 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,29 @@ [metadata] -description-file=README.md -license_files=LICENSE +name = purpleair_data_logger +version = 1.3.0a1 +license = MIT +author = Carlos Santos +author_email = dose.lucky.sake@cloak.id +url = https://github.com/carlkidcrypto/purpleair_data_logger +keywords = + purpleair_data_logger + purple air + purple air data logger + PurpleAirPSQLDataLogger + PurpleAirCSVDataLogger + purple air api + PurpleAirSQLiteDataLogger +platforms = + Windows 32/64 + Linux 32/64 + MacOS 32/64 +description-file = README.md +license_files = LICENSE [options] -python_requires = >=3.8 \ No newline at end of file +packages = purpleair_data_logger +install_requires = + pg8000==1.30.3 + requests + purpleair_api==1.1.2 +python_requires = >=3.8 diff --git a/setup.py b/setup.py index 9326217..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,34 +1,3 @@ -#!/usr/bin/env python3 from setuptools import setup -import os - -def read_file(filename): - with open( - os.path.join(os.path.dirname(__file__), filename), encoding="utf-8" - ) as file: - return file.read() - - -setup( - name="purpleair_data_logger", - version="1.3.0a1", - license="MIT", - author="Carlos Santos", - author_email="dose.lucky.sake@cloak.id", - long_description=read_file("README.md"), - long_description_content_type="text/markdown", - packages=["purpleair_data_logger"], - url="https://github.com/carlkidcrypto/purpleair_data_logger", - keywords=[ - "purpleair_data_logger", - "purple air", - "purple air data logger", - "PurpleAirPSQLDataLogger", - "PurpleAirCSVDataLogger", - "purple air api", - "PurpleAirSQLiteDataLogger", - ], - install_requires=["pg8000==1.30.3", "requests", "purpleair_api==1.1.2"], - platforms=["Windows 32/64", "Linux 32/64", "MacOS 32/64"], -) +setup()