{"id":21296692,"url":"https://github.com/eccenca/cmem-plugin-template","last_synced_at":"2025-10-31T11:11:20.767Z","repository":{"id":39702998,"uuid":"468103398","full_name":"eccenca/cmem-plugin-template","owner":"eccenca","description":"Bootstrap your eccenca Corporate Memory Python Plugin with this Repository Template.","archived":false,"fork":false,"pushed_at":"2025-10-06T19:07:11.000Z","size":298,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-10-06T21:08:31.240Z","etag":null,"topics":["copier-template","corporate-memory","eccenca","plugin","python"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eccenca.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-09T21:53:28.000Z","updated_at":"2025-09-16T04:56:32.000Z","dependencies_parsed_at":"2023-02-10T16:05:29.804Z","dependency_job_id":"18da3c30-d166-4571-a4b7-caa1c04725d2","html_url":"https://github.com/eccenca/cmem-plugin-template","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/eccenca/cmem-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fcmem-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fcmem-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fcmem-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fcmem-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eccenca","download_url":"https://codeload.github.com/eccenca/cmem-plugin-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fcmem-plugin-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281976711,"owners_count":26592994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copier-template","corporate-memory","eccenca","plugin","python"],"created_at":"2024-11-21T14:29:03.845Z","updated_at":"2025-10-31T11:11:20.747Z","avatar_url":"https://github.com/eccenca.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD012 MD013 MD024 MD033 --\u003e\n# cmem-plugin-template\n\n[![workflow][build-shield-main]][github-actions] [![workflow][build-shield-develop]][github-actions] [![version][version-shield]][changelog] ![python-shield]\n[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]\n[![eccenca Corporate Memory][cmem-shield]][cmem]\n\nThis repository contains a [copier](https://copier.readthedocs.io/) template.\n\nYou can use it to bootstrap the following types of project:\n\n- **[eccenca Corporate Memory](https://documentation.eccenca.com) [Python Plugin](https://documentation.eccenca.com/latest/develop/python-plugins/)**: Bootstrapping and keeping plugin repositories up-to-date was the initial idea of this template.\n- **Generic Python Project**: After tons of commits, we wanted to use this template not only for plugins, but for all kinds of python projects.\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of contents\u003c/summary\u003e\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Features](#features)\n* [Usage](#usage)\n    * [Project Initialization](#project-initialization)\n    * [Template Updates](#template-updates)\n    * [Other Tasks](#other-tasks)\n* [Setup](#setup)\n    * [Local Requirements](#local-requirements)\n    * [Integration Tests](#integration-tests)\n    * [Plugins only: Corporate Memory Environment](#plugins-only-corporate-memory-environment)\n    * [CI Build Plan](#ci-build-plan)\n    * [Editor / IDE Support](#editor--ide-support)\n        * [PyCharm](#pycharm)\n\n\u003c!-- vim-markdown-toc --\u003e\n\u003c/details\u003e\n\n## Features\n\n- [Python / poetry](https://python-poetry.org/) project with\n  - [pytest](https://www.pytest.org/) (incl. [memray](https://bloomberg.github.io/memray/) + [pytest-dotenv](https://github.com/quiqua/pytest-dotenv) + [code coverage](https://github.com/pytest-dev/pytest-cov)) as the testing framework,\n  - [ruff](https://docs.astral.sh/ruff/) as all-hands linter and formatter,\n  - [mypy](http://mypy-lang.org/) as type checker,\n  - [deptry](https://deptry.com/) as dependency issue checker, and\n  - [safety](https://pyup.io/safety/) as dependency vulnerability scanner.\n- Build plans for\n  - [gitlab](https://github.com/eccenca/cmem-plugin-template/blob/main/src/.gitlab-ci.yml),\n  - [github](https://github.com/eccenca/cmem-plugin-template/tree/main/src/.github/workflows), and\n  - locally with [task](https://taskfile.dev/) (tested for Linux, MacOS and Windows/MinGW).\n  - Including\n    - badge generation,\n    - JUnit XML file and\n    - coverage stat generation.\n\n## Usage\n\n### Project Initialization\n\nThe following command will create a new project directory with the latest released template.\nThis produces a plugin which is compatible the [latest release of eccenca Corporate Memory](https://documentation.eccenca.com/latest/).\n\nNote: Select 'Generic Python Project' as an answer to the initial question to skip creation of plugin specific code.\n\n```shell-session\n$ copier copy gh:eccenca/cmem-plugin-template cmem-plugin-my\n```\n\nThe following command will use the latest develop version of the template:\nThis produces a plugin which is compatible the latest development snapshot of eccenca Corporate Memory.\n\n```shell-session\n$ copier copy -r develop gh:eccenca/cmem-plugin-template cmem-plugin-my\n```\n\nAfter that, you need to initialize the repository and optionally install the git pre-commit hooks:\n\n```shell-session\n$ cd cmem-plugin-my\n$ git init; git add .; git commit -m \"init\"\n$ pre-commit install\n```\n\nThen you can run the local test suite and build a first deployment artefact:\n\n```shell-session\ntask check build\n```\n\n### Template Updates\n\nWe [continuously update](https://github.com/eccenca/cmem-plugin-template/graphs/code-frequency) this repository.\nThis includes maintenance of dependencies, build plan updates and the adoption of new features from the [plugin base library](https://github.com/eccenca/cmem-plugin-base).\n\nIn order to upgrade your project to the latest template release, use the following command:\n\n```shell-session\ncopier update\n```\n\nIn order to prepare your project for the upcoming next release, use this command:\n\n```shell-session\ncopier update -r develop\n```\n\nPlease also have a look at the [copier documentation](https://copier.readthedocs.io/en/stable/updating/).\n\n### Other Tasks\n\nThe available tasks for your project can be listed like this (note that there are more tasks, prefixed with `plugin:` in case you started a plugin project):\n\n```shell-session\n∴ task\ntask: Available tasks for this project:\n* build:                   Build a tarball and a wheel package\n* check:                   Run whole test suite incl. unit and integration tests\n* clean:                   Removes dist, *.pyc and some caches\n* check:linters:           Run all linter and static code analysis tests\n* check:mypy:              Complain about typing errors\n* check:pytest:            Run unit and integration tests\n* check:ruff:              Complain about everything else\n* check:safety:            Complain about vulnerabilities in dependencies\n* format:fix:              Format Python files and fix obvious issues\n* format:fix-unsafe:       Format Python files and fix 'unsafe' issues\n```\n\nYou can extend this task list by creating a file `TaskfileCustom.yaml` in your repository root:\n\n```shell-session\n$ cat TaskfileCustom.yaml\n---\nversion: '3'\n\ntasks:\n\n  ttt:\n    desc: just a test\n    cmds:\n      - task --list\n```\n\n\n## Setup\n\n### Local Requirements\n\nThe following tools are needed for local task execution:\n\n- Python 3.11+\n- [copier](https://copier.readthedocs.io/) (\u003e= v9) for project template rendering and updating\n- [task](https://taskfile.dev/) (\u003e= v3.29) for running build tasks (make sure to follow the installation instructions to avoid confusion with taskwarrior)\n- [poetry](https://python-poetry.org/) (\u003e= v1.7) for packaging and dependency managing (+ [dynamic versioning plugin](https://github.com/mtkennerly/poetry-dynamic-versioning))\n- [pre-commit](https://pre-commit.com/) (\u003e= v2.20) for managing pre-commit hooks (optional)\n\nExample installation of the requirements with [pipx](https://pipx.pypa.io/) on Ubuntu:\n\n``` shell-session\nsudo sh -c \"$(curl --location https://taskfile.dev/install.sh)\" -- -d -b /usr/local/bin\npython3 -m pip install --user pipx\npython3 -m pipx ensurepath\npipx install copier\npipx install pre-commit\npipx install poetry\npoetry self add \"poetry-dynamic-versioning[plugin]\"\n```\n\n### Integration Tests\n\nThis template uses the [pytest](https://pytest.org) testing framework.\nTesting your plugin is crucial and should be done locally as well as  integrated with eccenca Corporate Memory.\n\nIn order to setup access to a Corporate Memory deployment, you need to provide correct environment variables.\nWithout these variables, only standalone tests can be executed (see `1 skipped`):\n\n``` shell-session\n$ task check:pytest\n...\n... ===== 3 passed, 1 skipped in 0.09s =====\n```\n\n### Plugins only: Corporate Memory Environment\n\nBy providing the correct [cmemc](https://eccenca.com/go/cmemc) [environment variables](https://documentation.eccenca.com/latest/automate/cmemc-command-line-interface/configuration/environment-based-configuration/) in an `.env` file or directly in your environment, your plugin can be tested in an integrated way:\n\n``` shell-session\n# Environment as direct variables:\n$ export CMEM_BASE_URI=\"https://cmem.example.org\"\n$ export OAUTH_CLIENT_ID=\"cmem-service-account\"\n$ export OAUTH_CLIENT_SECRET=\"...\"\n$ export OAUTH_GRANT_TYPE=\"client_credentials\"\n```\n\n``` shell-session\n# Environment as .env files\n$ cat .env\nCMEM_BASE_URI=\"https://cmem.example.org\"\nOAUTH_CLIENT_ID=\"cmem-service-account\"\nOAUTH_CLIENT_SECRET=\"...\"\nOAUTH_GRANT_TYPE=\"client_credentials\"\n```\n\n### CI Build Plan\n\nThe gitlab workflow as well as the github action pipelines need the same environment variables as secrets:\n\n- For github, go to Settings \u003e Secret \u003e Actions \u003e [New Repository Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets)\n- For gitlab, go to Settings \u003e CI/CD \u003e Variables (Expand) \u003e [Add Variable (protected, masked, all environments)](https://docs.gitlab.com/ee/ci/variables/)\n\nAn example github pipeline can be seen [at this github project](https://github.com/eccenca/cmem-plugin-yaml/actions).\n\nIn addition to the eccenca Corporate Memory credential secrets, a `PYPI_TOKEN` secret can be set in order to use the `publish` task/workflow.\n\n### Editor / IDE Support\n\n#### PyCharm\n\nIn order to have the best PyCharm experience, when starting a project with this template, we suggest the following PyCharm plugins:\n\n- [Ruff](https://plugins.jetbrains.com/plugin/20574-ruff) will provide the linting hints which will be raised by the pipeline anyway.\n- [Taskfile](https://plugins.jetbrains.com/plugin/17058-taskfile) will allow for starting tasks.\n\n[version-shield]: https://img.shields.io/github/v/tag/eccenca/cmem-plugin-template?label=version\u0026sort=semver\n[changelog]: https://github.com/eccenca/cmem-plugin-template/blob/main/CHANGELOG.md\n[github-actions]: https://github.com/eccenca/cmem-plugin-template/actions\n[build-shield-main]: https://img.shields.io/github/actions/workflow/status/eccenca/cmem-plugin-template/check.yml?logo=github\u0026branch=main\u0026label=main\n[build-shield-develop]: https://img.shields.io/github/actions/workflow/status/eccenca/cmem-plugin-template/check.yml?logo=github\u0026branch=develop\u0026label=develop\n[copier]: https://copier.readthedocs.io/\n[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json\n[cmem]: https://documentation.eccenca.com\n[cmem-shield]: https://img.shields.io/endpoint?url=https://dev.documentation.eccenca.com/badge.json\n[python-shield]: https://img.shields.io/badge/python-v3.11-blue\n[mypy-link]: https://mypy-lang.org/\n[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg\n[ruff-link]: https://docs.astral.sh/ruff/\n[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\u0026label=Code%20Style\n[poetry-link]: https://python-poetry.org/\n[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feccenca%2Fcmem-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feccenca%2Fcmem-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feccenca%2Fcmem-plugin-template/lists"}