diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d3f3b2..72bd133 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,8 +22,7 @@ jobs: strategy: matrix: python: - - "3.9" - - "3.10" + - "3.11" steps: - uses: actions/checkout@v3 @@ -96,7 +95,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: . push: true diff --git a/pyproject.toml b/pyproject.toml index 1b7aad5..f1a4c19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,30 @@ +name = "rubin-influx-tools" +description = "Tools for managing InfluxDB2-based monitoring" +license = { file = "LICENSE" } +readme = "README.md" +keywords = ["rubin", "influx", "influxdb", "influxdb2"] +# https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: POSIX", + "Typing :: Typed", +] +requires-python = ">=3.11" +# Use requirements/main.in for runtime dependencies instead. +dependencies = [] +dynamic = ["version"] [build-system] requires = [ - "setuptools>=42", + "setuptools>=61", "wheel", - "setuptools_scm[toml]>=3.4" + "setuptools_scm[toml]>=6.2" ] build-backend = 'setuptools.build_meta' - [options] include_package_data = true @@ -72,7 +91,7 @@ exclude_lines = [ [tool.black] line-length = 79 -target-version = ['py39'] +target-version = ['py311'] exclude = ''' /( \.eggs @@ -91,7 +110,7 @@ exclude = ''' [tool.isort] include_trailing_comma = true multi_line_output = 3 -known_first_party = ["nublado2", "tests"] +known_first_party = ["rubin-influx-tools", "tests"] skip = ["docs/conf.py"] [tool.pytest.ini_options] @@ -99,3 +118,15 @@ python_files = [ "tests/*.py", "tests/*/*.py" ] + +[tool.mypy] +disallow_untyped_defs = true +disallow_incomplete_defs = true +ignore_missing_imports = true +local_partial_types = true +no_implicit_reexport = true +show_error_codes = true +strict_equality = true +warn_redundant_casts = true +warn_unreachable = true +warn_unused_ignores = true diff --git a/requirements/dev.in b/requirements/dev.in index feb4e86..13720fa 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -11,4 +11,5 @@ pre-commit coverage[toml] mypy pytest +pytest-cov types-PyYAML diff --git a/requirements/dev.txt b/requirements/dev.txt index cf69a28..f54481e 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --config=pyproject.toml --generate-hashes --output-file=requirements/dev.txt requirements/dev.in @@ -69,15 +69,13 @@ coverage[toml]==7.2.7 \ --hash=sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e \ --hash=sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850 \ --hash=sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3 - # via -r requirements/dev.in + # via + # -r requirements/dev.in + # pytest-cov distlib==0.3.7 \ --hash=sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057 \ --hash=sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8 # via virtualenv -exceptiongroup==1.1.2 \ - --hash=sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5 \ - --hash=sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f - # via pytest filelock==3.12.2 \ --hash=sha256:002740518d8aa59a26b0c76e10fb8c6e15eae825d34b6fdf670333fd7b938d81 \ --hash=sha256:cbb791cdea2a72f23da6ac5b5269ab0a0d161e9ef0100e653b69049a7706d1ec @@ -145,6 +143,12 @@ pre-commit==3.3.3 \ pytest==7.4.0 \ --hash=sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32 \ --hash=sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a + # via + # -r requirements/dev.in + # pytest-cov +pytest-cov==4.1.0 \ + --hash=sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6 \ + --hash=sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a # via -r requirements/dev.in pyyaml==6.0.1 \ --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ @@ -190,13 +194,6 @@ pyyaml==6.0.1 \ # via # -c requirements/main.txt # pre-commit -tomli==2.0.1 \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f - # via - # coverage - # mypy - # pytest types-pyyaml==6.0.12.11 \ --hash=sha256:7d340b19ca28cddfdba438ee638cd4084bde213e501a3978738543e27094775b \ --hash=sha256:a461508f3096d1d5810ec5ab95d7eeecb651f3a15b71959999988942063bf01d diff --git a/requirements/main.txt b/requirements/main.txt index 5ddcc6c..37c4bef 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --config=pyproject.toml --generate-hashes --output-file=requirements/main.txt requirements/main.in diff --git a/src/rubin_influx_tools/bucketmaker.py b/src/rubin_influx_tools/bucketmaker.py index 31ada3d..3c316e4 100644 --- a/src/rubin_influx_tools/bucketmaker.py +++ b/src/rubin_influx_tools/bucketmaker.py @@ -5,7 +5,7 @@ from typing import List, Set import yaml -from git import Repo +from git import Repo # type: ignore [attr-defined] from .influxclient import InfluxClient from .influxtypes import BucketGet, BucketPost, RetentionRule diff --git a/src/rubin_influx_tools/influxtypes.py b/src/rubin_influx_tools/influxtypes.py index 1aaf984..b720a63 100644 --- a/src/rubin_influx_tools/influxtypes.py +++ b/src/rubin_influx_tools/influxtypes.py @@ -159,7 +159,7 @@ class Permission: """A Permission for an InfluxDB v2 auth.""" action: str = "" # "read" or "write" - resource: Resource = Resource() + resource: Resource = field(default_factory=Resource) @dataclass @@ -194,6 +194,6 @@ class CheckPost: labels: List[Label] = field(default_factory=list) offset: str = "" orgID: str = "" - query: DashboardQuery = DashboardQuery() + query: DashboardQuery = field(default_factory=DashboardQuery) status: str = "active" type: str = "custom"