Skip to content

Commit f60c9bf

Browse files
committed
Merge branch 'main' into resource_requirements
2 parents 96af192 + 52e6144 commit f60c9bf

14 files changed

Lines changed: 294 additions & 68 deletions

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1719

1820
- name: Install Pixi
1921
uses: prefix-dev/setup-pixi@v0.8.1
@@ -26,6 +28,14 @@ jobs:
2628
pixi list --locked
2729
shell: bash
2830

31+
- name: Validate commit messages
32+
if: github.event_name == 'pull_request'
33+
run: |
34+
pixi run check-commits
35+
shell: pixi run bash -e {0}
36+
env:
37+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
38+
2939
- name: Run pre-commit
3040
run: |
3141
pixi run pre-commit-install

.gitlint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[general]
2+
contrib=CT1
3+
ignore=B6

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ repos:
1919
args: ["--fix"]
2020
- id: ruff-format
2121

22+
- repo: https://github.com/jorisroovers/gitlint
23+
rev: v0.19.1
24+
hooks:
25+
- id: gitlint
26+
stages: [commit-msg]
27+
2228
- repo: https://github.com/pre-commit/mirrors-mypy
2329
rev: v1.7.1
2430
hooks:

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## [1.2.0](https://github.com/DIRACGrid/dirac-cwl/compare/v1.1.3...v1.2.0) (2026-02-20)
4+
5+
6+
### Features
7+
8+
* **executor:** deal with remote PFNs ([#122](https://github.com/DIRACGrid/dirac-cwl/issues/122)) ([d96cb63](https://github.com/DIRACGrid/dirac-cwl/commit/d96cb633e9ae9dc325fee9bc2b4bd247306f7206))
9+
10+
## [1.1.3](https://github.com/DIRACGrid/dirac-cwl/compare/v1.1.2...v1.1.3) (2026-02-17)
11+
12+
13+
### Bug Fixes
14+
15+
* **executor:** run pure_python hook before ANY cwltool import ([#120](https://github.com/DIRACGrid/dirac-cwl/issues/120)) ([747a4b2](https://github.com/DIRACGrid/dirac-cwl/commit/747a4b239288ed78987b2179ee8802ea5d27ba8c))
16+
17+
## [1.1.2](https://github.com/DIRACGrid/dirac-cwl/compare/v1.1.1...v1.1.2) (2026-02-17)
18+
19+
20+
### Bug Fixes
21+
22+
* move mypy to optional-deps ([#118](https://github.com/DIRACGrid/dirac-cwl/issues/118)) ([d59d4c0](https://github.com/DIRACGrid/dirac-cwl/commit/d59d4c04a7f1d1fe9a47f4ebcd908c95e2d42d64))
23+
24+
## [1.1.1](https://github.com/DIRACGrid/dirac-cwl/compare/v1.1.0...v1.1.1) (2026-02-16)
25+
26+
27+
### Bug Fixes
28+
29+
* remove library-level basicConfig and clean up logging ([#113](https://github.com/DIRACGrid/dirac-cwl/issues/113)) ([5c8f200](https://github.com/DIRACGrid/dirac-cwl/commit/5c8f2008d9c91212d920fc062a8ed1cec48b214d))
30+
331
## [1.1.0](https://github.com/DIRACGrid/dirac-cwl/compare/v1.0.2...v1.1.0) (2026-02-06)
432

533

pixi.lock

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

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dependencies = [
3131
"diracx-client>=0.0.8",
3232
"diracx-cli>=0.0.8",
3333
"lbprodrun",
34-
"mypy", # usually dev-only, see note below
3534
"pydantic",
3635
"pyyaml",
3736
"typer",
@@ -41,7 +40,7 @@ dependencies = [
4140
]
4241

4342
[project.optional-dependencies]
44-
testing = ["pytest>=6", "pytest-mock"]
43+
testing = ["pytest>=6", "pytest-mock", "mypy"]
4544

4645
[project.scripts]
4746
dirac-cwl = "dirac_cwl:app"
@@ -113,6 +112,7 @@ pytest-asyncio = ">=1.3.0,<2"
113112
# Ensure the package is installed in editable mode in the Pixi environment
114113
[tool.pixi.pypi-dependencies]
115114
dirac-cwl = { path = ".", editable = true }
115+
gitlint-core = "*"
116116

117117
[tool.pixi.tasks]
118118
help = "echo 'Available tasks: test, lint, schemas, schemas-json, schemas-yaml, clean-schemas, test-schemas, check-schemas, validate-schemas'"
@@ -179,5 +179,8 @@ print('All schemas are valid!')
179179
"
180180
"""
181181

182-
pre-commit-install = "pre-commit install"
182+
pre-commit-install = "pre-commit install --hook-type pre-commit --hook-type commit-msg"
183183
pre-commit-run = "pre-commit run -a"
184+
185+
# Validate commit messages on current branch against main
186+
check-commits = { cmd = "bash -c 'gitlint --commits ${BASE_SHA:-$(git merge-base HEAD origin/main)}..HEAD'" }

src/dirac_cwl/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from dirac_cwl.production import app as production_app
1010
from dirac_cwl.transformation import app as transformation_app
1111

12-
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s | %(name)s | %(levelname)s | %(message)s")
13-
1412
try:
1513
__version__ = version("dirac-cwl")
1614
except PackageNotFoundError:
@@ -19,6 +17,16 @@
1917

2018
app = typer.Typer()
2119

20+
21+
@app.callback(invoke_without_command=True)
22+
def _configure_logging():
23+
"""Configure logging when the CLI is invoked (not on import)."""
24+
logging.basicConfig(
25+
level=logging.DEBUG,
26+
format="%(asctime)s | %(name)s | %(levelname)s | %(message)s",
27+
)
28+
29+
2230
# Add sub-apps
2331
app.add_typer(production_app, name="production")
2432
app.add_typer(transformation_app, name="transformation")

src/dirac_cwl/job/executor/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
functionality, including replica map management.
55
"""
66

7-
from .executor import DiracExecutor, dirac_executor_factory
7+
# Install the mypyc compatibility hook before any cwltool import.
8+
# executor.py imports cwltool.executors which transitively imports
9+
# cwltool.command_line_tool — the hook must be in place first.
10+
from ._mypyc_compat import install as _install_pure_python_hook
11+
12+
_install_pure_python_hook()
13+
14+
from .executor import DiracExecutor, dirac_executor_factory # noqa: E402
815

916
__all__ = ["DiracExecutor", "dirac_executor_factory"]

0 commit comments

Comments
 (0)