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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--config", "./pyproject.toml"],
"python.formatting.blackArgs": ["--config", "./hello-world/pyproject.toml"],
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--config=./pyproject.toml"],
"python.linting.flake8Args": ["--config=./hello-world/pyproject.toml"],
"python.linting.mypyEnabled": true,
"python.analysis.extraPaths": [
"./src"
"./hello-world/hello_world"
],
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
Expand Down
17 changes: 9 additions & 8 deletions .devcontainer/scripts/postCreate.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/bash

set -e # Exit immediately if a command exits with a non-zero status
set -e # Exit immediately if a command exits with a non-zero status

# Display system information
echo "System Information:"
uname -a

# Install Poetry
echo "Installing Poetry..."
if ! command -v poetry &> /dev/null; then
if ! command -v poetry &>/dev/null; then
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
else
echo "Poetry is already installed."
fi

# Verify Poetry installation
if ! command -v poetry &> /dev/null; then
if ! command -v poetry &>/dev/null; then
echo "Error: Poetry installation failed."
exit 1
fi
Expand All @@ -26,28 +26,29 @@ poetry config virtualenvs.in-project true

# Install dependencies via Poetry
echo "Installing dependencies with Poetry..."
cd hello-world
poetry install --with dev

# Ensure PYTHONPATH is set in the current session and persists across sessions
PYTHONPATH_ENTRY="/workspaces/test/src"
PYTHONPATH_ENTRY="/workspaces/hello-world/"
if ! grep -Fxq "export PYTHONPATH=$PYTHONPATH_ENTRY:\$PYTHONPATH" ~/.bashrc; then
echo "Configuring PYTHONPATH..."
echo "export PYTHONPATH=$PYTHONPATH_ENTRY:\$PYTHONPATH" >> ~/.bashrc
echo "export PYTHONPATH=$PYTHONPATH_ENTRY:\$PYTHONPATH" >>~/.bashrc
fi

# Add the Poetry virtual environment's `bin` directory to PATH
VENV_BIN_PATH="/workspaces/test/.venv/bin"
VENV_BIN_PATH="/workspaces/hello-world/.venv/bin"
if ! grep -Fxq "export PATH=$VENV_BIN_PATH:\$PATH" ~/.bashrc; then
echo "Adding Poetry virtual environment to PATH..."
echo "export PATH=$VENV_BIN_PATH:\$PATH" >> ~/.bashrc
echo "export PATH=$VENV_BIN_PATH:\$PATH" >>~/.bashrc
fi

# Load the updated bashrc configuration for the current session
source ~/.bashrc

# Validate that validate-devschema is accessible
echo "Validating script installation..."
if ! validate-devschema --help &> /dev/null; then
if ! validate-devschema --help &>/dev/null; then
echo "Error: validate-devschema script is not globally accessible."
exit 1
else
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ci

on:
push:
branches:
- main
pull_request:
schedule:
- cron: 0 12 * * *
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV

- name: Install dependencies with Poetry
run: |
cd hello-world
poetry install --with dev

- name: Set PYTHONPATH to include the source directory
run: echo "PYTHONPATH=$PWD/hello-world" >> $GITHUB_ENV

- name: Run tests
run: |
cd hello-world
poetry run pytest --cov=hello-world --cov-report=term-missing
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--config", "./pyproject.toml"],
"python.formatting.blackArgs": ["--config", "./hello-world/pyproject.toml"],
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.flake8Args": ["--config=./pyproject.toml"],
"python.linting.flake8Args": ["--config=./hello-world/pyproject.toml"],
"python.analysis.extraPaths": [
"./src"
"./hello-world"
],
"python.pythonPath": "/workspaces/test/.venv/bin/python",
"[python]": {
Expand Down
11 changes: 0 additions & 11 deletions commitmsg-conform.yml

This file was deleted.

Loading
Loading