Skip to content

wesleymassine/setup_python

Repository files navigation

Setup Python - Professional Development Project

Professional Python development setup project with best practices.

🚀 Environment Setup

Prerequisites

  • Python 3.8+
  • pyenv (recommended)

Installation

  1. Clone the repository (if applicable)
git clone <your-repository>
cd setup_python
  1. Create virtual environment
python3 -m venv .venv
  1. Activate virtual environment
source .venv/bin/activate
  1. Install dependencies
# Production dependencies
pip install -r requirements.txt

# Development dependencies
pip install -r requirements-dev.txt
  1. Setup pre-commit hooks
pre-commit install

🏗️ Project Structure

setup_python/
├── .venv/                  # Virtual environment (not committed)
├── src/                    # Source code
│   └── __init__.py
├── tests/                  # Unit tests
│   └── __init__.py
├── run.py                  # Main script
├── requirements.txt        # Production dependencies
├── requirements-dev.txt    # Development dependencies
├── pyproject.toml         # Project configuration
├── .flake8                # Flake8 configuration
├── .pre-commit-config.yaml # Pre-commit hooks
├── .gitignore             # Git ignored files
└── README.md              # This file

🧪 Testing

Run tests with:

pytest

With code coverage:

pytest --cov=src --cov-report=html

🎨 Formatting and Linting

Auto-format code:

black .

Check style issues:

flake8 src tests

Static analysis with pylint:

pylint src

Type checking with mypy:

mypy src

🔧 Best Practices

  1. Always activate virtual environment before working
  2. Run tests before committing
  3. Use pre-commit hooks to ensure code quality
  4. Document your functions with docstrings
  5. Keep requirements.txt updated

📝 Development

To add new dependencies:

pip install <package>
pip freeze > requirements.txt

About

Professional Python development setup project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published