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

|

|
||||||

|

|
||||||

|

|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,16 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
from rich import print
|
||||||
from typer import Argument, Option, Typer
|
from typer import Argument, Option, Typer
|
||||||
|
|
||||||
from halig import literals
|
from halig import literals
|
||||||
|
from halig.__version__ import __version__
|
||||||
from halig.commands.edit import EditCommand
|
from halig.commands.edit import EditCommand
|
||||||
from halig.commands.notebooks import NotebooksCommand
|
from halig.commands.notebooks import NotebooksCommand
|
||||||
from halig.commands.show import ShowCommand
|
from halig.commands.show import ShowCommand
|
||||||
from halig.settings import load_from_file
|
from halig.settings import load_from_file
|
||||||
from halig.utils import capture
|
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)
|
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)
|
@app.command(help=literals.COMMANDS_NOTEBOOKS_HELP)
|
||||||
@capture
|
@capture
|
||||||
def notebooks(
|
def notebooks(
|
||||||
level: int = Option( # noqa: B008
|
level: int = Option( # noqa: B008
|
||||||
-1,
|
-1,
|
||||||
"--level",
|
"--level",
|
||||||
"-l",
|
"-l",
|
||||||
help=literals.OPTION_LEVEL_HELP,
|
help=literals.OPTION_LEVEL_HELP,
|
||||||
),
|
),
|
||||||
config: Optional[Path] = config_option, # noqa: UP007
|
config: Optional[Path] = config_option, # noqa: UP007
|
||||||
):
|
):
|
||||||
if level < 0:
|
if level < 0:
|
||||||
level = float("inf") # type: ignore[assignment]
|
level = float("inf") # type: ignore[assignment]
|
||||||
|
|
@ -39,11 +39,11 @@ def notebooks(
|
||||||
@app.command(help=literals.COMMANDS_EDIT_HELP)
|
@app.command(help=literals.COMMANDS_EDIT_HELP)
|
||||||
@capture
|
@capture
|
||||||
def edit(
|
def edit(
|
||||||
note: Path = Argument( # noqa: B008
|
note: Path = Argument( # noqa: B008
|
||||||
...,
|
...,
|
||||||
help=literals.ARGUMENT_EDIT_NOTE_HELP,
|
help=literals.ARGUMENT_EDIT_NOTE_HELP,
|
||||||
),
|
),
|
||||||
config: Optional[Path] = config_option, # noqa: UP007
|
config: Optional[Path] = config_option, # noqa: UP007
|
||||||
):
|
):
|
||||||
settings = load_from_file(config)
|
settings = load_from_file(config)
|
||||||
command = EditCommand(settings=settings, note_path=note)
|
command = EditCommand(settings=settings, note_path=note)
|
||||||
|
|
@ -53,11 +53,11 @@ def edit(
|
||||||
@app.command(help=literals.COMMANDS_SHOW_HELP)
|
@app.command(help=literals.COMMANDS_SHOW_HELP)
|
||||||
@capture
|
@capture
|
||||||
def show(
|
def show(
|
||||||
note: Path = Argument( # noqa: B008
|
note: Path = Argument( # noqa: B008
|
||||||
...,
|
...,
|
||||||
help=literals.ARGUMENT_SHOW_NOTE_HELP,
|
help=literals.ARGUMENT_SHOW_NOTE_HELP,
|
||||||
),
|
),
|
||||||
config: Optional[Path] = config_option, # noqa: UP007
|
config: Optional[Path] = config_option, # noqa: UP007
|
||||||
):
|
):
|
||||||
settings = load_from_file(config)
|
settings = load_from_file(config)
|
||||||
command = ShowCommand(settings=settings, note_path=note)
|
command = ShowCommand(settings=settings, note_path=note)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue