Skip to content

Conversation

@kaiosilva-dataeng
Copy link

Pull Request: Encapsulate project as a globally accessible CLI package

Overview

This PR transforms the project into a proper Python CLI package that can be installed globally and accessed through the system path. The changes align with Python ecosystem best practices and make the tool more accessible to users.

Changes Made

Major Improvements

  • Proper Package Structure: Organized the code into a proper Python package with src layout
  • CLI Executable: Set up the package to register a system-wide command with project.scripts
  • Build System: Added proper build system configuration for distribution
  • Docker Support: Enhanced Docker configuration with multi-stage builds and caching
  • Comprehensive Testing: Improved test structure and coverage
  • Documentation: Updated README and added Docker-specific documentation

Technical Details

  • Added package configuration in pyproject.toml including entry points and build system
  • Organized code to follow the src layout pattern (better isolated tests)
  • Set up GitHub Actions CI for testing and linting
  • Configured pre-commit hooks for code quality
  • Added proper Docker configuration for development and production
  • Implemented Docker Compose for development environment
  • Added comprehensive Makefile for development tasks

Benefits

  1. Improved Developer Experience: Simple installation with standard Python tools
  2. Global Usage: Accessible as a command from anywhere after installation
  3. Better Maintainability: Proper package structure and dependency management
  4. Continuous Integration: Automated testing and linting
  5. Container Support: Production-ready Docker configuration
  6. Documentation: Clear instructions for installation and usage scenarios

Testing Done

  • Package installation tests with uv tool install
  • Command line functionality tests
  • Docker build and operation tests
  • CI workflow validation

How to Test

# Install globally with uv
uv tool install .

# Run the command from anywhere
tree-view /path/to/directory

# Or with Docker
docker build -t tree-view-cli .
docker run tree-view-cli /app

Screenshots

N/A - Command-line tool

Linked Issues

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant