Skip to content
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
19 changes: 14 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,40 @@ jobs:
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.8", "3.13" ]
grafana-version: [ "6.7.6", "7.5.17", "8.5.27", "9.5.18", "10.3.5", "10.4.1", "11.2.2" ]
grafana-version: [ "6.7.6", "7.5.17", "8.5.27", "9.5.21", "10.3.12", "10.4.14", "11.4.0" ]

env:
OS_TYPE: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
GRAFANA_VERSION: ${{ matrix.grafana-version }}
UV_SYSTEM_PYTHON: true

name: Python ${{ matrix.python-version }}, Grafana ${{ matrix.grafana-version }}
steps:

- name: Acquire sources
uses: actions/checkout@v4

- name: Setup Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'setup.py'

- name: Setup Project
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
cache-dependency-glob: |
setup.py
cache-suffix: ${{ matrix.python-version }}
enable-cache: true
version: "latest"

- name: Set up project
run: |
pip install pip 'setuptools>=64' --upgrade
pip install --editable='.[test]'
uv pip install --editable='.[test]'

- name: Run tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.idea
/.venv*
/var
/build
/dist
.coverage
coverage.xml
Expand Down
45 changes: 36 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
FROM python:3.11-slim-bullseye
# -----
# Build
# -----
FROM python:3.13-bookworm AS build

# For more verbose output, use:
# export BUILDKIT_PROGRESS=plain

# Configure operating system
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=linux

# Install prerequisites
RUN apt-get update
RUN apt-get --yes install jq
# Configure build environment
ENV PIP_ROOT_USER_ACTION=ignore
ENV UV_COMPILE_BYTECODE=true
ENV UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=never

# Provide package sources
COPY . /src

# Install package and dependencies
RUN \
--mount=type=cache,id=pip,target=/root/.cache/pip \
--mount=type=cache,id=uv,target=/root/.cache/uv \
true \
&& pip install uv \
&& uv venv --no-project --relocatable /app \
&& uv pip install --directory=/app /src

# Install optional software
RUN wget --quiet --output-document=/tmp/jq "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64"
RUN chmod +x /tmp/jq

# Provide sources
COPY . /app

# Install package
WORKDIR /app
RUN pip install --prefer-binary .
# ------------
# Distribution
# ------------
FROM python:3.13-slim-bookworm
COPY --from=build /app /opt/grafana-wtf
COPY --from=build /tmp/jq /usr/local/bin/jq
ENV PATH="$PATH:/opt/grafana-wtf/bin"
9 changes: 5 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ grafana-wtf
*****
About
*****
grafana-wtf - grep through all Grafana entities in the spirit of `git-wtf`_.

.. _git-wtf: http://thrawn01.org/posts/2014/03/03/git-wtf/
grafana-wtf - grep through all Grafana entities in the spirit of `git-wtf`_,
see also `Introduction to GIT WTF`_.

.. attention::

Expand Down Expand Up @@ -112,7 +111,7 @@ Install ``grafana-wtf``
=======================
::

pip install grafana-wtf
pipx install grafana-wtf


Configure Grafana
Expand Down Expand Up @@ -277,4 +276,6 @@ Development
pytest --keepalive -vvv -k test_find_textual


.. _git-wtf: https://github.com/DanielVartanov/willgit/blob/master/bin/git-wtf
.. _grafana-wtf examples: https://github.com/grafana-toolbox/grafana-wtf/blob/main/doc/examples.rst
.. _Introduction to GIT WTF: https://web.archive.org/web/20230921074244/https://thrawn01.org/posts/2014/03/03/git-wtf/
Loading