Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example project #25

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dbddb98
add example for deprecated locations and new projects and add new lin…
anikaweinmann Dec 9, 2024
e0c3e6c
start linting
anikaweinmann Dec 9, 2024
f268951
further linting
anikaweinmann Dec 9, 2024
6eb5a69
further linting
anikaweinmann Dec 9, 2024
8bd4496
pylint
anikaweinmann Dec 9, 2024
3558b09
Docker and bash linting
anikaweinmann Dec 9, 2024
8598fc0
further linting
anikaweinmann Dec 9, 2024
601eedf
further ruff
anikaweinmann Dec 12, 2024
d916e13
merge main
anikaweinmann Dec 12, 2024
78a78d9
merge main
anikaweinmann Dec 12, 2024
51841b8
merge
anikaweinmann Dec 12, 2024
fd5994e
changes
anikaweinmann Dec 12, 2024
446e487
Apply suggestions from code review
anikaweinmann Dec 12, 2024
2f4e08c
Apply suggestions from code review
anikaweinmann Dec 12, 2024
bf29a0e
docker lint
anikaweinmann Dec 12, 2024
fca6939
exclude VALIDATE_BASH_EXEC
anikaweinmann Dec 12, 2024
9c5ef63
fixes
anikaweinmann Dec 12, 2024
61b786d
further ruff
anikaweinmann Dec 12, 2024
5f61b84
try fix ruff
anikaweinmann Dec 12, 2024
45c96fa
ruff
anikaweinmann Dec 12, 2024
647a6d3
black
anikaweinmann Dec 12, 2024
4f9af57
changed
anikaweinmann Dec 12, 2024
97342a6
further ruff
anikaweinmann Dec 12, 2024
404a42f
other linting
anikaweinmann Dec 12, 2024
fde77ac
Apply suggestions from code review
anikaweinmann Dec 12, 2024
5f16651
VALIDATE_BASH_EXEC
anikaweinmann Dec 13, 2024
682e050
ruff --fix
mmacata Dec 13, 2024
3e6d204
make script executable
mmacata Dec 13, 2024
1efaf43
enhance workflows
mmacata Dec 13, 2024
72ecfb7
ruff ANN001 + D104
anikaweinmann Dec 19, 2024
093ab14
ruff: RUF012
anikaweinmann Dec 19, 2024
31ea4ea
ruff: RUF012 + I001
anikaweinmann Dec 19, 2024
8506a78
ruff: N816
anikaweinmann Dec 19, 2024
61c2494
ruff: PLR2004
anikaweinmann Dec 19, 2024
a68b194
ruff: PLW0603
anikaweinmann Dec 19, 2024
af521c3
ruff
anikaweinmann Dec 19, 2024
f1628b9
ruff
anikaweinmann Dec 19, 2024
bff7231
linting
anikaweinmann Dec 19, 2024
09a65ea
linting
anikaweinmann Dec 19, 2024
dddbcba
flake8 config
anikaweinmann Dec 19, 2024
734f781
add projects endpoint tests
anikaweinmann Dec 19, 2024
4126828
fix setup files
anikaweinmann Dec 19, 2024
696058e
working with actinia-docker setup
anikaweinmann Dec 20, 2024
1bc57bc
add deprecation decorator
anikaweinmann Dec 20, 2024
4d9dfd4
setup.cfg
anikaweinmann Dec 20, 2024
893d5ee
ruff
anikaweinmann Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/black.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/flake8.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
---
# This workflow will upload a Python Package using Twine when a release is
# created
# For more information see: https://help.github.com/en/actions/language-and-
# framework-guides/using-python-with-github-actions#publishing-to-package-
# registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/super-linter.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: actinia tests

on:
Expand All @@ -14,8 +16,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# with:
# path: "."
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Replace run only unittest command
Expand Down
12 changes: 8 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
FROM mundialis/actinia-core:latest
FROM mundialis/actinia-core:5.0.0

# pwgen is needed for the tests
RUN pip3 install pwgen
RUN pip3 install pwgen==0.8.2.post0

COPY docker/actinia.cfg /etc/default/actinia
COPY src /src/actinia-example-plugin/src/
COPY setup.cfg /src/actinia-example-plugin/
COPY setup.py /src/actinia-example-plugin/
COPY requirements.txt /src/actinia-example-plugin/

RUN pip3 install -r /src/actinia-example-plugin/requirements.txt
RUN pip3 install --no-cache-dir -r /src/actinia-example-plugin/requirements.txt
RUN pip3 uninstall actinia-example-plugin.wsgi -y
# SETUPTOOLS_SCM_PRETEND_VERSION is only needed if in the plugin folder is no
# .git folder
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0
RUN (cd /src/actinia-example-plugin && python3 setup.py install)

WORKDIR /src/actinia-example-plugin
RUN python3 setup.py install

WORKDIR /src/actinia_core
8 changes: 4 additions & 4 deletions docker/actinia-example-plugin-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM mundialis/actinia-core:latest as actinia_test
FROM mundialis/actinia-core:5.0.0 as actinia_test

LABEL authors="Carmen Tawalika,Anika Weinmann"
LABEL maintainer="[email protected],[email protected]"

