Skip to content

Commit

Permalink
start linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Dec 9, 2024
1 parent dbddb98 commit e0c3e6c
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 238 deletions.
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.

18 changes: 9 additions & 9 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on: [push, pull_request]
jobs:
lint:
uses: mundialis/github-workflows/.github/workflows/linting.yml@main
with:
# set pylint-version to empty string to skip the pylint workflow
pylint-version: ''
BASH_SEVERITY: 'warning'
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_JSON: false
VALIDATE_HTML: false
VALIDATE_CSS: false
VALIDATE_BASH_EXEC: false
# with:
# # set pylint-version to empty string to skip the pylint workflow
# pylint-version: ''
# BASH_SEVERITY: 'warning'
# VALIDATE_DOCKERFILE_HADOLINT: false
# VALIDATE_JSON: false
# VALIDATE_HTML: false
# VALIDATE_CSS: false
# VALIDATE_BASH_EXEC: false
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
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"
]
}
109 changes: 2 additions & 107 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,116 +1,11 @@
# This file is used to configure your project.
# Read more about the various options under:
# http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files

[metadata]
name = actinia_example_plugin.wsgi
description = actinia example plugin
author = Anika Weinmann
author-email = [email protected]
license = mit
long-description = file: README.md
long-description-content-type = text/x-rst; charset=UTF-8
url = https://github.com/pyscaffold/pyscaffold/
project-urls =
Documentation = https://pyscaffold.org/
# Change if running only on Windows, Mac or Linux (comma-separated)
platforms = any
# Add here all kinds of additional classifiers as defined under
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers =
Development Status :: 4 - Beta
Programming Language :: Python

[options]
zip_safe = False
packages = find_namespace:
packages = find:
include_package_data = True
package_dir =
=src
# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD!
setup_requires = pyscaffold>=3.2a0,<3.3a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
# install_requires = numpy; scipy
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
# python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
src

[options.packages.find]
where = src
exclude =
tests

[options.extras_require]
# Add here additional requirements for extra features, to install with:
# `pip install actinia-example-plugin[PDF]` like:
# PDF = ReportLab; RXP
# Add here test requirements (semicolon/line-separated)
testing =
pytest
pytest-cov

[options.entry_points]
# Add here console scripts like:
# console_scripts =
# script_name = actinia_example_plugin.module:function
# For example:
# console_scripts =
# fibonacci = actinia_example_plugin.skeleton:run
# And any other entry points, for example:
# pyscaffold.cli =
# awesome = pyscaffoldext.awesome.extension:AwesomeExtension

[test]
# py.test options when running `python setup.py test`
# addopts = --verbose
extras = True

[tool:pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
addopts =
--cov actinia_example_plugin --cov-report term-missing
--verbose --tb=line -x -s
norecursedirs =
dist
build
.tox
markers =
dev: test current in development
unittest: completely independent test
integrationtest: integration test

[aliases]
dists = bdist_wheel

[bdist_wheel]
# Use this option if your package is pure-python
universal = 1

[build_sphinx]
source_dir = docs
build_dir = build/sphinx

[devpi:upload]
# Options for the devpi: PyPI server and packaging tool
# VCS export must be deactivated since we are using setuptools-scm
no-vcs = 1
formats = bdist_wheel

[flake8]
# Some sane defaults for the code style checker flake8
exclude =
.tox
build
dist
.eggs
docs/conf.py

[pyscaffold]
# PyScaffold's parameters when the project was created.
# This will be used when updating. Do not change!
version = 3.2.3
package = actinia_example_plugin
21 changes: 1 addition & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# -*- coding: utf-8 -*-
"""
Setup file for actinia_example_plugin.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.2.3.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys

from pkg_resources import VersionConflict, require
from setuptools import setup

Check failure on line 1 in setup.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (D100)

setup.py:1:1: D100 Missing docstring in public module

Check failure on line 1 in setup.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (D100)

setup.py:1:1: D100 Missing docstring in public module

try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)


if __name__ == "__main__":
setup(use_pyscaffold=True)
setup()
3 changes: 1 addition & 2 deletions src/actinia_example_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

Check failure on line 2 in src/actinia_example_plugin/__init__.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (UP009)

src/actinia_example_plugin/__init__.py:2:1: UP009 UTF-8 encoding declaration is unnecessary

Check failure on line 2 in src/actinia_example_plugin/__init__.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (UP009)

src/actinia_example_plugin/__init__.py:2:1: UP009 UTF-8 encoding declaration is unnecessary
"""
Copyright (c) 2018-present mundialis GmbH & Co. KG
"""Copyright (c) 2018-present mundialis GmbH & Co. KG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
7 changes: 3 additions & 4 deletions src/actinia_example_plugin/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ def create_project_endpoints(apidoc, projects_url_part="projects"):

apidoc.add_resource(
ProjectHelloWorld,
f"<string:project_name>/helloworld",
endpoint=get_endpoint_class_name(
ProjectHelloWorld, projects_url_part
),
"<string:project_name>/helloworld",
endpoint=get_endpoint_class_name(ProjectHelloWorld, projects_url_part),
)


# endpoints loaded if run as actinia-core plugin as well as standalone app
def create_endpoints(flask_api):
apidoc = flask_api
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def createUser(

def check_started_process(testCase, resp):
"""Checks response of started process - TODO: can be enhanced"""
if type(resp.json["process_results"]) == dict:
if type(resp.json["process_results"]) is dict:
resp.json["process_results"] = str(resp.json["process_results"])
resp_class = ProcessingResponseModel(**resp.json)
assert resp_class["status"] == "accepted"
Expand Down
Loading

0 comments on commit e0c3e6c

Please sign in to comment.