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
41 changes: 18 additions & 23 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
## Summary

- What changed?
- Why was it needed?
<!-- Describe what changed and why. Link the related issue, for example: Closes #123. -->

## Scope
## Type of change

- [ ] `training-py`
- [ ] `nan-python-engineering-labs`
- [ ] Both repos
- [ ] Documentation
- [ ] Bug fix
- [ ] New or updated learning content
- [ ] Repository tooling
- [ ] Other

## Validation
## How Has This Been Tested?

- [ ] `scripts/validate_all_modules.py`
- [ ] `scripts/run_topic_tests.py <target>`
- [ ] Relevant examples executed when applicable
<!-- Check the commands you ran and replace TARGET with the relevant module or topic. -->

Paste key outputs:
- [ ] `uv run scripts/validate_all_modules.py`
- [ ] `uv run scripts/validate_ci_gate.py`
- [ ] `uv run scripts/run_topic_tests.py TARGET`
- [ ] Manual validation (describe below)

```text
SUMMARY: ...
```
<!-- If automated validation does not apply, explain why and describe your manual checks. -->

## Checklist

- [ ] Commit messages are in English
- [ ] No TODO placeholders introduced
- [ ] `exercise/exercise_01.py` remains English-only
- [ ] No unrelated files were modified

## Risks / Notes

- Potential impact:
- Follow-up tasks (if any):
- [ ] I followed the contribution guidelines.
- [ ] I kept the change focused and used English throughout.
- [ ] I added or updated tests and documentation where applicable.
- [ ] I did not introduce TODO placeholders or unrelated changes.
65 changes: 49 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,68 @@
# Contributing

## Branches
Thank you for helping improve Python Engineering Labs. Keep contributions focused,
beginner-friendly, and written in English.

- Work from `main` using short-lived feature branches.
- Keep one logical change per branch.
## Prerequisites

## Commits
- [Git](https://git-scm.com/)
- Python 3.12 or newer
- [uv](https://docs.astral.sh/uv/)

- Use English commit messages.
- Keep commits focused and small.
- Avoid mixing infra and content changes in the same commit when possible.
You can also use the repository's Dev Container. See
[Getting Started](GETTING_STARTED.md) for the complete setup options.

## Validation Before Commit
## Local setup

Run from repo root:
Fork the repository on GitHub, then clone your fork:

```bash
git clone https://github.com/YOUR_GITHUB_USERNAME/nan-python-engineering-labs.git
cd nan-python-engineering-labs
uv venv
```

Activate the virtual environment:

```bash
# macOS or Linux
source .venv/bin/activate
python scripts/validate_all_modules.py
python scripts/run_topic_tests.py 01_python_fundamentals/advanced_strings

# Windows PowerShell
.venv\Scripts\Activate.ps1
```

Or using `uv run`:
Install the development dependencies:

```bash
uv pip install -e ".[dev]"
pre-commit install
```

Install all optional dependencies with `uv pip install -e ".[all]"` when your
change needs the full curriculum validation used in CI.

## Validate your change

Run the checks that match your change from the repository root:

```bash
uv run scripts/validate_all_modules.py
uv run scripts/validate_ci_gate.py
uv run scripts/run_topic_tests.py 01_python_fundamentals/advanced_strings
```

## Pull Requests
Run all topic tests with `uv run scripts/run_topic_tests.py`. For documentation-only
changes, preview the rendered Markdown and state in the pull request when automated
tests do not apply.

## Submit a pull request

1. Create a short-lived branch from `main` for one logical change.
1. Use focused commits with English messages.
1. Push the branch to your fork and open a pull request against `main`.
1. Complete the pull request template with the related issue, validation evidence,
and any risks or follow-up work.

- Use the PR template.
- Include scope, validation evidence, and risks.
- Do not include unrelated changes.
Before submitting, review the repository conventions in [AGENTS.md](AGENTS.md) and
keep unrelated changes out of the pull request.