Skip to content

Commit a585cf0

Browse files
committed
Initial commit of cmd2-ansi code
1 parent 654d007 commit a585cf0

19 files changed

Lines changed: 1983 additions & 5 deletions

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/quality.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: Quality
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
quality:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
21+
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
26+
- name: Install uv and set the python version
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
python-version: "3.13"
30+
- name: Install the project
31+
run: uv sync --group quality
32+
- name: Run pre-commit
33+
run: uv run pre-commit run -a --show-diff-on-failure

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: Tests
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
16+
fail-fast: false
17+
18+
runs-on: ${{ matrix.os }}
19+
defaults:
20+
run:
21+
shell: bash
22+
steps:
23+
- name: Check out
24+
uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v6
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
allow-prereleases: true
35+
- name: Install the project
36+
run: uv sync --all-extras --dev
37+
38+
- name: Run tests
39+
run: uv run python -Xutf8 -m pytest tests

.github/workflows/typecheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: TypeCheck
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
type-check:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
19+
fail-fast: false
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Check out
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
28+
29+
- name: Install uv and set the python version
30+
uses: astral-sh/setup-uv@v6
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Check typing
35+
run: uv run mypy .

.gitignore

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ipython_config.py
9898
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101-
#uv.lock
101+
uv.lock
102102

103103
# poetry
104104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

@@ -205,3 +205,13 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
# Node stuff for prettier formatting
210+
node_modules/
211+
package-lock.json
212+
213+
# macOS
214+
.DS_Store
215+
216+
# VSCode
217+
.vscode

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v6.0.0"
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-toml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: "v0.13.1"
13+
hooks:
14+
- id: ruff-format
15+
args: [--config=ruff.toml]
16+
- id: ruff-check
17+
args: [--config=ruff.toml, --fix, --exit-non-zero-on-fix]
18+
19+
- repo: https://github.com/pre-commit/mirrors-prettier
20+
rev: "v3.1.0"
21+
hooks:
22+
- id: prettier
23+
additional_dependencies:
24+
- prettier@3.6.2
25+
- prettier-plugin-toml@2.0.6

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add any files or directories which should be exempted from prettier formatting

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 100,
3+
"proseWrap": "always",
4+
"overrides": [
5+
{
6+
"files": "*.md",
7+
"options": {
8+
"tabWidth": 4
9+
}
10+
}
11+
]
12+
}

GEMINI.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Instructions for Gemini CLI in a `uv` Python project
2+
3+
This `GEMINI.md` file provides context and instructions for the Gemini CLI when working with this
4+
Python project, which utilizes `uv` for environment and package management.
5+
6+
## General Instructions
7+
8+
- **Environment Management:** Prefer using `uv` for all Python environment management tasks.
9+
- **Package Installation:** Always use `uv` to install packages and ensure they are installed within
10+
the project's virtual environment.
11+
- **Running Scripts/Commands:**
12+
- To run Python scripts within the project's virtual environment, use `uv run ...`.
13+
- To run programs directly from a PyPI package (installing it on the fly if necessary), use
14+
`uvx ...` (shortcut for `uv tool run`).
15+
- **New Dependencies:** If a new dependency is required, please state the reason for its inclusion.
16+
17+
## Python Code Standards
18+
19+
To ensure Python code adheres to required standards, the following commands **must** be run before
20+
creating or modifying any `.py` files:
21+
22+
```bash
23+
make check
24+
```
25+
26+
To run unit tests use the following command:
27+
28+
```bash
29+
make test
30+
```
31+
32+
Both of the above commands should be run prior to committing code.

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include LICENSE README.md pyproject.toml ruff.toml
2+
recursive-include examples *
3+
recursive-include tests *
4+
prune .github
5+
prune build
6+
exclude .github .gitignore
7+
global-exclude htmlcov/** .coverage* __pycache__/** .gitignore

0 commit comments

Comments
 (0)