Skip to content

Commit efe04fc

Browse files
authored
Merge pull request #1 from eccenca/fix/add-docu-setup-user-access
- Add info how to initialize user session for cmem API use. - upgrade template - nice up documentation
2 parents 06e86e7 + 1955811 commit efe04fc

File tree

16 files changed

+1062
-565
lines changed

16 files changed

+1062
-565
lines changed

.copier-answers.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changes here will be overwritten by Copier
2-
project_slug=python
2+
package_dir=cmem_plugin_python
33

.copier-answers.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v6.0.1
2+
_commit: v7.0.0
33
_src_path: gh:eccenca/cmem-plugin-template
4-
author_mail: sebastian.tramp@eccenca.com
5-
author_name: Sebastian Tramp
6-
github_page: ''
4+
author_mail: cmempy-developer@eccenca.com
5+
author_name: eccenca GmbH
6+
github_page: https://github.com/eccenca/cmem-plugin-python
77
project_description: Write ad-hoc transformations and workflow tasks with Python.
88
project_slug: python
9-
pypi: false
9+
project_type: plugin
10+
pypi: true
1011

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
uses: actions/checkout@v4
2424

2525
- name: Install Task
26-
uses: arduino/setup-task@v1
26+
uses: arduino/setup-task@v2
2727

2828
- name: Set up python
2929
id: setup-python
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: '3.11'
3333

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: actions/checkout@v4
2121

2222
- name: Install Task
23-
uses: arduino/setup-task@v1
23+
uses: arduino/setup-task@v2
2424

2525
- name: Set up python
2626
id: setup-python
27-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
2828
with:
2929
python-version: '3.11'
3030

.idea/cmem-plugin-python.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.tasks-plugin.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://taskfile.dev
2+
---
3+
version: '3'
4+
5+
tasks:
6+
7+
install:
8+
desc: Install plugin package in Corporate Memory
9+
cmds:
10+
- task build
11+
- poetry run cmemc admin workspace python install dist/cmem_plugin_python*.tar.gz
12+
- poetry run cmemc admin workspace python list-plugins
13+
14+
uninstall:
15+
desc: Unnstall plugin package in Corporate Memory
16+
cmds:
17+
- task build
18+
- poetry run cmemc admin workspace python uninstall cmem-plugin-python
19+
- poetry run cmemc admin workspace python list-plugins

README-public.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22

33
Write ad-hoc transformations and workflow tasks with Python.
44

