Skip to content

Commit

Permalink
Bump cookiecutter template to 6c467f (#186)
Browse files Browse the repository at this point in the history
# Changes

- bumped cookiecutter template to
robert-koch-institut/mex-template@6c467f

---------

Co-authored-by: Nicolas Drebenstedt <drebenstedtn@rki.de>
  • Loading branch information
RKIMetadataExchange and cutoffthetop authored Nov 8, 2024
1 parent 15b5ebd commit 66d42f7
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/robert-koch-institut/mex-template",
"commit": "fca460e90134ef8c10f54d491aa80891509b1b6c",
"commit": "6c467f8809dcc640c3b7aab80e42f3af1f89b1bd",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

services:
neo4j:
image: neo4j:5.24-community
image: neo4j:5.25-community
env:
NEO4J_AUTH: neo4j/password
ports:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.7.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -25,7 +25,7 @@ repos:
- id: fix-byte-order-marker
name: byte-order
- repo: https://github.com/pdm-project/pdm
rev: 2.18.2
rev: 2.20.0.post1
hooks:
- id: pdm-lock-check
name: pdm
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Metadata editor web application.
[![open-code](https://github.com/robert-koch-institut/mex-editor/actions/workflows/open-code.yml/badge.svg)](https://gitlab.opencode.de/robert-koch-institut/mex/mex-editor)
[![testing](https://github.com/robert-koch-institut/mex-editor/actions/workflows/testing.yml/badge.svg)](https://github.com/robert-koch-institut/mex-editor/actions/workflows/testing.yml)

## project
## Project

The Metadata Exchange (MEx) project is committed to improve the retrieval of RKI
research data and projects. How? By focusing on metadata: instead of providing the
Expand Down Expand Up @@ -39,26 +39,27 @@ data Findable, Accessible, Interoperable and Reusable.
**Contact** \
For more information, please feel free to email us at [mex@rki.de](mailto:mex@rki.de).

### Publisher of this document
### Publisher

**Robert Koch-Institut** \
Nordufer 20 \
13353 Berlin \
Germany

## package
## Package

The `mex-editor` is a browser application that allows creating and editing rules to
non-destructively manipulate metadata. This can be used to enrich data with manual input
or insert new data from scratch.

## license
## License

This package is licensed under the [MIT license](/LICENSE). All other software
components of the MEx project are open-sourced under the same license as well.

## development
## Development

### installation
### Installation

- on unix, consider using pyenv https://github.com/pyenv/pyenv
- get pyenv `curl https://pyenv.run | bash`
Expand All @@ -71,37 +72,37 @@ components of the MEx project are open-sourced under the same license as well.
- switch version `pyenv global 3.11`
- run `.\mex.bat install`

### linting and testing
### Linting and testing

- run all linters with `pdm lint`
- run only unit tests with `pdm unit`
- run unit and integration tests with `pdm test`
- for integration tests you need a local `mex-backend`, `neo4j` and `mex-editor`

### updating dependencies
### Updating dependencies

- update boilerplate files with `cruft update`
- update global requirements in `requirements.txt` manually
- update git hooks with `pre-commit autoupdate`
- update package dependencies using `pdm update-all`
- update github actions in `.github/workflows/*.yml` manually

### creating release
### Creating release

- run `pdm release RULE` to release a new version where RULE determines which part of
the version to update and is one of `major`, `minor`, `patch`.

### container workflow
### Container workflow

- build image with `make image`
- run directly using docker `make run`
- start with docker compose `make start`

## commands
## Commands

- run `pdm run {command} --help` to print instructions
- run `pdm run {command} --debug` for interactive debugging

### editor
### Editor

- `pdm run editor run` starts the editor service
6 changes: 3 additions & 3 deletions mex/editor/edit/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class EditState(State):

def refresh(self) -> None:
"""Refresh the search results."""
# TODO: use the user auth for backend requests (stop-gap MX-1616)
# TODO(ND): use the user auth for backend requests (stop-gap MX-1616)
connector = BackendApiConnector.get()

# TODO: use a specialized extracted-item search method
# TODO(ND): use a specialized extracted-item search method
response = connector.request(
"GET", f"extracted-item?stableTargetId={self.item_id}"
)
items = _BackendSearchResponse.model_validate(response).items
self.fields = self.extracted_to_fields(items)

# TODO: use title of merged item instead of title of first item
# TODO(ND): use title of merged item instead of title of first item
self.item_title = render_model_title(items[0])

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions mex/editor/search/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ def go_to_next_page(self) -> None:

def refresh(self) -> None:
"""Refresh the search results."""
# TODO: use the user auth for backend requests (stop-gap MX-1616)
# TODO(ND): use the user auth for backend requests (stop-gap MX-1616)
connector = BackendApiConnector.get()

# TODO: use a specialized merged-item search method (stop-gap MX-1581)
# TODO(ND): use a specialized merged-item search method (stop-gap MX-1581)
try:
response = connector.request(
"GET",
"merged-item",
params={
"q": self.query_string,
"entityType": [k for k, v in self.entity_types.items() if v], # type: ignore
"entityType": [k for k, v in self.entity_types.items() if v],
"skip": str(self.limit * (self.current_page - 1)),
"limit": str(self.limit),
},
Expand Down
70 changes: 35 additions & 35 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 66d42f7

Please sign in to comment.