ENV ACTINIA_CUSTOM_TEST_CFG /etc/default/actinia-example-plugin-test
ENV ACTINIA_CUSTOM_TEST_CFG=/etc/default/actinia-example-plugin-test

# TODO do not set DEFAULT_CONFIG_PATH if this is fixed
ENV DEFAULT_CONFIG_PATH /etc/default/actinia-example-plugin-test
ENV DEFAULT_CONFIG_PATH=/etc/default/actinia-example-plugin-test

# install things only for tests
RUN apk add redis
RUN pip3 install iniconfig colorlog pwgen
RUN pip3 install --no-cache-dir iniconfig==2.0.0 colorlog==6.8.2 pwgen==0.8.2.post0

# COPY docker/actinia-example-plugin-test/start.sh /src/start.sh

Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "actinia-example-plugin"
version = "1.0.0"
description = "An actinia-core plugin which adds example endpoints to actinia-core"
readme = "README.md"
authors = [
{ name = "Carmen Tawalika"},
{ name = "Anika Weinmann"},
]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.8"
keywords = [
"processing",
"earth observation",
"cloud-based processing",
"rest api",
"gis",
"grass gis",
"osgeo",
"example",
]
dependencies = [
"colorlog>=4.2.1",
"xmltodict",
]

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
]

[project.urls]
Homepage = "https://github.com/mundialis/actinia-example-plugin"
Tutorial = "https://mundialis.github.io/actinia_core"
API_Docs = "https://redocly.github.io/redoc/?url=https://actinia.mundialis.de/latest/swagger.json"

[tool.flake8]
max-line-length = 79

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"*" = ["*.*"]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov actinia_module_plugin --cov-report term-missing --verbose --tb=line -x -s"
testpaths = [
"tests",
]
markers = [
"dev: test current in development",
"unittest: completely independent test",
"integrationtest: integration test",
]
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
"config:recommended"
]
}
48 changes: 23 additions & 25 deletions scripts/create_own_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ PLUGIN_NAME=$1
PLUGIN_NAME2=$(tr -s '-' '_' <<< "${PLUGIN_NAME}")


if [ ! -v $2 ] && [ $2 == "git" ]
then
GIT_NAME=""
ORG_MSG=""
# if [[ -v $3 ]]
# then
# GIT_ORGANIZATION=$3
# ORG_MSG=" in the organization ${GIT_ORGANIZATION}"
# GIT_NAME="${GIT_ORGANIZATION}/${PLUGIN_NAME}"
# else
# GIT_NAME=${PLUGIN_NAME}
# fi
echo "GIT repository will be created${ORG_MSG}"
else
echo "No GIT repository will be created"
fi
# if [ ! -v "$2" ] && [ "$2" == "git" ]
# then
# GIT_NAME=""
# ORG_MSG=""
# # if [[ -v $3 ]]
# # then
# # GIT_ORGANIZATION=$3
# # ORG_MSG=" in the organization ${GIT_ORGANIZATION}"
# # GIT_NAME="${GIT_ORGANIZATION}/${PLUGIN_NAME}"
# # else
# # GIT_NAME=${PLUGIN_NAME}
# # fi
# echo "GIT repository ${GIT_NAME} will be created${ORG_MSG}"
# else
# echo "No GIT repository will be created"
# fi


# git clone [email protected]:mundialis/actinia-example-plugin.git
git clone https://github.com/mundialis/actinia-example-plugin.git ${PLUGIN_NAME}
git clone https://github.com/mundialis/actinia-example-plugin.git "${PLUGIN_NAME}"

cd ${PLUGIN_NAME}
cd "${PLUGIN_NAME}" || exit

rm -rf .git
rm -f scripts/create_own_plugin.sh
Expand All @@ -75,21 +75,19 @@ for file in $(find . -name '*actinia-example-plugin*' | sort --reverse)
do
DIR=$(dirname "${file}")
BASENAME=$(basename "${file}")
new_name=$(echo ${BASENAME} | sed "s+actinia-example-plugin+${PLUGIN_NAME}+g")
# echo "${file} ${DIR}/${new_name}"
mv ${file} ${DIR}/${new_name}
new_name=${BASENAME//actinia-example-plugin/$PLUGIN_NAME}
mv "${file}" "${DIR}"/"${new_name}"
done
for file in $(find . -name '*actinia_example_plugin*' | sort --reverse)
do
DIR=$(dirname "${file}")
BASENAME=$(basename "${file}")
new_name=$(echo ${BASENAME} | sed "s+actinia_example_plugin+${PLUGIN_NAME2}+g")
# echo "${file} ${DIR}/${new_name}"
mv ${file} ${DIR}/${new_name}
new_name=${BASENAME//actinia_example_plugin/$PLUGIN_NAME2}
mv "${file}" "${DIR}"/"${new_name}"
done

# create git repo
if [ ! -v $2 ] && [ $2 == "git" ]
if [ ! -v "$2" ] && [ "$2" == "git" ]
then
git init
git add . && git commit -m "actinia plugin created from https://github.com/mundialis/actinia-example-plugin"
Expand Down
Loading
Loading