Skip to content

Commit 6adc9c7

Browse files
author
btraven00
committed
feat: show compat and commit version
we display 3 additional badges: - last commit in git repo, with link - last updated for the git repo (color-coded for freshness) - lower snakemake version that depends on the same version of the interface that the plugin depends on
1 parent 93de4d9 commit 6adc9c7

12 files changed

Lines changed: 664 additions & 54 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ jobs:
2121
- name: QC
2222
run: pixi run qc
2323

24+
test-unit:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: prefix-dev/setup-pixi@v0.9.0
30+
with:
31+
cache: true
32+
33+
- name: Unit Tests
34+
run: pixi run test-unit
35+
2436
test-fast:
2537
runs-on: ubuntu-latest
38+
needs: test-unit
2639
steps:
2740
- uses: actions/checkout@v4
2841

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,5 @@ cython_debug/
165165
# pixi environments
166166
.pixi
167167
*.egg-info
168+
169+
.envrc

pixi.lock

Lines changed: 72 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ platforms = ["linux-64"]
66
version = "0.1.0"
77

88
[tasks]
9+
test-unit = "pytest source/test_collect_plugins.py -v"
910
build = "sphinx-build source build"
1011
build-single = { cmd = "sphinx-build source build", env = { TEST_PACKAGES = "snakemake-executor-plugin-cluster-generic" }}
1112
qc = "ruff format --check && ruff check"
@@ -22,6 +23,7 @@ pkgconfig = ">=1.5.5,<2"
2223
ruff = ">=0.12.11,<0.13"
2324
gitpython = ">=3.1.46,<4"
2425
git = ">=2.53.0,<3"
26+
pytest = ">=8.0.0,<9"
2527

2628
[pypi-dependencies]
2729
sphinxawesome-theme = ">=5.3.2, <6"

source/_static/custom.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.image-reference img {
22
display: inline;
3+
margin-right: 4px;
34
}
45

56
.image-reference {
67
border-bottom: none !important;
8+
font-size: 0;
79
}
810

911
table code.literal {

source/_templates/executor_plugin.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block type %}executor{% endblock %}
44

55
{% block usage %}
6-
In order to use the plugin, run Snakemake (>=8.0) in the folder where your workflow code and config resides (containing either ``workflow/Snakefile`` or ``Snakefile``) with the corresponding value for the executor flag::
6+
In order to use the plugin, run Snakemake ({{ snakemake_version if snakemake_version else ">=8.0" }}) in the folder where your workflow code and config resides (containing either ``workflow/Snakefile`` or ``Snakefile``) with the corresponding value for the executor flag::
77

88
snakemake --executor {{ plugin_name }} --default-resources --jobs N ...
99

source/_templates/logger_plugin.rst.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
{% block type %}logger{% endblock %}
44

55
{% block usage %}
6-
In order to use the plugin, run Snakemake (>=9.0) with the corresponding value for the logger flag::
6+
In order to use the plugin, run Snakemake ({{ snakemake_version if snakemake_version else ">=9.0" }}) with the corresponding value for the logger flag::
77

88
snakemake --logger {{ plugin_name }} ...
99

1010
with ``...`` being any additional arguments you want to use.
11-
{% endblock %}
11+
{% endblock %}

source/_templates/plugin_base.rst.j2

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,36 @@
44
Snakemake {% block type %}{% endblock %} plugin: {{ plugin_name }}
55
###########################################
66

7-
{% if repository is not none %}
7+
{% if repository is not none -%}
88
.. image:: https://img.shields.io/badge/repository-{{ repository_type }}-blue?color=%23022c22
99
:target: {{ repository }}
10-
{% else %}
10+
{% else -%}
1111
.. image:: https://img.shields.io/badge/repository-unknown-blue?color=%23022c22
1212
:target: #
13-
{% endif %}
14-
15-
{% for author in authors %}
13+
{% endif -%}
14+
{% if commit_info is not none -%}
15+
.. image:: https://img.shields.io/badge/last_commit-{{ commit_info["sha"] }}-green?color={{ commit_age_color }}
16+
:alt: Last commit
17+
:target: {{ commit_url }}
18+
.. image:: https://img.shields.io/badge/last_updated-{{ commit_date_label }}-green?color={{ commit_age_color }}
19+
:alt: Last updated
20+
:target: {{ commit_url }}
21+
{% endif -%}
22+
{% for author in authors -%}
1623
.. image:: https://img.shields.io/badge/author-{{author|replace("-","--")|urlencode}}-purple?color=%23064e3b
1724
:target: https://pypi.org/project/{{ package_name }}
18-
{% endfor %}
19-
25+
{% endfor -%}
2026
.. image:: https://img.shields.io/pypi/v/{{ package_name }}?color=%23047857
2127
:alt: PyPI - Version
2228
:target: https://pypi.org/project/{{ package_name }}
23-
2429
.. image:: https://img.shields.io/pypi/l/{{ package_name }}?color=%2310b981
2530
:alt: PyPI - License
2631
:target: https://pypi.org/project/{{ package_name }}
32+
{% if snakemake_version is not none %}
33+
.. image:: https://img.shields.io/badge/snakemake-{{ snakemake_version|replace("-", "--") }}-blue?color=%230ea5e9
34+
:alt: Snakemake
35+
:target: https://snakemake.readthedocs.io
36+
{% endif %}
2737

2838
{% if repository is not none and not repository.startswith("https://github.com/snakemake/") %}
2939
.. warning::

source/_templates/report_plugin.rst.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
{% block type %}report{% endblock %}
44

55
{% block usage %}
6-
In order to use the plugin, run Snakemake (>=8.5) with the corresponding value for the reporter flag::
6+
In order to use the plugin, run Snakemake ({{ snakemake_version if snakemake_version else ">=8.5" }}) with the corresponding value for the reporter flag::
77

88
snakemake --reporter {{ plugin_name }} ...
99

1010
with ``...`` being any additional arguments you want to use.
11-
{% endblock %}
11+
{% endblock %}

source/_templates/scheduler_plugin.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block type %}scheduler{% endblock %}
44

55
{% block usage %}
6-
In order to use the plugin, run Snakemake (>=9.0) with the corresponding value for the scheduler flag::
6+
In order to use the plugin, run Snakemake ({{ snakemake_version if snakemake_version else ">=9.0" }}) with the corresponding value for the scheduler flag::
77

88
snakemake --scheduler {{ plugin_name }} ...
99

0 commit comments

Comments
 (0)