Skip to content

Commit 67af4cc

Browse files
committed
Add bare bones Acidwatch CLI
1 parent 2e69138 commit 67af4cc

9 files changed

Lines changed: 130 additions & 1 deletion

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: ./backend/packages/acidwatch
15+
16+
environment:
17+
name: pypi
18+
permissions:
19+
id-token: write
20+
contents: read
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
sparse-checkout: ./backend/packages/acidwatch
25+
26+
- name: Set up Python 3.12
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: "3.12"
30+
31+
- name: Install uv
32+
run: pip install uv
33+
- name: Build
34+
run: uv build
35+
- name: Publish
36+
run: uv publish
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Individual python packages
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
branches: ["main"]
8+
pull_request:
9+
branches: ["main"]
10+
11+
jobs:
12+
build-and-test:
13+
strategy:
14+
matrix:
15+
directory:
16+
- ./backend/packages/acidwatch
17+
fail-fast: true
18+
19+
runs-on: ubuntu-latest
20+
21+
defaults:
22+
run:
23+
working-directory: ${{ matrix.directory }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
sparse-checkout: ${{ matrix.directory }}
29+
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.12"
33+
34+
- uses: astral-sh/setup-uv@v5
35+
36+
- name: Install dependencies
37+
run: uv sync
38+
39+
- name: Run ruff
40+
run: |
41+
uv run ruff format --check
42+
uv run ruff check
43+
44+
- name: Run mypy
45+
run: uv run mypy --strict src
46+
47+
- name: Run pytest
48+
run: |
49+
uv run pytest tests

backend/packages/acidwatch/README.md

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[project]
2+
name = "acidwatch"
3+
version = "0.1.0"
4+
description = "CLI for AcidWatch"
5+
readme = "README.md"
6+
requires-python = ">=3.12, <3.14"
7+
dependencies = []
8+
9+
[project.scripts]
10+
acidwatch = "acidwatch.cli:main"
11+
12+
[dependency-groups]
13+
dev = [
14+
"mypy",
15+
"pytest",
16+
"pytest-asyncio",
17+
"ruff",
18+
]
19+
20+
[build-system]
21+
requires = ["hatchling"]
22+
build-backend = "hatchling.build"

backend/packages/acidwatch/src/acidwatch/__init__.py

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def main() -> None:
2+
print("Hello from acidwatch!")
3+
4+
5+
if __name__ == "__main__":
6+
main()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_cli():
2+
assert True

backend/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ dev = [
4646
requires = ["hatchling"]
4747
build-backend = "hatchling.build"
4848

49+
[tool.uv.workspace]
50+
members = ["packages/*"]
51+
4952
[tool.isort]
5053
profile = "black"
5154

backend/uv.lock

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)