Skip to content
Snippets Groups Projects
Commit 43f860d8 authored by Jakub Balicki's avatar Jakub Balicki
Browse files

testowy branch - po zmergowaniu init MRa - ten branch do usuniecia

parent 3362ce41
Branches tox-test
No related merge requests found
Pipeline #7487 failed
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
config-test.ini config-test.ini
poetry.lock poetry.lock
__pycache__/ __pycache__/
.pytest_cache
default: default:
image: python:3.10 image: python:3.10
# before script for check_style and tests
.style_and_test_template:
before_script:
- pip install poetry
- poetry install
stages: stages:
- check_style
- tests - tests
- builds - pages
- build
linting: pep8:
stage: tests extends: .style_and_test_template
before_script: stage: check_style
- pip install pre-commit
- pre-commit install-hooks
script: script:
- pre-commit run --all-files - poetry run tox -v -e pep8
allow_failure: true
testing: docstyle:
extends: .style_and_test_template
stage: check_style
script:
- poetry run tox -v -e docstyle
tests:
extends: .style_and_test_template
stage: tests stage: tests
before_script:
- pip install poetry==1.1.8 poetry-core==1.0.4
- poetry install
- source `poetry env info --path`/bin/activate
script: script:
- pytest -v tests/ - poetry run coverage run --source=src -m pytest --junitxml=report.xml tests/
- poetry run coverage html
- poetry run coverage xml
artifacts:
paths:
- htmlcov
expire_in: 1 week
reports:
junit:
- report.xml
cobertura:
- coverage.xml
pages:
stage: pages
script:
- mkdir -p public/coverage
- cp -r htmlcov/* public/coverage/
artifacts:
name: coverage
paths:
- public
build_master: build_master:
stage: builds stage: builds
......
[settings]
known_third_party = easymatcher,nlp_ws,pytest
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
args: [--profile=black]
- repo: https://github.com/ambv/black
rev: 22.12.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pycqa/pylint
rev: v2.15.8
hooks:
- id: pylint
This diff is collapsed.
...@@ -13,23 +13,14 @@ secondary = true ...@@ -13,23 +13,14 @@ secondary = true
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.10" python = "^3.10"
easymatcher = {version = "~0.1", source = "clarin"} easymatcher = {version = "~0.1", source = "clarin"}
nlp-ws = {version = "~2.1", source = "clarin"} nlp-ws = {version = "~2.1", source = "clarin"}
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
black = "^22.12.0" coverage = "~7.0"
isort = "v5.10.1" pytest = "~7.2"
pre-commit = "*" tox = "~3.18"
pylint = "v2.15.8"
[tool.isort]
profile = "black"
line_length = 120
force_sort_within_sections = "False"
order_by_type = "False"
[tool.black]
line-length = 120
[build-system] [build-system]
requires = ["poetry-core==1.0.4"] requires = ["poetry-core==1.0.4"]
......
"""Easymatcher worker implementation."""
import json import json
import logging import logging
import os import os
...@@ -13,6 +15,10 @@ _log = logging.getLogger(__name__) ...@@ -13,6 +15,10 @@ _log = logging.getLogger(__name__)
class EasymatcherWorker(nlp_ws.NLPWorker): # pylint: disable=abstract-method, too-few-public-methods class EasymatcherWorker(nlp_ws.NLPWorker): # pylint: disable=abstract-method, too-few-public-methods
"""
Class implementing EasymatcherWorker worker.
It relies on the use of an easymatcher tool - https://gitlab.clarin-pl.eu/knowledge-extraction/tools/easymatcher
"""
def __init__(self) -> None: def __init__(self) -> None:
pass pass
......
tox.ini 0 → 100644
[tox]
envlist = pep8,docstyle
skipsdist = True
[testenv:pep8]
deps =
flake8
basepython = python3
commands =
flake8 {posargs}
[testenv:docstyle]
deps =
pydocstyle
basepython = python3
commands =
pydocstyle --verbose {posargs}
[testenv:pytest]
deps =
pytest
pytest-pythonpath
coverage
nlp_ws
easymatcher
commands =
coverage run --source=src -m pytest --junitxml=report.xml tests/
coverage html
[pytest]
python_paths = src src
[run]
relative_files = True
branch = True
[flake8]
# W504 skipped because it is overeager and unnecessary
ignore = W504
show-source = True
exclude = .git,.venv,.tox,dist,doc,*egg,build,venv,tests,.vscode
import-order-style = pep8
max-line-length = 80
[pydocstyle]
# D104 Missing docstring in public package
# D203 1 blank line required before class docstring
# D213 Multi-line docstring summary should start at the second line
# D214 Section is over-indented
# D215 Section underline is over-indented
# D401 First line should be in imperative mood; try rephrasing
# D405 Section name should be properly capitalized
# D406 Section name should end with a newline
# D407 Missing dashed underline after section
# D408 Section underline should be in the line following the section’s name
# D409 Section underline should match the length of its name
# D410 Missing blank line after section
# D411 Missing blank line before section
ignore = D104,D203,D213,D214,D215,D401,D405,D406,D407,D408,D409,D410,D411
match-dir = ^(?!\.tox|venv|tests).*
match = ^(?!setup).*\.py
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment