diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4375431 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Tests +on: [pull_request, push] + +jobs: + test: + name: Run tests (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + + steps: + - uses: actions/checkout@v2 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -e . + + - name: Run tests with pytest + run: | + pytest diff --git a/README.md b/README.md index c5272d2..f4ba40d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ![SVG of ozone logo](/src/media/ozone_logo.svg) -[![PyPI version](https://badge.fury.io/py/ozon3.svg)](https://badge.fury.io/py/ozon3) PRs Welcome ![GitHub](https://img.shields.io/github/license/Milind220/Ozone) [![Complete Documentation](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment) [![Dependency Review](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml) +[![PyPI version](https://badge.fury.io/py/ozon3.svg)](https://badge.fury.io/py/ozon3) PRs Welcome ![GitHub](https://img.shields.io/github/license/Milind220/Ozone) [![Complete Documentation](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment) [![Dependency Review](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml) [![Tests](https://github.com/Milind220/Ozone/actions/workflows/test.yml/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/test.yml) [![Buy Me a Coffee](https://img.shields.io/badge/buy_me_a_coffee-orange.svg?style=flat)](https://www.buymeacoffee.com/MilindSharma) ## The simplest AQI API diff --git a/setup.cfg b/setup.cfg index 5dc97af..1dca838 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ozon3 -version = 2.0.1 +version = 2.0.2 author = Milind Sharma author_email = milindsharma8@gmail.com description = A package to get air quality data using the WAQI API diff --git a/setup.py b/setup.py index 0d955db..ef96ff0 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,8 @@ description="A package to get air quality data using the WAQI API", license="GPLv3+", url="https://github.com/Milind220/Ozone", - version="2.0.1", - download_url="https://github.com/Milind220/Ozone/archive/refs/tags/v2.0.1.tar.gz", + version="2.0.2", + download_url="https://github.com/Milind220/Ozone/archive/refs/tags/v2.0.2.tar.gz", packages=setuptools.find_packages(), install_requires=[ "numpy; python_version>='3'", diff --git a/src/ozone/ozone.py b/src/ozone/ozone.py index 281bea6..d4c4218 100644 --- a/src/ozone/ozone.py +++ b/src/ozone/ozone.py @@ -80,8 +80,8 @@ def __init__( Args: token (str): The users private API token for the WAQI API. output_path (str): The path to the location where - file_name (str): Name of output file any output artifacts will be created + file_name (str): Name of output file """ self.token: str = token self._check_token_validity() @@ -248,7 +248,8 @@ def _extract_forecast_data(self, data_obj: Any) -> pandas.DataFrame: the API's response. Returns: - pandas.DataFrame: A dataframe containing the data.""" + pandas.DataFrame: A dataframe containing the data. + """ forecast = data_obj["forecast"]["daily"] dict_of_frames = {} for pol, lst in forecast.items(): @@ -331,7 +332,7 @@ def _AQI_meaning(self, aqi: float) -> Tuple[str, str]: aqi (float): Air Quality Index (AQI) value. Returns: - str: The meaning and health implication of the AQI value. + Tuple[str, str]: The meaning and health implication of the AQI value. """ if 0 <= aqi <= 50: @@ -387,7 +388,7 @@ def _locate_all_coordinates( Returns: list: a list of all coordinates located between lower_bound and - upper_bound. If API request fails then returns [(-1, -1)]. + upper_bound. """ coordinates_flattened: List[float] = list( diff --git a/tests/conftest.py b/tests/conftest.py index f0ff077..a2c57db 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,7 +17,7 @@ def pytest_configure(config): config.addinivalue_line("markers", "slow: mark test as slow to run") -# Skip slow tests unless --run_slow is given +# Run slow tests unless --skip_slow is given def pytest_collection_modifyitems(config, items): if config.getoption("--skip-slow"): skip_slow = pytest.mark.skip(reason="skipped due to --skip-slow")