5-
This is a plugin for [eccenca](https://eccenca.com) [Corporate Memory](https://documentation.eccenca.com).
5+
[![eccenca Corporate Memory][cmem-shield]][cmem-link]
66

7-
You can install it with the [cmemc](https://eccenca.com/go/cmemc) command line
8-
clients like this:
7+
This is a plugin for [eccenca](https://eccenca.com) [Corporate Memory](https://documentation.eccenca.com). You can install it with the [cmemc](https://eccenca.com/go/cmemc) command line clients like this:
98

109
```
1110
cmemc admin workspace python install cmem-plugin-python
1211
```
12+
[![workflow](https://github.com/eccenca/cmem-plugin-python/actions/workflows/check.yml/badge.svg)](https://github.com/eccenca/cmem-plugin-python/actions) [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-python)](https://pypi.org/project/cmem-plugin-python) [![license](https://img.shields.io/pypi/l/cmem-plugin-python)](https://pypi.org/project/cmem-plugin-python)
13+
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]
14+
15+
[cmem-link]: https://documentation.eccenca.com
16+
[cmem-shield]: https://img.shields.io/endpoint?url=https://dev.documentation.eccenca.com/badge.json
17+
[poetry-link]: https://python-poetry.org/
18+
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
19+
[ruff-link]: https://docs.astral.sh/ruff/
20+
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
21+
[mypy-link]: https://mypy-lang.org/
22+
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
23+
[copier]: https://copier.readthedocs.io/
24+
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
1325

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@
22

33
Write ad-hoc transformations and workflow tasks with Python.
44

5-
[![eccenca Corporate Memory](https://img.shields.io/badge/eccenca-Corporate%20Memory-orange)](https://documentation.eccenca.com)
6-
7-
## Development
8-
9-
- Run [task](https://taskfile.dev/) to see all major development tasks.
10-
- Use [pre-commit](https://pre-commit.com/) to avoid errors before commit.
11-
- This repository was created with [this copier template](https://github.com/eccenca/cmem-plugin-template).
12-
13-
## Usage
14-
155
Do not use in production!
166

177
```
188
eval $(cmemc -c my-cmem config eval)
19-
task clean check deploy
9+
task clean check plugin:install
2010
```
2111

2212
😈
2313

2414
![Usage](./usage.png)
15+
[![eccenca Corporate Memory][cmem-shield]][cmem-link][![workflow](https://github.com/eccenca/cmem-plugin-python/actions/workflows/check.yml/badge.svg)](https://github.com/eccenca/cmem-plugin-python/actions) [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-python)](https://pypi.org/project/cmem-plugin-python) [![license](https://img.shields.io/pypi/l/cmem-plugin-python)](https://pypi.org/project/cmem-plugin-python)
16+
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]
17+
18+
## Development
19+
20+
- Run [task](https://taskfile.dev/) to see all major development tasks.
21+
- Use [pre-commit](https://pre-commit.com/) to avoid errors before commit.
22+
- This repository was created with [this copier template](https://github.com/eccenca/cmem-plugin-template).
23+
24+
25+
[cmem-link]: https://documentation.eccenca.com
26+
[cmem-shield]: https://img.shields.io/endpoint?url=https://dev.documentation.eccenca.com/badge.json
27+
[poetry-link]: https://python-poetry.org/
28+
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
29+
[ruff-link]: https://docs.astral.sh/ruff/
30+
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
31+
[mypy-link]: https://mypy-lang.org/
32+
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
33+
[copier]: https://copier.readthedocs.io/
34+
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
2535

Taskfile.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# https://taskfile.dev
2+
#
3+
# This is a generated file. We dot not suggest to edit it.
4+
# Instead, create a file `TaskfileCustom.yml` and add your additions there.
25
---
36
version: '3'
47

@@ -10,13 +13,16 @@ dotenv: ['.copier-answers.env', '.env']
1013
- check:prepare
1114

1215
vars:
13-
PACKAGE: cmem_plugin_$project_slug
16+
PACKAGE: $package_dir
1417
DIST_DIR: dist
1518

1619
includes:
1720
custom:
1821
taskfile: ./TaskfileCustom.yaml
1922
optional: true
23+
plugin:
24+
taskfile: .tasks-plugin.yml
25+
optional: true
2026

2127
tasks:
2228

@@ -43,6 +49,10 @@ tasks:
4349
Check poetry versioning plugin. Currently not under Windows
4450
run: once
4551
preconditions:
52+
- sh: '[ -d .git ]'
53+
msg: >
54+
Your newly created project directory needs to be initialized
55+
as a git repository.
4656
- sh: '[[ {{.PDV_VERSION}} > {{.PDV_VERSION_MIN}} ]]'
4757
msg: >
4858
This project needs the poetry-dynamic-versioning
@@ -113,23 +123,26 @@ tasks:
113123
poetry run pytest --junitxml={{.JUNIT_FILE}}
114124
--cov-report term --cov-report xml:{{.COVERAGE_FILE}}
115125
--cov-report html:{{.COVERAGE_DIR}} --cov={{.PACKAGE}}
126+
--html={{.HTML_FILE}} --self-contained-html
116127
- platforms: [darwin, linux]
117128
cmd: >
118129
poetry run pytest --memray --junitxml={{.JUNIT_FILE}}
119130
--cov-report term --cov-report xml:{{.COVERAGE_FILE}}
120131
--cov-report html:{{.COVERAGE_DIR}} --cov={{.PACKAGE}}
132+
--html={{.HTML_FILE}} --self-contained-html
121133
- cmd: >
122134
poetry run genbadge coverage -l
123135
-i {{.COVERAGE_FILE}} -o {{.BADGE_COVERAGE}}
124136
- cmd: >
125137
poetry run genbadge tests -l
126138
-i {{.JUNIT_FILE}} -o {{.BADGE_TESTS}}
127139
vars:
128-
JUNIT_FILE: ./{{.DIST_DIR}}/junit-pytest.xml
129-
COVERAGE_FILE: ./{{.DIST_DIR}}/coverage.xml
130-
COVERAGE_DIR: ./{{.DIST_DIR}}/coverage
131140
BADGE_COVERAGE: ./{{.DIST_DIR}}/badge-coverage.svg
132141
BADGE_TESTS: ./{{.DIST_DIR}}/badge-tests.svg
142+
COVERAGE_DIR: ./{{.DIST_DIR}}/coverage
143+
COVERAGE_FILE: ./{{.DIST_DIR}}/coverage.xml
144+
HTML_FILE: ./{{.DIST_DIR}}/pytest.html
145+
JUNIT_FILE: ./{{.DIST_DIR}}/junit-pytest.xml
133146

134147
check:mypy:
135148
desc: Complain about typing errors
@@ -144,30 +157,22 @@ tasks:
144157
<<: *preparation
145158
cmds:
146159
# ignore 51358 safety - dev dependency only
147-
# ignore 61489 pillow - dev dependency only
148-
- poetry run safety check -i 51358 -i 61489
160+
# ignore 67599 pip - dev dependency only
161+
# ignore 70612 jinja2 - dev dependency only
162+
- poetry run safety check -i 51358 -i 67599 -i 70612
149163

150164
check:ruff:
151165
desc: Complain about everything else
152166
<<: *preparation
153167
cmds:
154-
- poetry run ruff check --show-source tests {{.PACKAGE}}
155168
- poetry run ruff check --exit-zero tests {{.PACKAGE}} {{.XML_PARAMS}}
169+
- poetry run ruff check --output-format=concise tests {{.PACKAGE}}
156170
- poetry run ruff format --check tests {{.PACKAGE}}
157171
vars:
158172
JUNIT_FILE: ./{{.DIST_DIR}}/junit-ruff.xml
159173
XML_PARAMS: --output-format junit --output-file {{.JUNIT_FILE}}
160174

161175
# }}}
162-
# {{{ build and deploy tasks
163-
164-
deploy:
165-
desc: Install plugin package in Corporate Memory
166-
deps:
167-
- build
168-
cmds:
169-
- cmemc admin workspace python install dist/*.tar.gz
170-
- cmemc admin workspace python list-plugins
171176

172177
build:
173178
desc: Build a tarball and a wheel package
@@ -178,5 +183,3 @@ tasks:
178183
cmds:
179184
- poetry build
180185

181-
# }}}
182-

cmem_plugin_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""python - main package"""
1+
"""cmem-plugin-python"""

0 commit comments

Comments
 (0)