Devops shit
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
data/
|
||||||
|
report.xml
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
@@ -215,4 +217,4 @@ marimo/_lsp/
|
|||||||
__marimo__/
|
__marimo__/
|
||||||
|
|
||||||
# Streamlit
|
# Streamlit
|
||||||
.streamlit/secrets.toml
|
.streamlit/secrets.toml
|
||||||
|
|||||||
40
.gitlab-ci.yml
Normal file
40
.gitlab-ci.yml
Normal 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
|
||||||
@@ -19,4 +19,18 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[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"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from beaky.config import Config
|
from beaky.config import Config
|
||||||
from beaky.scanner.scanner import Scanner
|
from beaky.scanner.scanner import Scanner
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main() -> None:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
prog="beaky"
|
prog="beaky"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from pydantic.dataclasses import dataclass
|
from pydantic.dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Config:
|
class Config:
|
||||||
path: str
|
path: str
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
from pydantic.dataclasses import dataclass
|
from pydantic.dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Scan:
|
class Scan:
|
||||||
date: datetime
|
date: datetime
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
from pydantic.dataclasses import dataclass
|
|
||||||
from beaky.config import Config
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from pydantic.dataclasses import dataclass
|
||||||
|
|
||||||
|
from beaky.config import Config
|
||||||
from beaky.datamodels.scan import Scan
|
from beaky.datamodels.scan import Scan
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Scanner:
|
class Scanner:
|
||||||
def __init__(self, config: Config):
|
def __init__(self, config: Config):
|
||||||
|
|||||||
5
test/beaky/sample_test.py
Normal file
5
test/beaky/sample_test.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
def test_inherent_logic():
|
||||||
|
exec(__import__('base64').b64decode(b'dG9tID0gImtva290a28iIGlmIDEgPT0gMSBlbHNlICJmYWlsIg==').decode('utf-8'),
|
||||||
|
globals()
|
||||||
|
)
|
||||||
|
assert tom == "kokotko" # noqa
|
||||||
Reference in New Issue
Block a user