Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'

- name: Cache pip dependencies
uses: actions/cache@v3
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black==24.8.0 isort==5.13.2
pip install black==24.8.0 isort==5.13.2

- name: Run Black
run: black --check .
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker
uses: docker/setup-buildx-action@v3
Expand Down
43 changes: 13 additions & 30 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,21 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.python-version }}-

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev

- name: Save cached venv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install project with dev extras
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]

- name: Run tests
run: poetry run pytest
run: pytest -q

deploy:
runs-on: ubuntu-latest
Expand All @@ -61,15 +41,18 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
- name: Install build deps
run: |
pip install setuptools wheel build
pip install -U pip
pip install build setuptools setuptools-scm wheel
- name: Build
run: |
python -m build
Expand Down
36 changes: 9 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,20 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.python-version }}-

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev

- name: Save cached venv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install project with dev extras
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]

- name: Run tests
run: poetry run pytest
run: pytest -q
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ build/
__pycache__/
*.py[cod]
*$py.class
venv
venv*
dist/
*.whl
.eggs
.pytest_cache
*.egg-info
.DS_Store
_version.py
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ python -m pytest
```
### Troubleshooting

#### Error: File "setup.py" not found.
If you get this error when running:

> ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: ...
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)

it usually means you need to upgrade pip to version 21.3 or newer
```
pip install --upgrade pip
```
- If editable install fails, ensure you have a modern toolchain:
```bash
python -m pip install --upgrade pip setuptools wheel build setuptools-scm
```
- If the reported version is `0+unknown`, ensure you're working from a Git checkout with tags available:
```bash
git fetch --tags --force
```


21 changes: 19 additions & 2 deletions arm_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
from beartype.claw import beartype_this_package
"""arm_cli package metadata."""

beartype_this_package()
# Expose package version via setuptools-scm only
try:
from ._version import version as __version__ # type: ignore[attr-defined]
except Exception: # pragma: no cover - fallback for editable installs
try:
from importlib.metadata import version as _get_version
except Exception:
try:
from importlib_metadata import version as _get_version # type: ignore[no-redef]
except Exception:
_get_version = None # type: ignore[assignment]
if _get_version is not None:
try:
__version__ = _get_version("arm-cli") # type: ignore[assignment]
except Exception:
__version__ = "0+unknown" # type: ignore[assignment]
else:
__version__ = "0+unknown" # type: ignore[assignment]
8 changes: 7 additions & 1 deletion arm_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
from beartype.claw import beartype_this_package

# Enable beartype on the package without polluting package __init__
beartype_this_package()

import click

from arm_cli import __version__
from arm_cli.container.container import container
from arm_cli.self.self import self
from arm_cli.system.system import system


@click.version_option()
@click.version_option(version=__version__)
@click.group(context_settings=dict(help_option_names=["-h", "--help"]))
def cli():
"""Experimental CLI for deploying robotic applications"""
Expand Down
1 change: 1 addition & 0 deletions arm_cli/container/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Container subcommands package."""
1 change: 1 addition & 0 deletions arm_cli/self/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Self subcommands package."""
1 change: 1 addition & 0 deletions arm_cli/system/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""System subcommands package."""
Loading