Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.2.0 #3

Merged
merged 13 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -48,9 +48,9 @@ jobs:
- name: Lint with Ruff
run: poetry run ruff check
- name: Check code security with Bandit
run: poetry run bandit -r src tests -c pyproject.toml
run: poetry run bandit -c pyproject.toml -r .
- name: Typing with mypy
run: poetry run mypy --check src
run: poetry run mypy
- name: Format with Ruff
run: poetry run ruff format --check
- name: Test with pytest
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -48,12 +48,16 @@ jobs:
- name: Lint with Ruff
run: poetry run ruff check
- name: Check code security with Bandit
run: poetry run bandit -r src tests -c pyproject.toml
run: poetry run bandit -c pyproject.toml -r .
- name: Typing with mypy
run: poetry run mypy --check src
run: poetry run mypy
- name: Format with Ruff
run: poetry run ruff format --check
- name: Test with pytest
run: poetry run pytest --cov=src --cov-report=xml
- name: Build docs with Material for MkDocs
run: poetry run mkdocs build
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ repos:

# bandit - find common security issues
- repo: https://github.com/pycqa/bandit
rev: 1.7.6
rev: 1.7.7
hooks:
- id: bandit
name: bandit
args: [-c, pyproject.toml, -r, src, tests]
args: [-c, pyproject.toml, -r, .]

# ruff - linting and format
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down Expand Up @@ -68,10 +68,10 @@ repos:
types: [text, markdown]
pass_filenames: false

# poetry - check, lock, and install
- repo: https://github.com/python-poetry/poetry
rev: "1.7.1"
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
- id: poetry-install
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
![CI](https://github.com/kiraware/PyBMKG/actions/workflows/ci.yml/badge.svg)
[![Docs](https://readthedocs.org/projects/pybmkg/badge/?version=latest)](https://pybmkg.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/kiraware/PyBMKG/graph/badge.svg?token=MN6AXAHO0P)](https://codecov.io/gh/kiraware/PyBMKG)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Ruff](https://camo.githubusercontent.com/7f995d42c2de5a9eb8ced2df552a0813050d324427a3facabfcfa5f88cb11c59/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f636861726c6965726d617273682f727566662f6d61696e2f6173736574732f62616467652f76312e6a736f6e)](https://github.com/astral-sh/ruff)
[![pypi](https://img.shields.io/pypi/v/PyBMKG.svg)](https://pypi.org/project/PyBMKG/)
[![python](https://img.shields.io/pypi/pyversions/PyBMKG.svg)](https://pypi.org/project/PyBMKG/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/license/mit/)

This is documentation for the `PyBMKG` project that
is an asynchronous api wrapper written in Python for
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
![CI](https://github.com/kiraware/PyBMKG/actions/workflows/ci.yml/badge.svg)
[![Docs](https://readthedocs.org/projects/pybmkg/badge/?version=latest)](https://pybmkg.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/kiraware/PyBMKG/graph/badge.svg?token=MN6AXAHO0P)](https://codecov.io/gh/kiraware/PyBMKG)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Ruff](https://camo.githubusercontent.com/7f995d42c2de5a9eb8ced2df552a0813050d324427a3facabfcfa5f88cb11c59/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f636861726c6965726d617273682f727566662f6d61696e2f6173736574732f62616467652f76312e6a736f6e)](https://github.com/astral-sh/ruff)
[![pypi](https://img.shields.io/pypi/v/PyBMKG.svg)](https://pypi.org/project/PyBMKG/)
[![python](https://img.shields.io/pypi/pyversions/PyBMKG.svg)](https://pypi.org/project/PyBMKG/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/license/mit/)

This is documentation for the `PyBMKG` project that
is an asynchronous api wrapper written in Python for
Expand Down
16 changes: 3 additions & 13 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,7 @@ async def main():

for area, weathers in weather_forecast_data.weathers.items():
if area.type == Type.LAND:
print(
area.id,
area.coordinate,
area.type,
area.region,
area.level,
area.description,
area.domain,
area.tags,
area.names,
)
print(area)

for weather in weathers:
print(weather.datetime)
Expand All @@ -277,9 +267,9 @@ Example output:
Data(source='meteofactory', productioncenter='NC Jakarta')
Forecast(domain='local')
2024-01-18 03:13:02
501409 Coordinate(latitude=4.176594, longitude=96.124878) Type.LAND 1 Aceh Barat Aceh Name(en_US='Aceh Barat', id_ID='Kab. Aceh Barat')
Area(id='501409', coordinate=Coordinate(latitude=4.176594, longitude=96.124878), type=<Type.LAND: 'land'>, region='', level='1', description='Aceh Barat', domain='Aceh', tags='', names=Name(en_US='Aceh Barat', id_ID='Kab. Aceh Barat'))
2024-01-18 00:00:00
Weather.PARTLY_CLOUDY
1
Temperature(celcius=25.0, fahrenheit=77.0)
Temperature(celcius=25.0, fahrenheit=77.0)
Temperature(celcius=32.0, fahrenheit=89.6)
Expand Down
Loading
Loading