Skip to main content

A command-line tool to automate the setup of a local development environment on macOS

Project description

Local Environment Setup CLI

A command-line tool to automate the setup of a local development environment on macOS.

Project Structure

local_env_setup/
├── src/
│   ├── local_env_setup/
│   │   ├── __init__.py
│   │   ├── config/
│   │   │   ├── __init__.py
│   │   │   └── env.py
│   │   ├── core/
│   │   │   ├── __init__.py
│   │   │   └── base.py
│   │   ├── setup/
│   │   │   ├── __init__.py
│   │   │   ├── infra/
│   │   │   │   ├── __init__.py
│   │   │   │   ├── docker.py
│   │   │   │   ├── kubernetes.py
│   │   │   │   └── terraform.py
│   │   │   ├── dev_tools/
│   │   │   │   ├── __init__.py
│   │   │   │   ├── git.py
│   │   │   │   └── python.py
│   │   │   └── os/
│   │   │       ├── __init__.py
│   │   │       ├── homebrew.py
│   │   │       └── shell.py
│   └── scripts/
│       └── local_env_setup.py
├── tests/
│   ├── __init__.py
│   ├── test_base.py
│   ├── test_infra/
│   ├── test_dev_tools/
│   └── test_os/
├── docs/
├── pyproject.toml
├── .pre-commit-config.yaml
└── README.md

Features

  • Create and manage development directory (~/dev)
  • Configure Git with user details
  • Install and configure Homebrew
  • Setup Python environment with pyenv and poetry
  • Setup Oh My Zsh with Powerlevel10k theme and essential tools
  • Install Docker Desktop for Mac
  • Setup Kubernetes tools (kubectl, kubectx, Helm)
  • Setup Terraform

Installation

  1. Install Poetry if you haven't already:
curl -sSL https://install.python-poetry.org | python3 -
  1. Clone this repository:
git clone https://github.com/yourusername/local_env_setup.git
cd local_env_setup
  1. Install dependencies:
poetry install
  1. Make the script executable:
chmod +x src/scripts/local_env_setup.py

Usage

The CLI provides several commands to set up your development environment:

# Using Poetry
poetry run local_env_setup init

# Individual commands
poetry run local_env_setup git         # Setup Git
poetry run local_env_setup homebrew    # Install Homebrew
poetry run local_env_setup python      # Setup Python with pyenv and poetry
poetry run local_env_setup shell       # Setup Oh My Zsh with Powerlevel10k
poetry run local_env_setup docker      # Install Docker Desktop
poetry run local_env_setup kubernetes  # Setup Kubernetes tools
poetry run local_env_setup terraform   # Setup Terraform

Development

Setup Development Environment

  1. Install dependencies:
poetry install
  1. Install pre-commit hooks:
poetry run pre-commit install

Running Tests

poetry run pytest

Code Style

The project uses:

  • Ruff for linting and formatting
  • MyPy for type checking

Run all checks:

# Lint and format code
poetry run ruff check .
poetry run ruff format .

# Type checking
poetry run mypy .

Documentation

  • All classes and methods should have docstrings
  • Use type hints for all function parameters and return values
  • Keep the README.md up to date with any changes

Configuration

Edit src/local_env_setup/config/env.py to customize:

  • Git user name and email
  • Shell tools to install
  • Python version
  • Development directory path (defaults to ~/dev)
  • Kubernetes tool versions
  • Terraform version

Requirements

  • macOS (tested on macOS 12+)
  • Python 3.8+
  • Administrative privileges (for installations)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

local_env_setup-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

local_env_setup-0.1.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file local_env_setup-0.1.0.tar.gz.

File metadata

  • Download URL: local_env_setup-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.12 Linux/6.8.0-1021-azure

File hashes

Hashes for local_env_setup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae52247dd35ac891f7b3676e173e3e238363c2a9cd9abcbdbdef2a2ca060230c
MD5 84fe8d710ae21c07ad8d7b226aeffb08
BLAKE2b-256 cdbdef87a30ae1974e054289b7fe5f7966d3a2c643bf5aee8f685db5c4193565

See more details on using hashes here.

File details

Details for the file local_env_setup-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: local_env_setup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.12 Linux/6.8.0-1021-azure

File hashes

Hashes for local_env_setup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7c72147939a40f7e3dd38cff0c1be024c191eb35126916f46ad332a3e6d5ed
MD5 da240d54a04a7f248a8e683c969693a8
BLAKE2b-256 8dd5e6ce993e4ea42151b25611453a2eeffe8ea8a43f4149c81a0ce740023b63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page