Welcome to geek-computers Python repository! This guide will help you set up your development environment and contribute to the project.
- Python 3.10+ (we test against 3.10, 3.11, and 3.12)
- pip (Python package manager)
- git
git clone https://github.com/geekcomputers/Python.git
cd Python# On Linux/Mac
python3 -m venv venv
source venv/bin/activate
# On Windows
python -m venv venv
venv\Scripts\activatepip install --upgrade pip
pip install -r requirements.txtpip install ruff bandit mypy pytest codespellBefore submitting a PR, run these checks locally:
codespell --skip "*.json,*.txt,*.pdf,*.md"bandit -r . --skip B101,B105ruff check .pytestmypy . --ignore-missing-importsWhen adding new scripts:
- Use clear, descriptive names -
calculate_fibonacci.pyinstead oftest.py - Add docstrings - Describe what your script does
- Include comments - Explain complex logic
- Use type hints (where applicable) - Helps with code clarity
- Test your code - Run it locally before submitting
"""
Module Name: Calculate Fibonacci Sequence
Description: Generate Fibonacci numbers up to N
Author: Your Name
Date: YYYY-MM-DD
"""
def fibonacci(n: int) -> list[int]:
"""
Generate Fibonacci sequence up to nth number.
Args:
n: Number of Fibonacci numbers to generate
Returns:
List of Fibonacci numbers
"""
if n <= 0:
return []
elif n == 1:
return [0]
fib = [0, 1]
for i in range(2, n):
fib.append(fib[i-1] + fib[i-2])
return fib
if __name__ == "__main__":
result = fibonacci(10)
print(result)- Create a feature branch -
git checkout -b feature/your-feature-name - Make your changes - Add or modify scripts
- Run quality checks - Use the commands above
- Commit your changes - Use clear commit messages
- Push to your fork -
git push origin feature/your-feature-name - Create a Pull Request - Include description and testing info
- Keep PRs focused on a single feature or fix
- Update README.md if adding new scripts
- Reference any related issues with "Closes #123"
- Follow the pull request template
Make sure you've activated the virtual environment and installed all requirements:
source venv/bin/activate # Linux/Mac
pip install -r requirements.txtCheck your Python version - we test on 3.10, 3.11, and 3.12:
python --versionRun ruff with auto-fix:
ruff check . --fix- Check existing issues
- Review the README.md for script documentation
- Email: craig@geekcomputers.co.uk
Happy coding! 🐍