Skip to content

Commit

Permalink
Bump dacite to version >= 1.7.0 (#116)
Browse files Browse the repository at this point in the history
* Bump dacite to version >= 1.7.0

* Remove support for Python 3.9
  • Loading branch information
bieniu authored Feb 12, 2023
1 parent 3a3de5b commit aac6a36
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 43 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.9"
python-version: "3.10"

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Create Pull Request
uses: peter-evans/[email protected]
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"

Expand Down
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.0.1
hooks:
- id: autoflake
args:
Expand All @@ -15,7 +15,7 @@ repos:
- --remove-all-unused-imports
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args:
Expand All @@ -37,13 +37,13 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- pycodestyle==2.8.0
- pyflakes==2.4.0
- flake8-docstrings==1.6.0
- pydocstyle==6.1.1
- flake8-comprehensions==3.7.0
- flake8-noqa==1.2.0
- mccabe==0.6.1
- pycodestyle
- pyflakes
- flake8-docstrings
- pydocstyle
- flake8-comprehensions
- flake8-noqa
- mccabe
files: ^(gios|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
Expand All @@ -53,7 +53,7 @@ repos:
- --quiet
files: ^(gios)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: v5.11.3
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -63,11 +63,11 @@ repos:
args:
- --branch=master
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
rev: v1.29.0
hooks:
- id: yamllint
- repo: https://github.com/prettier/prettier
rev: 2.5.1
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
stages: [manual]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Maciej Bieniek
Copyright 2023 Maciej Bieniek

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 0 additions & 3 deletions gios/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""Python wrapper for getting air quality data from GIOS."""

from __future__ import annotations

import logging
from contextlib import suppress
from http import HTTPStatus
Expand Down
23 changes: 11 additions & 12 deletions gios/model.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
"""Type definitions for GIOS."""
from dataclasses import dataclass
from typing import Optional, Union


@dataclass
class Sensor:
"""Data class for sensor."""

name: str
id: Optional[int]
index: Optional[str] = None
value: Optional[Union[float, str]] = None
id: int | None
index: str | None = None
value: float | str | None = None


@dataclass
class GiosSensors:
"""Data class for polutants."""

aqi: Optional[Sensor]
c6h6: Optional[Sensor]
co: Optional[Sensor]
no2: Optional[Sensor]
o3: Optional[Sensor]
pm10: Optional[Sensor]
pm25: Optional[Sensor]
so2: Optional[Sensor]
aqi: Sensor | None
c6h6: Sensor | None
co: Sensor | None
no2: Sensor | None
o3: Sensor | None
pm10: Sensor | None
pm25: Sensor | None
so2: Sensor | None
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aiohttp>=3.7.0
dacite
dacite>=1.7.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ignore =
profile = black

[mypy]
python_version = 3.9
python_version = 3.10
show_error_codes = true
follow_imports = silent
ignore_missing_imports = true
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Setup module for gios."""
from pathlib import Path

from setuptools import setup

PROJECT_DIR = Path(__file__).parent.resolve()
Expand All @@ -18,7 +19,7 @@
license="Apache-2.0 License",
packages=["gios"],
package_data={"gios": ["py.typed"]},
python_requires=">=3.9",
python_requires=">=3.10",
install_requires=list(
val.strip() for val in open("requirements.txt", encoding="utf-8")
),
Expand All @@ -28,7 +29,6 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[tox]
envlist = py39, py310, py311, lint, typing, coverage
envlist = py310, py311, lint, typing, coverage
skip_missing_interpreters = True

[gh-actions]
python =
3.9: py39, lint, typing, coverage
3.10: py310
3.10: py310, lint, typing, coverage
3.11: py311

[testenv]
Expand Down

0 comments on commit aac6a36

Please sign in to comment.