-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/move towards setup.cfg (#71)
* using setup-py-upgrade - using setup-py-upgrade --help to convert setup.py to setup.cfg * - updating more workflows. Moving towards pip installl - added a test matrix to the tests - updated read me. * Black - running black * Update tests.yml - adding commands for windows and macos * Update tests.yml - fixing the paths for macos and windows * - naming the coerage.json something else.
- Loading branch information
1 parent
5af797c
commit 5da6b1e
Showing
6 changed files
with
75 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,19 +19,23 @@ jobs: | |
with: | ||
python-version: "3.10" | ||
|
||
- name: Install python3 requirements and run sphinx... | ||
- name: Install python3 requirements... | ||
uses: knicknic/[email protected] | ||
with: | ||
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 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/[email protected] | ||
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
|
@@ -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/[email protected] | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = [email protected] | ||
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 | ||
packages = purpleair_data_logger | ||
install_requires = | ||
pg8000==1.30.3 | ||
requests | ||
purpleair_api==1.1.2 | ||
python_requires = >=3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="[email protected]", | ||
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() |