Packaging/dev-tools/docs update #244
70 changed files with 1518 additions and 1327 deletions
|
|
@ -2,7 +2,7 @@
|
|||
---
|
||||
name: Codespell
|
||||
|
||||
on: workflow_dispatch
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
@ -10,13 +10,13 @@ permissions:
|
|||
jobs:
|
||||
codespell:
|
||||
name: Check for spelling errors
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: debian-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Codespell
|
||||
uses: codespell-project/actions-codespell@v2
|
||||
uses: https://github.com/codespell-project/actions-codespell@v2
|
||||
with:
|
||||
ignore_words_list: crate
|
||||
|
|
|
|||
36
.forgejo/workflows/mypy-pr.yml
Normal file
36
.forgejo/workflows/mypy-pr.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Type annotation (PR)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'dump_things_service/**.py'
|
||||
- '!**/tests/**.py'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- name: Checkout project
|
||||
uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
- name: Install hatch
|
||||
run: uv tool install hatch
|
||||
- name: Get Python changed files
|
||||
id: changed-py-files
|
||||
uses: https://github.com/tj-actions/changed-files@v46
|
||||
with:
|
||||
files: |
|
||||
*.py
|
||||
**/*.py
|
||||
- name: Type check changed files
|
||||
if: steps.changed-py-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
# get any type stubs that mypy thinks it needs
|
||||
# run mypy on the modified files only, and do not even follow imports.
|
||||
# this results is a fairly superficial test, but given the overall
|
||||
# state of annotations, we strive to become more correct incrementally
|
||||
# with focused error reports, rather than barfing a huge complaint
|
||||
# that is unrelated to the changeset someone has been working on.
|
||||
# run on the oldest supported Python version
|
||||
hatch run types:mypy --install-types --non-interactive --python-version 3.11 --follow-imports skip --pretty --show-error-context ${{ steps.changed-py-files.outputs.all_changed_files }}
|
||||
17
.forgejo/workflows/ruff.yml
Normal file
17
.forgejo/workflows/ruff.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
name: Ruff
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
ruff:
|
||||
name: Code linting
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- name: Checkout project
|
||||
uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
- name: Install hatch
|
||||
run: uv tool install hatch
|
||||
- name: Check code
|
||||
run: hatch check code
|
||||
- name: Check formatting
|
||||
run: hatch check fmt
|
||||
|
|
@ -12,9 +12,6 @@ jobs:
|
|||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
|
|
@ -23,14 +20,14 @@ jobs:
|
|||
|
||||
- name: Run tests
|
||||
run: |
|
||||
hatch run tests:run \
|
||||
hatch test \
|
||||
--ignore=dump_things_service/tests/test_generators.py \
|
||||
--ignore=dump_things_service/tests/test_ifabsent_patch.py
|
||||
|
||||
- name: Run generator tests
|
||||
run: |
|
||||
hatch run tests:run dump_things_service/tests/test_generators.py
|
||||
hatch test dump_things_service/tests/test_generators.py
|
||||
|
||||
- name: Run ifabsent-patch tests
|
||||
run: |
|
||||
hatch run tests:run dump_things_service/tests/test_ifabsent_patch.py
|
||||
hatch test dump_things_service/tests/test_ifabsent_patch.py
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@ dist/**
|
|||
tmp/**
|
||||
**/__pycache__
|
||||
**/.hypothesis
|
||||
.*.swp
|
||||
dump_things_service/_version.py
|
||||
|
|
|
|||
31
.readthedocs.yaml
Normal file
31
.readthedocs.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# .readthedocs.yaml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the OS, Python version and other tools you might need
|
||||
build:
|
||||
os: ubuntu-24.04
|
||||
tools:
|
||||
python: "3.12"
|
||||
|
||||
# Build documentation in the "docs/" directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# Optionally build your docs in additional formats such as PDF and ePub
|
||||
# formats:
|
||||
# - pdf
|
||||
# - epub
|
||||
|
||||
# Optional but recommended, declare the Python requirements required
|
||||
# to build your documentation
|
||||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
||||
python:
|
||||
install:
|
||||
- method: pip
|
||||
path: .
|
||||
extra_requirements:
|
||||
- docs
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
3. The top-level mapping `admin_tokens` was added.
|
||||
|
||||
- Configuration files are no longer read when the service is started. Instead
|
||||
the service reads its configuration from the store, if it is present. Thw tool
|
||||
the service reads its configuration from the store, if it is present. The tool
|
||||
(`dump-things-load-config`) can read an existing configuration
|
||||
file and manifest the described configuration on a running dump-things server.
|
||||
It supports pre version 6 config files and converts them to the new
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ Most endpoints require a *collection*. These correspond to the names of the "dat
|
|||
|
||||
The service provides the following user endpoints (In addition to user endpoints, there exist endpoints for curators. To view them, check the `/docs`-path in an installed service):
|
||||
|
||||
- `POST /maintenance`: this endpoint allows to set a collection into mantenance mode.
|
||||
- `POST /maintenance`: this endpoint allows to set a collection into maintenance mode.
|
||||
In maintenance mode, only tokens with curator-privileges can access the collection.
|
||||
The posted data is a JSON that contains the name of the collection and whether the maintenance state should be active or not, for example:
|
||||
```json
|
||||
|
|
|
|||
2
docs/.gitignore
vendored
Normal file
2
docs/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
_build
|
||||
generated
|
||||
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?= --fail-on-warning
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
0
docs/_static/.gitkeep
vendored
Normal file
0
docs/_static/.gitkeep
vendored
Normal file
48
docs/conf.py
Normal file
48
docs/conf.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
import dump_things_service
|
||||
|
||||
project = 'dump-things-server'
|
||||
copyright = '2025-2026, Christian Mönch'
|
||||
author = 'Christian Mönch'
|
||||
release = dump_things_service.__version__
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
extensions = [
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx_autodoc_typehints',
|
||||
'sphinx.ext.viewcode',
|
||||
]
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
primary_domain = 'py'
|
||||
autoclass_content = "both"
|
||||
|
||||
typehints_use_signature = True
|
||||
typehints_use_signature_return = True
|
||||
|
||||
# we build some docstrings from loguru. define some no-op substitutions
|
||||
# to avoid errors
|
||||
rst_prolog = """
|
||||
.. |Logger| replace:: Logger
|
||||
.. |add| replace:: add
|
||||
.. |sys.stderr| replace:: sys.stderr
|
||||
.. |str.format| replace:: str.format
|
||||
"""
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_static_path = ['_static']
|
||||
10
docs/index.rst
Normal file
10
docs/index.rst
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
The `dump-thing-server` documentation
|
||||
=====================================
|
||||
|
||||
HERE BE CONTENT...
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`search`
|
||||
|
|
@ -20,8 +20,9 @@ from starlette.status import (
|
|||
HTTP_503_SERVICE_UNAVAILABLE,
|
||||
)
|
||||
|
||||
from dump_things_service._version import __version__
|
||||
|
||||
__all__ = [
|
||||
'Format',
|
||||
'HTTP_200_OK',
|
||||
'HTTP_201_CREATED',
|
||||
'HTTP_300_MULTIPLE_CHOICES',
|
||||
|
|
@ -37,6 +38,8 @@ __all__ = [
|
|||
'HTTP_503_SERVICE_UNAVAILABLE',
|
||||
'JSON',
|
||||
'YAML',
|
||||
'Format',
|
||||
'__version__',
|
||||
'config_file_name',
|
||||
'reserved_collection_names',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import enum
|
||||
import hashlib
|
||||
import logging
|
||||
from collections.abc import Callable, Iterable
|
||||
from functools import partial
|
||||
from pathlib import (
|
||||
Path,
|
||||
PurePosixPath,
|
||||
)
|
||||
from typing import (
|
||||
Callable,
|
||||
Iterable,
|
||||
Literal,
|
||||
cast,
|
||||
)
|
||||
|
|
@ -17,7 +16,8 @@ from fastapi import HTTPException
|
|||
from pydantic import (
|
||||
BaseModel,
|
||||
ConfigDict,
|
||||
Field, ValidationError,
|
||||
Field,
|
||||
ValidationError,
|
||||
)
|
||||
from yaml.scanner import ScannerError
|
||||
|
||||
|
|
@ -27,12 +27,11 @@ from dump_things_service import (
|
|||
)
|
||||
from dump_things_service.audit.gitaudit import GitAuditBackend
|
||||
from dump_things_service.backends.record_dir import (
|
||||
_RecordDirStore,
|
||||
RecordDirStore,
|
||||
_RecordDirStore,
|
||||
)
|
||||
from dump_things_service.exceptions import ConfigError
|
||||
|
||||
|
||||
logger = logging.getLogger('dump_things_service')
|
||||
|
||||
g_abstract_configuration = None
|
||||
|
|
@ -103,7 +102,9 @@ class CollectionConfig(BaseModel):
|
|||
curated: PurePosixPath
|
||||
schema_location: str = Field(alias='schema')
|
||||
incoming: PurePosixPath | None = None
|
||||
backend: RecordDirBackendConfig | SQLiteBackendConfig = RecordDirBackendConfig(type='record_dir+stl')
|
||||
backend: RecordDirBackendConfig | SQLiteBackendConfig = RecordDirBackendConfig(
|
||||
type='record_dir+stl'
|
||||
)
|
||||
auth_sources: list[ForgejoAuthSpec | ConfigAuthSpec] = [ConfigAuthSpec()]
|
||||
audit_backends: list[GitAuditBackendConfig] = []
|
||||
submission_tags: TagSpec = TagSpec()
|
||||
|
|
@ -211,9 +212,7 @@ def get_config_backends(
|
|||
|
||||
if config_backend is None:
|
||||
config_backend = RecordDirStore(
|
||||
config_path,
|
||||
mapping_functions[MappingMethod.digest_md5],
|
||||
'yaml'
|
||||
config_path, mapping_functions[MappingMethod.digest_md5], 'yaml'
|
||||
)
|
||||
|
||||
audit_path = store_path / config_audit_path
|
||||
|
|
@ -259,7 +258,7 @@ def get_config() -> Configuration:
|
|||
if not g_abstract_configuration:
|
||||
msg = 'Configuration not yet loaded'
|
||||
raise RuntimeError(msg)
|
||||
return cast(Configuration, g_abstract_configuration)
|
||||
return cast('Configuration', g_abstract_configuration)
|
||||
|
||||
|
||||
def store_config(
|
||||
|
|
@ -274,7 +273,7 @@ def store_config(
|
|||
config_backend.add_record(
|
||||
iri=dump_things_config_iri,
|
||||
class_name='DumpThingsConfig',
|
||||
json_object=json_object
|
||||
json_object=json_object,
|
||||
)
|
||||
audit_backend.add_record(
|
||||
record=json_object,
|
||||
|
|
@ -314,10 +313,9 @@ def check_label(
|
|||
from dump_things_service.utils import get_on_disk_labels
|
||||
|
||||
"""Check that a label exists in a collection configuration or on disk"""
|
||||
if (
|
||||
label not in get_config_labels(abstract_config, collection)
|
||||
and label not in get_on_disk_labels(store_path, abstract_config, collection)
|
||||
):
|
||||
if label not in get_config_labels(
|
||||
abstract_config, collection
|
||||
) and label not in get_on_disk_labels(store_path, abstract_config, collection):
|
||||
raise HTTPException(
|
||||
status_code=HTTP_404_NOT_FOUND,
|
||||
detail=f"No incoming label: '{label}' in collection: '{collection}'.",
|
||||
|
|
@ -336,10 +334,7 @@ def get_config_labels(
|
|||
}
|
||||
|
||||
|
||||
def get_default_token_name(
|
||||
abstract_config: Configuration,
|
||||
collection: str
|
||||
) -> str:
|
||||
def get_default_token_name(abstract_config: Configuration, collection: str) -> str:
|
||||
check_collection(abstract_config, collection)
|
||||
return abstract_config.collections[collection].default_token
|
||||
|
||||
|
|
@ -377,7 +372,6 @@ def get_token_infos_for_collection(
|
|||
abstract_config: Configuration,
|
||||
collection_name: str,
|
||||
) -> Iterable[tuple[str, TokenConfig, TokenCollectionConfig]]:
|
||||
|
||||
yield from {
|
||||
(token_name, token_config, token_collection_config)
|
||||
for token_name, token_config in abstract_config.tokens.items()
|
||||
|
|
@ -391,7 +385,6 @@ def get_token_config_for_representation_and_collection(
|
|||
collection_name: str,
|
||||
token_representation: str,
|
||||
) -> tuple[str, TokenConfig, TokenCollectionConfig] | None:
|
||||
|
||||
token_info = get_token_info_by_representation(
|
||||
abstract_config=abstract_config,
|
||||
token_representation=token_representation,
|
||||
|
|
@ -421,7 +414,6 @@ def get_default_token_config(
|
|||
abstract_config: Configuration,
|
||||
collection: str,
|
||||
) -> TokenConfig | None:
|
||||
|
||||
default_token_name = get_collection_config_by_name(
|
||||
abstract_config,
|
||||
collection,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ from dump_things_service.abstract_config import (
|
|||
)
|
||||
from dump_things_service.instance_state import InstanceState
|
||||
|
||||
|
||||
logger = logging.getLogger('dump_things_service')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ committed.
|
|||
|
||||
Changes are annotated with a time stamp and a user-id
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
|
|
@ -23,12 +24,11 @@ import yaml
|
|||
from datalad_core.git_utils import apply_changeset
|
||||
from datalad_core.repo import Repo
|
||||
from datalad_core.runners import (
|
||||
call_git,
|
||||
CommandError,
|
||||
call_git,
|
||||
)
|
||||
|
||||
from . import AuditBackend
|
||||
|
||||
from dump_things_service.audit import AuditBackend
|
||||
|
||||
index_file_name = 'gitaudit_index.log'
|
||||
|
||||
|
|
@ -56,7 +56,6 @@ class FlushingThread(Thread):
|
|||
|
||||
|
||||
class GitAuditBackend(AuditBackend):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
path: Path,
|
||||
|
|
@ -69,7 +68,8 @@ class GitAuditBackend(AuditBackend):
|
|||
self.lock = Lock()
|
||||
self.last_flush_time = 0
|
||||
if auto_flush_timeout < 1:
|
||||
raise ValueError('auto_flush_timeout must be greater or equal to 1')
|
||||
msg = 'auto_flush_timeout must be greater or equal to 1'
|
||||
raise ValueError(msg)
|
||||
self.flushing_thread = FlushingThread(self, auto_flush_timeout)
|
||||
self.flushing_thread.start()
|
||||
self._init_repo()
|
||||
|
|
@ -125,32 +125,42 @@ class GitAuditBackend(AuditBackend):
|
|||
# the records
|
||||
changes = []
|
||||
yaml_location, log_location = map(str, self._get_location_for(record_id)[1:])
|
||||
commit_hashes = call_git(
|
||||
commit_hashes = (
|
||||
call_git(
|
||||
['log', '--format=%H', '--', log_location],
|
||||
cwd=self.path,
|
||||
capture_output=True,
|
||||
).decode().splitlines()
|
||||
)
|
||||
.decode()
|
||||
.splitlines()
|
||||
)
|
||||
for commit_hash in commit_hashes:
|
||||
log_diff_lines = call_git(
|
||||
log_diff_lines = (
|
||||
call_git(
|
||||
['show', '--format=%b', commit_hash, '--', log_location],
|
||||
cwd=self.path,
|
||||
capture_output=True,
|
||||
).decode().splitlines()
|
||||
)
|
||||
.decode()
|
||||
.splitlines()
|
||||
)
|
||||
# Get the log entry
|
||||
log_line = tuple(
|
||||
filter(
|
||||
log_line = next(filter(
|
||||
lambda l: not l.startswith('+++') and l.startswith('+'),
|
||||
log_diff_lines,
|
||||
)
|
||||
)[0][1:]
|
||||
))[1:]
|
||||
log_entry = json.loads(log_line)
|
||||
|
||||
# Get the YAML diff
|
||||
yaml_diff_lines = call_git(
|
||||
yaml_diff_lines = (
|
||||
call_git(
|
||||
['show', '--format=%b', commit_hash, '--', yaml_location],
|
||||
cwd=self.path,
|
||||
capture_output=True,
|
||||
).decode().splitlines()
|
||||
)
|
||||
.decode()
|
||||
.splitlines()
|
||||
)
|
||||
yaml_diff = '\n'.join(filter(lambda l: l != '', yaml_diff_lines)) + '\n'
|
||||
|
||||
# Get the YAML content
|
||||
|
|
@ -247,7 +257,7 @@ class GitAuditBackend(AuditBackend):
|
|||
) -> bytes:
|
||||
try:
|
||||
return call_git(
|
||||
['cat-file', '-p', f'master:{str(path)}'],
|
||||
['cat-file', '-p', f'master:{path!s}'],
|
||||
cwd=self.path,
|
||||
capture_output=True,
|
||||
)
|
||||
|
|
@ -290,7 +300,7 @@ class GitAuditBackend(AuditBackend):
|
|||
record_id: str,
|
||||
) -> tuple[str, Path, Path]:
|
||||
base = hashlib.sha1(record_id.encode()).hexdigest()
|
||||
dir_1, dir_2, name = base[0:3], base[3:6], base[6:]
|
||||
dir_1, dir_2, _name = base[0:3], base[3:6], base[6:]
|
||||
location_dir = Path(dir_1) / Path(dir_2)
|
||||
return (
|
||||
base,
|
||||
|
|
@ -321,8 +331,8 @@ class GitAuditBackend(AuditBackend):
|
|||
if not self.index_path.exists():
|
||||
self._rebuild_index()
|
||||
|
||||
with open(self.index_path, 'rt') as f:
|
||||
self.index = set(line.strip() for line in f.readlines())
|
||||
with open(self.index_path) as f:
|
||||
self.index = {line.strip() for line in f}
|
||||
|
||||
def _add_to_index(
|
||||
self,
|
||||
|
|
@ -333,16 +343,20 @@ class GitAuditBackend(AuditBackend):
|
|||
self.index.add(record_id)
|
||||
|
||||
def _rebuild_index(self):
|
||||
tree_entries = call_git(
|
||||
tree_entries = (
|
||||
call_git(
|
||||
['ls-tree', '-r', 'master:'],
|
||||
cwd=self.path,
|
||||
capture_output=True,
|
||||
).decode().splitlines()
|
||||
with open(self.index_path, 'wt') as f:
|
||||
)
|
||||
.decode()
|
||||
.splitlines()
|
||||
)
|
||||
with open(self.index_path, 'w') as f:
|
||||
for line in tree_entries:
|
||||
if not line.endswith('.yaml'):
|
||||
continue
|
||||
flag, object_type, object_hash, file_name = line.split(maxsplit=3)
|
||||
_flag, _object_type, object_hash, _file_name = line.split(maxsplit=3)
|
||||
record = yaml.safe_load(
|
||||
call_git(
|
||||
['show', object_hash],
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ def _get_audit_log_lines(backend: GitAuditBackend, record_id: str) -> list[str]:
|
|||
|
||||
|
||||
def test_gitaudit_basic(tmp_path_factory):
|
||||
tmp_path = tmp_path_factory.mktemp("gitaudit_backend")
|
||||
tmp_path = tmp_path_factory.mktemp('gitaudit_backend')
|
||||
|
||||
backend = GitAuditBackend(tmp_path)
|
||||
|
||||
|
|
@ -44,14 +44,13 @@ def test_gitaudit_basic(tmp_path_factory):
|
|||
# Check that the changes are reported
|
||||
changes = backend.get_audit_log(record_id)
|
||||
assert len(changes) == 4
|
||||
assert tuple(map(lambda e: e[0:2], changes.values())) == tuple(
|
||||
(f'committer_{100 + i}@x.org', f'author_{i}@y.org')
|
||||
for i in range(4)
|
||||
assert tuple(e[0:2] for e in changes.values()) == tuple(
|
||||
(f'committer_{100 + i}@x.org', f'author_{i}@y.org') for i in range(4)
|
||||
)
|
||||
|
||||
|
||||
def test_gitaudit_identical_change(tmp_path_factory):
|
||||
tmp_path = tmp_path_factory.mktemp("gitaudit_backend")
|
||||
tmp_path = tmp_path_factory.mktemp('gitaudit_backend')
|
||||
|
||||
backend = GitAuditBackend(tmp_path)
|
||||
|
||||
|
|
@ -83,7 +82,7 @@ def test_gitaudit_identical_change(tmp_path_factory):
|
|||
|
||||
|
||||
def test_gitaudit_huge_log(tmp_path_factory):
|
||||
tmp_path = tmp_path_factory.mktemp("gitaudit_backend")
|
||||
tmp_path = tmp_path_factory.mktemp('gitaudit_backend')
|
||||
|
||||
backend = GitAuditBackend(tmp_path)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ determine:
|
|||
- the incoming_label to be used with the token
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import abc
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue