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
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,21 @@ jobs:
SHA256SUMS.txt
if-no-files-found: error

- name: Create GitHub release
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
gh release create "${GITHUB_REF_NAME}" \
dist/* \
diffractscout-${GITHUB_REF_NAME}-*.zip \
SHA256SUMS.txt \
--verify-tag \
--generate-notes \
--title "DiffractScout ${GITHUB_REF_NAME}"
assets=(
dist/*
diffractscout-${GITHUB_REF_NAME}-*.zip
SHA256SUMS.txt
)
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
gh release upload "${GITHUB_REF_NAME}" "${assets[@]}" --clobber
else
gh release create "${GITHUB_REF_NAME}" "${assets[@]}" \
--verify-tag \
--generate-notes \
--title "DiffractScout ${GITHUB_REF_NAME}"
fi
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test = [
"pytest-cov>=5.0",
"ruff>=0.5",
"PyYAML>=6.0",
"tomli>=2.0; python_version < '3.11'",
]
paper = [
"matplotlib>=3.7",
Expand Down Expand Up @@ -91,6 +92,12 @@ target-version = "py310"
select = ["E4", "E7", "E9", "F"]
ignore = ["E501"]

# The crystallographic h, k, l convention is part of the public result schema
# and of the directional-elasticity equations in these domain modules.
[tool.ruff.lint.per-file-ignores]
"src/diffractscout/elasticity.py" = ["E741"]
"src/diffractscout/models.py" = ["E741"]

[tool.coverage.run]
omit = [
"src/diffractscout/gui.py",
Expand Down
6 changes: 5 additions & 1 deletion scripts/check_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
from pathlib import Path
import re
import sys
import tomllib
from urllib.parse import unquote

try:
import tomllib
except ModuleNotFoundError: # Python 3.10
import tomli as tomllib

try:
import yaml
except ImportError as exc: # pragma: no cover - release dependency supplies it
Expand Down
2 changes: 1 addition & 1 deletion src/diffractscout/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def build_parser() -> argparse.ArgumentParser:
benchmark.add_argument("--overwrite", action="store_true")
benchmark.add_argument("--json", action="store_true")

gui = subparsers.add_parser("gui", help="Launch the optional Tk desktop interface.")
subparsers.add_parser("gui", help="Launch the optional Tk desktop interface.")
return parser


Expand Down
6 changes: 4 additions & 2 deletions tests/test_archive_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ def _sha256(path: Path) -> str:
def test_reproducible_archive_is_byte_identical(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
source = tmp_path / "evidence"
(source / "nested").mkdir(parents=True)
(source / "z.txt").write_text("zeta\n", encoding="utf-8")
(source / "nested" / "a.json").write_text('{"a": 1}\n', encoding="utf-8")
# Write exact fixture bytes so the archive contract is tested independently
# of platform-specific text newline translation.
(source / "z.txt").write_bytes(b"zeta\n")
(source / "nested" / "a.json").write_bytes(b'{"a": 1}\n')
monkeypatch.setenv("SOURCE_DATE_EPOCH", "1786492800")

first = MODULE.create_reproducible_zip(source, tmp_path / "first.zip", root_name="bundle")
Expand Down