snakemake-logger-plugin-snkmt 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- snakemake_logger_plugin_snkmt-0.1.0/.github/workflows/release-please.yml +47 -0
- snakemake_logger_plugin_snkmt-0.1.0/.github/workflows/test.yml +68 -0
- snakemake_logger_plugin_snkmt-0.1.0/.gitignore +163 -0
- snakemake_logger_plugin_snkmt-0.1.0/CHANGELOG.md +21 -0
- snakemake_logger_plugin_snkmt-0.1.0/LICENSE +21 -0
- snakemake_logger_plugin_snkmt-0.1.0/PKG-INFO +59 -0
- snakemake_logger_plugin_snkmt-0.1.0/README.md +43 -0
- snakemake_logger_plugin_snkmt-0.1.0/pyproject.toml +71 -0
- snakemake_logger_plugin_snkmt-0.1.0/src/snakemake_logger_plugin_snkmt/__init__.py +62 -0
- snakemake_logger_plugin_snkmt-0.1.0/src/snakemake_logger_plugin_snkmt/event_handlers.py +303 -0
- snakemake_logger_plugin_snkmt-0.1.0/src/snakemake_logger_plugin_snkmt/log_handler.py +159 -0
- snakemake_logger_plugin_snkmt-0.1.0/src/snakemake_logger_plugin_snkmt/parsers.py +238 -0
- snakemake_logger_plugin_snkmt-0.1.0/src/snakemake_logger_plugin_snkmt/py.typed +0 -0
- snakemake_logger_plugin_snkmt-0.1.0/tests/test_models.py +231 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
branches:
|
|
4
|
+
- main
|
|
5
|
+
|
|
6
|
+
name: release-please
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release-please:
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
pull-requests: write
|
|
13
|
+
issues: write
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
outputs:
|
|
16
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: googleapis/release-please-action@v4
|
|
19
|
+
id: release
|
|
20
|
+
with:
|
|
21
|
+
release-type: python
|
|
22
|
+
|
|
23
|
+
publish-pypi:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
needs: release-please
|
|
26
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
|
27
|
+
environment:
|
|
28
|
+
name: release
|
|
29
|
+
permissions:
|
|
30
|
+
id-token: write
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Install Pixi
|
|
36
|
+
uses: prefix-dev/setup-pixi@v0.8.3
|
|
37
|
+
with:
|
|
38
|
+
environments: publish
|
|
39
|
+
pixi-version: v0.42.1
|
|
40
|
+
|
|
41
|
+
- name: Build source and wheel distribution + check build
|
|
42
|
+
# this will build the source and wheel into the dist/ directory
|
|
43
|
+
run: |
|
|
44
|
+
pixi run --environment publish check-build
|
|
45
|
+
|
|
46
|
+
- name: Publish distribution to PyPI
|
|
47
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches-ignore: []
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
checks: write
|
|
13
|
+
issues: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
quality-control:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Check out the code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Install Pixi
|
|
24
|
+
uses: prefix-dev/setup-pixi@v0.8.3
|
|
25
|
+
with:
|
|
26
|
+
environments: dev
|
|
27
|
+
pixi-version: v0.42.1
|
|
28
|
+
|
|
29
|
+
- name: Ruff Format
|
|
30
|
+
if: always()
|
|
31
|
+
run: |
|
|
32
|
+
pixi run --environment dev format --check
|
|
33
|
+
|
|
34
|
+
- name: Ruff lint
|
|
35
|
+
if: always()
|
|
36
|
+
run: |
|
|
37
|
+
pixi run --environment dev lint --diff
|
|
38
|
+
- name: Mypy
|
|
39
|
+
if: always()
|
|
40
|
+
run: |
|
|
41
|
+
pixi run --environment dev type-check
|
|
42
|
+
|
|
43
|
+
- name: Collect QC
|
|
44
|
+
run: echo "All quality control checks passed"
|
|
45
|
+
|
|
46
|
+
testing:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- name: Install Pixi
|
|
52
|
+
uses: prefix-dev/setup-pixi@v0.8.3
|
|
53
|
+
with:
|
|
54
|
+
environments: dev
|
|
55
|
+
pixi-version: v0.42.1
|
|
56
|
+
|
|
57
|
+
- name: Run tests
|
|
58
|
+
run: pixi run --environment dev test --show-capture=all -s -vv
|
|
59
|
+
|
|
60
|
+
- name: Upload lockfile as artifact
|
|
61
|
+
uses: actions/upload-artifact@v4
|
|
62
|
+
if: always()
|
|
63
|
+
id: upload-artifact
|
|
64
|
+
with:
|
|
65
|
+
name: pixi.lock.testing-${{ github.run_number }}
|
|
66
|
+
path: pixi.lock
|
|
67
|
+
retention-days: 1
|
|
68
|
+
overwrite: true
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
|
2
|
+
### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Python.gitignore
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
pixi.lock
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
56
|
+
|
|
57
|
+
# Translations
|
|
58
|
+
*.mo
|
|
59
|
+
*.pot
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
local_settings.py
|
|
64
|
+
db.sqlite3
|
|
65
|
+
db.sqlite3-journal
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# poetry
|
|
101
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
102
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
103
|
+
# commonly ignored for libraries.
|
|
104
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
105
|
+
#poetry.lock
|
|
106
|
+
|
|
107
|
+
# pdm
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
109
|
+
#pdm.lock
|
|
110
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
111
|
+
# in version control.
|
|
112
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
113
|
+
.pdm.toml
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.venv
|
|
128
|
+
env/
|
|
129
|
+
venv/
|
|
130
|
+
ENV/
|
|
131
|
+
env.bak/
|
|
132
|
+
venv.bak/
|
|
133
|
+
|
|
134
|
+
# Spyder project settings
|
|
135
|
+
.spyderproject
|
|
136
|
+
.spyproject
|
|
137
|
+
|
|
138
|
+
# Rope project settings
|
|
139
|
+
.ropeproject
|
|
140
|
+
|
|
141
|
+
# mkdocs documentation
|
|
142
|
+
/site
|
|
143
|
+
|
|
144
|
+
# mypy
|
|
145
|
+
.mypy_cache/
|
|
146
|
+
.dmypy.json
|
|
147
|
+
dmypy.json
|
|
148
|
+
|
|
149
|
+
# Pyre type checker
|
|
150
|
+
.pyre/
|
|
151
|
+
|
|
152
|
+
# pytype static type analyzer
|
|
153
|
+
.pytype/
|
|
154
|
+
|
|
155
|
+
# Cython debug symbols
|
|
156
|
+
cython_debug/
|
|
157
|
+
|
|
158
|
+
# PyCharm
|
|
159
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
160
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
161
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
162
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
163
|
+
#.idea/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2025-06-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* properly set workflow status ([9b79c42](https://github.com/cademirch/snakemake-logger-plugin-snkmt/commit/9b79c42f89699cad8cd69ed49bf690766fa5d80a))
|
|
9
|
+
* update database creation to handle migrations ([27829b1](https://github.com/cademirch/snakemake-logger-plugin-snkmt/commit/27829b11fb4ee603e2b4d7432f279e3c2a725934))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* fix dev dep ([c4a68bf](https://github.com/cademirch/snakemake-logger-plugin-snkmt/commit/c4a68bf501860f577e3ca37d4d3a510ba47a8c36))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* update readme ([41a6aed](https://github.com/cademirch/snakemake-logger-plugin-snkmt/commit/41a6aed19b4a06acf55edf5de667c2fe28fd231e))
|
|
20
|
+
|
|
21
|
+
## Changelog
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Cade Mirchandani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: snakemake-logger-plugin-snkmt
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Snakemake logger plugin that writes logs to SQLite database.
|
|
5
|
+
Author-email: Cade Mirchandani <cmirchan@ucsc.edu>
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: <4.0,>=3.11
|
|
8
|
+
Requires-Dist: snakemake-interface-logger-plugins>=1.2.0
|
|
9
|
+
Requires-Dist: sqlalchemy>=2.0.38
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: loguru>=0.7.3; extra == 'dev'
|
|
12
|
+
Requires-Dist: pytest>=8.3.5; extra == 'dev'
|
|
13
|
+
Requires-Dist: ruff>=0.9.10; extra == 'dev'
|
|
14
|
+
Requires-Dist: snakemake>=9.0.1; extra == 'dev'
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Snakemake Logger Plugin: snkmt
|
|
18
|
+
|
|
19
|
+
**This plugin is still under development and thus may not be fully stable or feature-complete. Use it at your own discretion and report any issues or suggestions to the repository's issue tracker.**
|
|
20
|
+
|
|
21
|
+
## Introduction
|
|
22
|
+
|
|
23
|
+
The **Snakemake Logger Plugin: snkmt** is a logger plugin for Snakemake that writes workflow execution logs to a SQLite database. This plugin enables detailed tracking of workflows, rules, jobs, and associated files, providing a structured and queryable format for analyzing workflow execution. This enables visual monitoring of workflows using [snkmt](https://github.com/cademirch/snkmt).
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
1. Install via pip: `pip install snakemake-logger-plugin-snkmt`
|
|
27
|
+
2. Run Snakemake with the `--logger snkmt` option to enable the snkmt logger.
|
|
28
|
+
|
|
29
|
+
## Options
|
|
30
|
+
TODO
|
|
31
|
+
|
|
32
|
+
## Design
|
|
33
|
+
1. **Log Handler**:
|
|
34
|
+
- The `sqliteLogHandler` class processes log records and delegates them to event handlers.
|
|
35
|
+
- Manages database sessions and ensures transactional consistency.
|
|
36
|
+
|
|
37
|
+
2. **Event Handlers**:
|
|
38
|
+
- Specialized handlers process specific log events (e.g., workflow start, job info, errors).
|
|
39
|
+
- Handlers parse log records and update the database models accordingly.
|
|
40
|
+
|
|
41
|
+
3. **Database Models**:
|
|
42
|
+
- SQLAlchemy models represent key entities such as workflows, rules, jobs, files, and errors.
|
|
43
|
+
- Models capture attributes and relationships for comprehensive logging. Model definitions are maintained in the[snkmt repo](https://github.com/cademirch/snkmt).
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
TODO
|
|
48
|
+
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
51
|
+
Contributions are welcome! Please follow these steps:
|
|
52
|
+
|
|
53
|
+
1. Fork the repository and create a new branch.
|
|
54
|
+
2. Make your changes and ensure all tests pass.
|
|
55
|
+
3. Submit a pull request with a detailed description of your changes.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
This project is licensed under the MIT License. See the `LICENSE` file for details.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Snakemake Logger Plugin: snkmt
|
|
2
|
+
|
|
3
|
+
**This plugin is still under development and thus may not be fully stable or feature-complete. Use it at your own discretion and report any issues or suggestions to the repository's issue tracker.**
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
The **Snakemake Logger Plugin: snkmt** is a logger plugin for Snakemake that writes workflow execution logs to a SQLite database. This plugin enables detailed tracking of workflows, rules, jobs, and associated files, providing a structured and queryable format for analyzing workflow execution. This enables visual monitoring of workflows using [snkmt](https://github.com/cademirch/snkmt).
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
1. Install via pip: `pip install snakemake-logger-plugin-snkmt`
|
|
11
|
+
2. Run Snakemake with the `--logger snkmt` option to enable the snkmt logger.
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Design
|
|
17
|
+
1. **Log Handler**:
|
|
18
|
+
- The `sqliteLogHandler` class processes log records and delegates them to event handlers.
|
|
19
|
+
- Manages database sessions and ensures transactional consistency.
|
|
20
|
+
|
|
21
|
+
2. **Event Handlers**:
|
|
22
|
+
- Specialized handlers process specific log events (e.g., workflow start, job info, errors).
|
|
23
|
+
- Handlers parse log records and update the database models accordingly.
|
|
24
|
+
|
|
25
|
+
3. **Database Models**:
|
|
26
|
+
- SQLAlchemy models represent key entities such as workflows, rules, jobs, files, and errors.
|
|
27
|
+
- Models capture attributes and relationships for comprehensive logging. Model definitions are maintained in the[snkmt repo](https://github.com/cademirch/snkmt).
|
|
28
|
+
|
|
29
|
+
## Development
|
|
30
|
+
|
|
31
|
+
TODO
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
Contributions are welcome! Please follow these steps:
|
|
36
|
+
|
|
37
|
+
1. Fork the repository and create a new branch.
|
|
38
|
+
2. Make your changes and ensure all tests pass.
|
|
39
|
+
3. Submit a pull request with a detailed description of your changes.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
This project is licensed under the MIT License. See the `LICENSE` file for details.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "snakemake-logger-plugin-snkmt"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Snakemake logger plugin that writes logs to SQLite database."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [{ name = "Cade Mirchandani", email = "cmirchan@ucsc.edu" }]
|
|
7
|
+
requires-python = "<4.0,>=3.11"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"snakemake-interface-logger-plugins>=1.2.0",
|
|
10
|
+
"sqlalchemy>=2.0.38",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[project.optional-dependencies]
|
|
14
|
+
dev = ["pytest>=8.3.5", "snakemake>=9.0.1", "ruff>=0.9.10", "loguru>=0.7.3"]
|
|
15
|
+
|
|
16
|
+
[build-system]
|
|
17
|
+
requires = ["hatchling"]
|
|
18
|
+
build-backend = "hatchling.build"
|
|
19
|
+
|
|
20
|
+
[tool.pixi.project]
|
|
21
|
+
channels = ["conda-forge"]
|
|
22
|
+
platforms = ["osx-arm64", "linux-64"]
|
|
23
|
+
|
|
24
|
+
[tool.pixi.pypi-dependencies]
|
|
25
|
+
snakemake-logger-plugin-snkmt = { path = ".", editable = true }
|
|
26
|
+
|
|
27
|
+
[tool.pixi.environments]
|
|
28
|
+
dev = { features = ["dev"] }
|
|
29
|
+
publish = { features = ["publish"] }
|
|
30
|
+
|
|
31
|
+
[tool.pixi.feature.dev.dependencies]
|
|
32
|
+
pytest = ">=8.3.5,<9"
|
|
33
|
+
ruff = ">=0.10.0,<0.11"
|
|
34
|
+
mypy = ">=1.15.0,<2"
|
|
35
|
+
pytest-cov = ">=6.0.0,<7"
|
|
36
|
+
|
|
37
|
+
[tool.pixi.feature.dev.pypi-dependencies]
|
|
38
|
+
snakemake-interface-logger-plugins = { git = "https://github.com/snakemake/snakemake-interface-logger-plugins.git" }
|
|
39
|
+
snkmt = {git = "https://github.com/cademirch/snkmt.git", editable=true}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
[tool.mypy]
|
|
43
|
+
ignore_missing_imports = true # Temporary until https://github.com/snakemake/snakemake-interface-common/pull/55
|
|
44
|
+
disallow_untyped_defs = true
|
|
45
|
+
warn_no_return = true
|
|
46
|
+
|
|
47
|
+
[tool.pixi.feature.dev.tasks]
|
|
48
|
+
format = "ruff format src"
|
|
49
|
+
lint = "ruff check"
|
|
50
|
+
type-check = "mypy src/"
|
|
51
|
+
qc = { depends-on = ["format", "lint", "type-check"] }
|
|
52
|
+
|
|
53
|
+
[tool.pixi.feature.dev.tasks.test]
|
|
54
|
+
cmd = [
|
|
55
|
+
"pytest",
|
|
56
|
+
"--cov=snakemake_logger_plugin_snkmt",
|
|
57
|
+
"--cov-report=xml:coverage-report/coverage.xml",
|
|
58
|
+
"--cov-report=term-missing",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Publish
|
|
63
|
+
[tool.pixi.feature.publish.dependencies]
|
|
64
|
+
twine = ">=6.1.0,<7"
|
|
65
|
+
python-build = ">=1.2.2,<2"
|
|
66
|
+
|
|
67
|
+
[tool.pixi.feature.publish.tasks]
|
|
68
|
+
build = { cmd = "python -m build", description = "Build the package into the dist/ directory" }
|
|
69
|
+
check-build = { cmd = "python -m twine check dist/*", depends-on = [
|
|
70
|
+
"build",
|
|
71
|
+
], description = "Check that the package can be uploaded" }
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from snakemake_interface_logger_plugins.base import LogHandlerBase
|
|
2
|
+
from snakemake_interface_logger_plugins.settings import LogHandlerSettingsBase
|
|
3
|
+
from snakemake_logger_plugin_snkmt.log_handler import sqliteLogHandler
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class LogHandlerSettings(LogHandlerSettingsBase):
|
|
11
|
+
db: Optional[Path] = field(
|
|
12
|
+
default=None,
|
|
13
|
+
metadata={
|
|
14
|
+
"help": "Set absolute path for database file. ",
|
|
15
|
+
"env_var": False,
|
|
16
|
+
"required": False,
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class LogHandler(LogHandlerBase, sqliteLogHandler):
|
|
22
|
+
def __post_init__(self) -> None:
|
|
23
|
+
sqliteLogHandler.__init__(
|
|
24
|
+
self,
|
|
25
|
+
self.common_settings,
|
|
26
|
+
db_path=self.settings.db, # type: ignore
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def writes_to_stream(self) -> bool:
|
|
31
|
+
"""
|
|
32
|
+
Whether this plugin writes to stderr/stdout
|
|
33
|
+
"""
|
|
34
|
+
return False
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def writes_to_file(self) -> bool:
|
|
38
|
+
"""
|
|
39
|
+
Whether this plugin writes to a file
|
|
40
|
+
"""
|
|
41
|
+
return False
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def has_filter(self) -> bool:
|
|
45
|
+
"""
|
|
46
|
+
Whether this plugin attaches its own filter
|
|
47
|
+
"""
|
|
48
|
+
return True
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def has_formatter(self) -> bool:
|
|
52
|
+
"""
|
|
53
|
+
Whether this plugin attaches its own formatter
|
|
54
|
+
"""
|
|
55
|
+
return True
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def needs_rulegraph(self) -> bool:
|
|
59
|
+
"""
|
|
60
|
+
Whether this plugin requires the DAG rulegraph.
|
|
61
|
+
"""
|
|
62
|
+
return True
|