Skip to content

Commit

Permalink
Merge pull request #31 from lsst-sqre/tickets/DM-40160
Browse files Browse the repository at this point in the history
Modernize infrastructure: tickets/DM-40160
  • Loading branch information
athornton authored Jul 21, 2023
2 parents c441529 + fb8c53c commit 4d1c860
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 25 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
strategy:
matrix:
python:
- "3.9"
- "3.10"
- "3.11"

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -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
Expand Down
41 changes: 36 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -72,7 +91,7 @@ exclude_lines = [

[tool.black]
line-length = 79
target-version = ['py39']
target-version = ['py311']
exclude = '''
/(
\.eggs
Expand All @@ -91,11 +110,23 @@ 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]
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
1 change: 1 addition & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ pre-commit
coverage[toml]
mypy
pytest
pytest-cov
types-PyYAML
23 changes: 10 additions & 13 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rubin_influx_tools/bucketmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/rubin_influx_tools/influxtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

0 comments on commit 4d1c860

Please sign in to comment.