ci: debug
Some checks reported errors
continuous-integration/drone Build encountered an error

This commit is contained in:
cătălin 2023-04-13 21:44:31 +02:00
commit 66f3f53ca5
Signed by: catalin
GPG key ID: 0178DF42F43E5FD2
3 changed files with 34 additions and 37 deletions

View file

@ -33,28 +33,27 @@ steps:
- name: install_deps
pull: true
image: git.roboces.dev/catalin/poetry:beta
image: git.roboces.dev/catalin/pdm:latest-311
commands:
- poetry config virtualenvs.in-project 1
- poetry install --with linters,test
- pdm install -G :all
depends_on:
- restore_cache
- name: lint
- name: lints 311
pull: true
image: git.roboces.dev/catalin/poetry:beta
image: git.roboces.dev/catalin/pdm:latest-311
commands:
- .venv/bin/pre-commit run --all-files --color always
- pdm run pre-commit run --all-files --color always
depends_on:
- install_deps
- name: tests
- name: tests 311
pull: true
image: git.roboces.dev/catalin/poetry:beta
image: git.roboces.dev/catalin/pdm:latest-311
commands:
- apk add --no-cache age openssh
- ssh-keygen -t ed25519 -C "" -N "" -f /root/.ssh/id_ed25519
- .venv/bin/pytest
- pdm run pytest --cov=halig -vv tests --report-log reportlog.json
- pdm run coverage html
- pdm run coverage xml
depends_on:
- install_deps
@ -62,10 +61,8 @@ steps:
pull: true
image: git.roboces.dev/catalin/poetry:beta
commands:
- poetry build
- poetry config repositories.roboces https://git.roboces.dev/api/packages/catalin/pypi
- poetry config http-basic.roboces "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD"
- poetry publish --repository roboces
- pdm publish -u $(PYPI_REGISTRY_USERNAME) -P $(PYPI_REGISTRY_PASSWORD)
- pdm publish -u $(ROBOCES_REGISTRY_USERNAME) -P $(ROBOCES_REGISTRY_PASSWORD) -r https://git.roboces.dev/api/packages/catalin/pypi
when:
ref:
- refs/tags/v*
@ -96,4 +93,4 @@ steps:
- success
depends_on:
- lint
- tests
- tests

View file

@ -1,5 +1,5 @@
# halig
[![Build Status](https://ci.roboces.dev/api/badges/catalin/halig/status.svg?ref=refs/heads/main)](https://ci.roboces.dev/catalin/halig)
![PyPI](https://img.shields.io/pypi/v/halig?logo=python)
![PyPI - License](https://img.shields.io/pypi/l/halig)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/halig)
@ -38,4 +38,4 @@ EOF
halig edit some_notebook # edit today's note relative to <notebooks_root_path>/some_notebook
halig edit some_notebook/foo # edit <notebooks_root_path>/some_notebook/foo.age
halig notebooks # list current notebooks
```
```

View file

@ -2,16 +2,16 @@
from pathlib import Path
from typing import Optional
from rich import print
from typer import Argument, Option, Typer
from halig import literals
from halig.__version__ import __version__
from halig.commands.edit import EditCommand
from halig.commands.notebooks import NotebooksCommand
from halig.commands.show import ShowCommand
from halig.settings import load_from_file
from halig.utils import capture
from halig.__version__ import __version__
from rich import print
app = Typer(pretty_exceptions_enable=False, pretty_exceptions_show_locals=False)
@ -21,13 +21,13 @@ config_option = Option(None, "--config", "-c", help=literals.OPTION_CONFIG_HELP)
@app.command(help=literals.COMMANDS_NOTEBOOKS_HELP)
@capture
def notebooks(
level: int = Option( # noqa: B008
-1,
"--level",
"-l",
help=literals.OPTION_LEVEL_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
level: int = Option( # noqa: B008
-1,
"--level",
"-l",
help=literals.OPTION_LEVEL_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
):
if level < 0:
level = float("inf") # type: ignore[assignment]
@ -39,11 +39,11 @@ def notebooks(
@app.command(help=literals.COMMANDS_EDIT_HELP)
@capture
def edit(
note: Path = Argument( # noqa: B008
...,
help=literals.ARGUMENT_EDIT_NOTE_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
note: Path = Argument( # noqa: B008
...,
help=literals.ARGUMENT_EDIT_NOTE_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
):
settings = load_from_file(config)
command = EditCommand(settings=settings, note_path=note)
@ -53,11 +53,11 @@ def edit(
@app.command(help=literals.COMMANDS_SHOW_HELP)
@capture
def show(
note: Path = Argument( # noqa: B008
...,
help=literals.ARGUMENT_SHOW_NOTE_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
note: Path = Argument( # noqa: B008
...,
help=literals.ARGUMENT_SHOW_NOTE_HELP,
),
config: Optional[Path] = config_option, # noqa: UP007
):
settings = load_from_file(config)
command = ShowCommand(settings=settings, note_path=note)