Skip to content
Open
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
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10-slim

WORKDIR /app

# Install git and other potential dependencies
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

COPY requirements.txt requirements-dev.txt ./
RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
Comment on lines +8 to +9
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirements files are copied but the actual source code is copied after installing dependencies. This means the dependencies are installed before the source code is available, which could cause issues if the installation process needs access to the source code (e.g., for editable installs). Consider whether the COPY . . on line 11 should come before or if you need to install the package in editable mode with pip install -e .

Copilot uses AI. Check for mistakes.

COPY . .

CMD ["pytest"]
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMD directive specifies pytest as the default command, but in a development container, it's more typical to not specify a CMD or use a long-running process like bash. Developers usually want to run various commands interactively rather than having pytest run automatically when the container starts. Consider removing this line or changing it to CMD ["bash"] or CMD ["sleep", "infinity"].

Suggested change
CMD ["pytest"]
CMD ["bash"]

Copilot uses AI. Check for mistakes.
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "ItsPrompt Dev",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
}
}
}
7 changes: 7 additions & 0 deletions tests/data/test_expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ def test_process_data_with_separator():
ans = process_data(options)

assert ans.with_separators == result


def test_expand_options_get_option_returns_none():
options = ("first", "second")
ans = process_data(options)

assert ans.get_option("z") is None
10 changes: 10 additions & 0 deletions tests/prompts/test_checkbox_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,14 @@ def test_checkbox_raises_invalid_disabled():
ans = Prompt.checkbox("", options, disabled=("invalid",))


def test_checkbox_min_selections(send_keys):
options = ("first", "second")
# Try to enter without selection (blocked), then select "first", then enter (success)
send_keys(Keys.Enter, " ", Keys.Enter)

ans = Prompt.checkbox("", options, min_selections=1)

assert ans == ["first"]


# TODO check min selections with error box (visual)
10 changes: 10 additions & 0 deletions tests/prompts/test_input_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ def test_input_raises_keyboard_interrupt(send_keys):
ans = Prompt.input("")


def test_input_validation(send_keys):
# validator requires at least 2 characters
# send "v", Enter (blocked), "a", Enter (success)
send_keys("v", Keys.Enter, "a", Keys.Enter)

ans = Prompt.input("", validate=lambda x: len(x) > 1)

assert ans == "va"


# TODO input show_symbol is showing symbol (visual)
# TODO input completer/completions is working (visual, functional)
# TODO input validation is showing error (visual)
Loading