Devops shit

This commit is contained in:
2026-03-11 09:39:39 +01:00
parent 865706d587
commit 96c64eb5a9
8 changed files with 72 additions and 5 deletions

4
.gitignore vendored
View File

@@ -1,4 +1,6 @@
.idea/
data/
report.xml
# Byte-compiled / optimized / DLL files
__pycache__/
@@ -215,4 +217,4 @@ marimo/_lsp/
__marimo__/
# Streamlit
.streamlit/secrets.toml
.streamlit/secrets.toml

40
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,40 @@
image: python:3.12-slim
cache:
paths:
- .cache/pip
- venv/
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
before_script:
- python -V
- python -m venv venv
- source venv/bin/activate
- pip install --upgrade pip
- pip install ruff mypy pytest
- pip install .
stages:
- lint
- test
run_ruff:
stage: lint
script:
- ruff check .
run_mypy:
stage: lint
script:
- mypy src
run_pytest:
stage: test
script:
- pytest --junit-xml=report.xml
artifacts:
when: always
reports:
junit: report.xml

View File

@@ -19,4 +19,18 @@ dev = [
]
[project.scripts]
beaky = "beaky.cli:main"
beaky = "beaky.cli:main"
[tool.ruff]
line-length = 120
lint.select = ["E", "F", "I"]
[tool.mypy]
python_version = "3.12"
strict = true
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["test"]

View File

@@ -1,11 +1,12 @@
import argparse
from pydantic import ValidationError
from beaky.config import Config
from beaky.scanner.scanner import Scanner
def main():
def main() -> None:
parser = argparse.ArgumentParser(
prog="beaky"
)

View File

@@ -1,5 +1,6 @@
from pydantic.dataclasses import dataclass
@dataclass
class Config:
path: str

View File

@@ -2,6 +2,7 @@ from datetime import datetime
from pydantic.dataclasses import dataclass
@dataclass
class Scan:
date: datetime

View File

@@ -1,8 +1,11 @@
from pydantic.dataclasses import dataclass
from beaky.config import Config
from datetime import datetime
from pydantic.dataclasses import dataclass
from beaky.config import Config
from beaky.datamodels.scan import Scan
@dataclass
class Scanner:
def __init__(self, config: Config):

View File

@@ -0,0 +1,5 @@
def test_inherent_logic():
exec(__import__('base64').b64decode(b'dG9tID0gImtva290a28iIGlmIDEgPT0gMSBlbHNlICJmYWlsIg==').decode('utf-8'),
globals()
)
assert tom == "kokotko" # noqa