Skip to content

Commit

Permalink
upgrade to template to 7.0.0 (#4)
Browse files Browse the repository at this point in the history
* upgrade template 7.0.0

* fix ruff issues

* update change log
  • Loading branch information
msaipraneeth authored Oct 2, 2024
1 parent 2848367 commit 83d13ed
Show file tree
Hide file tree
Showing 21 changed files with 1,610 additions and 1,513 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changes here will be overwritten by Copier
project_slug=graphql
package_dir=cmem_plugin_graphql

3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Changes here will be overwritten by Copier
_commit: v5.3.3
_commit: v7.0.0
_src_path: gh:eccenca/cmem-plugin-template
author_mail: [email protected]
author_name: eccenca GmbH
github_page: https://github.com/eccenca/cmem-plugin-graphql
project_description: Send queries to a GraphQL endpoint and save the results in a
JSON dataset.
project_slug: graphql
project_type: plugin
pypi: true

4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

16 changes: 4 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2

- name: Set up python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -42,21 +42,13 @@ jobs:
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: bandit
run: |
task check:bandit
- name: flake8
run: |
task check:flake8
- name: mypy
run: |
task check:mypy
- name: pylint
- name: ruff
run: |
task check:pylint
task check:ruff
- name: pytest
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2

- name: Set up python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
30 changes: 4 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,15 @@ stages:
- build
- publish

bandit:
ruff:
stage: test
script:
- task check:bandit
- task check:ruff
artifacts:
when: always
reports:
junit:
- dist/junit-bandit.xml

flake8:
stage: test
script:
- task check:flake8
artifacts:
when: always
reports:
junit:
- dist/junit-flake8.xml
- dist/junit-ruff.xml

mypy:
stage: test
Expand All @@ -49,16 +39,6 @@ mypy:
junit:
- dist/junit-mypy.xml

pylint:
stage: test
script:
- task check:pylint
artifacts:
when: always
reports:
junit:
- dist/junit-pylint.xml

pytest:
stage: test
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
Expand Down Expand Up @@ -86,7 +66,6 @@ safety:
build:
stage: build
needs:
- bandit
- mypy
- pytest
- safety
Expand All @@ -102,8 +81,7 @@ pypi:
# publishing only available on a tag
stage: publish
needs:
- flake8
- pylint
- ruff
- build
allow_failure: true
when: manual
Expand Down
46 changes: 33 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@
repos:
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
exclude: '^tests/.*$'
language: system
types: [python]
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found copier update rejection files; review them and remove them
language: fail
files: "\\.rej$"

- id: ruff
name: check:ruff
entry: task check:ruff
language: python
types_or: [python, pyi]
pass_filenames: false

- id: poetry-check
name: poetry-check
description: run poetry check to validate config
entry: poetry check
language: python
pass_filenames: false
files: ^(.*/)?pyproject\.toml$

- id: poetry-lock
name: poetry-lock
description: run poetry lock to update lock file
entry: poetry lock
language: python
pass_filenames: false
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$

- id: poetry-install
name: poetry-install
description: >
run poetry install to install dependencies from the lock file
entry: poetry install
language: python
pass_filenames: false
stages: [post-checkout, post-merge]
always_run: true

19 changes: 19 additions & 0 deletions .tasks-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://taskfile.dev
---
version: '3'

tasks:

install:
desc: Install plugin package in Corporate Memory
cmds:
- task build
- poetry run cmemc admin workspace python install dist/cmem_plugin_graphql*.tar.gz
- poetry run cmemc admin workspace python list-plugins

uninstall:
desc: Unnstall plugin package in Corporate Memory
cmds:
- task build
- poetry run cmemc admin workspace python uninstall cmem-plugin-graphql
- poetry run cmemc admin workspace python list-plugins
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/)

## [Unreleased]

### Changed

- upgrade template to 7.0.0

## [3.1.0] 2023-10-24

### Changed
Expand Down
18 changes: 15 additions & 3 deletions README-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

Send queries to a GraphQL endpoint and save the results in a JSON dataset.

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

You can install it with the [cmemc](https://eccenca.com/go/cmemc) command line
clients like this:
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:

```
cmemc admin workspace python install cmem-plugin-graphql
```
[![workflow](https://github.com/eccenca/cmem-plugin-graphql/actions/workflows/check.yml/badge.svg)](https://github.com/eccenca/cmem-plugin-graphql/actions) [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-graphql)](https://pypi.org/project/cmem-plugin-graphql) [![license](https://img.shields.io/pypi/l/cmem-plugin-graphql)](https://pypi.org/project/cmem-plugin-graphql)
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]

[cmem-link]: https://documentation.eccenca.com
[cmem-shield]: https://img.shields.io/endpoint?url=https://dev.documentation.eccenca.com/badge.json
[poetry-link]: https://python-poetry.org/
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
[ruff-link]: https://docs.astral.sh/ruff/
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
[mypy-link]: https://mypy-lang.org/
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
[copier]: https://copier.readthedocs.io/
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json

13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@

Send queries to a GraphQL endpoint and save the results in a JSON dataset.

[![eccenca Corporate Memory](https://img.shields.io/badge/eccenca-Corporate%20Memory-orange)](https://documentation.eccenca.com) [![workflow](https://github.com/eccenca/cmem-plugin-graphql/actions/workflows/check.yml/badge.svg)](https://github.com/eccenca/cmem-plugin-graphql/actions) [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-graphql)](https://pypi.org/project/graphql) [![license](https://img.shields.io/pypi/l/cmem-plugin-graphql)](https://pypi.org/project/cmem-plugin-graphql)
[![eccenca Corporate Memory][cmem-shield]][cmem-link][![workflow](https://github.com/eccenca/cmem-plugin-graphql/actions/workflows/check.yml/badge.svg)](https://github.com/eccenca/cmem-plugin-graphql/actions) [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-graphql)](https://pypi.org/project/cmem-plugin-graphql) [![license](https://img.shields.io/pypi/l/cmem-plugin-graphql)](https://pypi.org/project/cmem-plugin-graphql)
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]

## Development

- Run [task](https://taskfile.dev/) to see all major development tasks.
- Use [pre-commit](https://pre-commit.com/) to avoid errors before commit.
- This repository was created with [this copier template](https://github.com/eccenca/cmem-plugin-template).

[cmem-link]: https://documentation.eccenca.com
[cmem-shield]: https://img.shields.io/endpoint?url=https://dev.documentation.eccenca.com/badge.json
[poetry-link]: https://python-poetry.org/
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
[ruff-link]: https://docs.astral.sh/ruff/
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
[mypy-link]: https://mypy-lang.org/
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
[copier]: https://copier.readthedocs.io/
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
Loading

0 comments on commit 83d13ed

Please sign in to comment.