diff --git a/Contribute.md b/Contribute.md index 017039d..6b63e36 100644 --- a/Contribute.md +++ b/Contribute.md @@ -1,311 +1,185 @@ -# Contributing to archpkg-helper +# archpkg-helper -Thank you for your interest in contributing to **archpkg-helper**! 🎉 - -We welcome contributions of all kinds - whether you're fixing bugs, adding features, improving documentation, or helping with testing. This guide will help you get started and ensure your contributions can be reviewed and merged efficiently. +A cross-distro command-line utility that helps you search for packages and generate install commands for native package managers (pacman, AUR, apt, dnf, flatpak, snap). It aims to make discovering and installing software on Linux simpler, regardless of your distribution. ## Table of Contents -- [Code of Conduct](#code-of-conduct) -- [Getting Started](#getting-started) -- [Development Setup](#development-setup) -- [Making Contributions](#making-contributions) -- [Pull Request Process](#pull-request-process) -- [Coding Standards](#coding-standards) -- [Testing](#testing) -- [Documentation](#documentation) -- [Getting Help](#getting-help) - -## Code of Conduct - -By participating in this project, you agree to abide by our Code of Conduct. Please be respectful, inclusive, and constructive in all interactions. - -## Getting Started - -### Prerequisites - -- Python 3.6 or higher -- Git -- A GitHub account - -### First-Time Setup - -1. **Fork the repository** - - Visit the [archpkg-helper repository](https://github.com/AdmGenSameer/archpkg-helper) - - Click the "Fork" button to create your own copy - -2. **Clone your fork** - ```bash - git clone https://github.com/YOUR_USERNAME/archpkg-helper.git - cd archpkg-helper - ``` - -3. **Add upstream remote** - ```bash - git remote add upstream https://github.com/AdmGenSameer/archpkg-helper.git - ``` - -4. **Verify your setup** - ```bash - git remote -v - # Should show both origin (your fork) and upstream (original repo) - ``` - -## Development Setup - -### Environment Setup - -We recommend using `pipx` for development to avoid conflicts with system packages: - -1. **Install pipx** (if not already installed) - ```bash - # Arch Linux - sudo pacman -S pipx - pipx ensurepath - - # Ubuntu/Debian - sudo apt install pipx - pipx ensurepath - - # Fedora - sudo dnf install pipx - pipx ensurepath - ``` - -2. **Install in development mode** - ```bash - # For development with editable installation - pipx install -e . - - # Or using pip in user mode - python3 -m pip install --user -e . - ``` - -3. **Install system dependencies** - - Depending on your distribution: - - **Arch Linux/Manjaro:** - ```bash - # pacman is pre-installed - # Install AUR helper (optional but recommended for testing) - sudo pacman -S yay - # Install flatpak if needed - sudo pacman -S flatpak - ``` - - **Ubuntu/Debian:** - ```bash - sudo apt update - sudo apt install flatpak - ``` - - **Fedora:** - ```bash - sudo dnf install flatpak - ``` - -4. **Verify installation** - ```bash - archpkg --version - archpkg --help - ``` - -### Keeping Your Fork Updated - -Regularly sync your fork with the upstream repository: +- [About](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#about) +- [Features](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#features) +- [Quick Start (install.sh)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#quick-start-installsh) +- [Installation (Recommended: pipx)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#installation-recommended-pipx) +- [Alternative Installation (pip)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#alternative-installation-pip) +- [Usage](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#usage) +- [File Structure](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#file-structure) +- [Contributing](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#contributing) +- [License](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#license) -```bash -git fetch upstream -git checkout main -git merge upstream/main -git push origin main -``` +## About -## Making Contributions +archpkg-helper is designed to work across Linux distributions. While originally inspired by Arch Linux, it detects your system and generates appropriate install commands for common package managers. It's suitable for both newcomers and experienced users who want a simpler way to search and install packages. -### Types of Contributions +## Features -We welcome various types of contributions: +Search for packages and generate install commands for: +- pacman (Arch), AUR, apt (Debian/Ubuntu), dnf (Fedora), flatpak, snap +- Cross-distro support (not limited to Arch) +- Clear, readable output and errors +- One-command setup via install.sh -- **Bug fixes** - Fix issues or unexpected behavior -- **Feature additions** - Add new functionality -- **Documentation** - Improve README, add examples, or API docs -- **Testing** - Add or improve test coverage -- **Performance** - Optimize existing functionality -- **Refactoring** - Improve code structure without changing functionality +## Quick Start (install.sh) -### Before You Start +Install directly using the provided installer script. -1. **Check existing issues** - Look for related issues or feature requests -2. **Create an issue** - For significant changes, create an issue first to discuss your approach -3. **Start small** - Consider starting with small contributions to get familiar with the codebase +From a cloned repository: -### Branching Strategy +```bash +git clone https://github.com/AdmGenSameer/archpkg-helper.git +cd archpkg-helper +bash install.sh +``` -Create a new branch for each contribution: +Or run directly from the web: ```bash -git checkout main -git pull upstream main -git checkout -b your-branch-name +curl -fsSL https://raw.githubusercontent.com/AdmGenSameer/archpkg-helper/main/install.sh | bash +# or +wget -qO- https://raw.githubusercontent.com/AdmGenSameer/archpkg-helper/main/install.sh | bash ``` -**Branch naming conventions:** -- `feat/description` - New features -- `fix/description` - Bug fixes -- `docs/description` - Documentation changes -- `refactor/description` - Code refactoring -- `test/description` - Test additions/improvements -- `chore/description` - Maintenance tasks - -## Pull Request Process +Notes: -### Before Submitting +- The installer ensures Python, pip, and pipx are available and installs the CLI via pipx. +- You may be prompted for sudo to install prerequisites on your distro. -1. **Test your changes** - Ensure your code works as expected -2. **Update documentation** - Update README.md or relevant docs if needed -3. **Check code style** - Follow the coding standards (see below) -4. **Write meaningful commits** - Use clear, descriptive commit messages +## Installation (Recommended: pipx) -### Commit Message Guidelines +On Arch and many other distros, system Python may be "externally managed" (PEP 668), which prevents global pip installs. pipx installs Python CLIs into isolated environments and puts their executables on your PATH—this is the easiest, safest method. -We follow [Conventional Commits](https://www.conventionalcommits.org/) format: +### Install pipx +Arch Linux: +```bash +sudo pacman -S pipx +pipx ensurepath ``` -[optional scope]: - -[optional body] -[optional footer(s)] +Debian/Ubuntu: +```bash +sudo apt update +sudo apt install pipx +pipx ensurepath ``` -**Types:** -- `feat:` - New feature -- `fix:` - Bug fix -- `docs:` - Documentation only changes -- `style:` - Code style changes (formatting, semicolons, etc.) -- `refactor:` - Code changes that neither fix bugs nor add features -- `test:` - Adding or modifying tests -- `chore:` - Changes to build process or auxiliary tools - -### Submitting Your Pull Request - -1. **Push your branch** - ```bash - git push origin your-branch-name - ``` - -2. **Create Pull Request** - - Go to your fork on GitHub - - Click "New Pull Request" - - Select your branch - - Fill out the PR template with: - - Clear description of changes - - Link to related issues - - Testing details - - Screenshots (if applicable) - -3. **Respond to feedback** - - Address any review comments - - Make additional commits as needed - - Keep the conversation constructive +Fedora: +```bash +sudo dnf install pipx +pipx ensurepath +``` -## Coding Standards +### Install archpkg-helper with pipx -### Python Style +Directly from GitHub: +```bash +pipx install git+https://github.com/AdmGenSameer/archpkg-helper.git +``` -- Follow [PEP 8](https://peps.python.org/pep-0008/) Python style guide -- Use meaningful variable and function names -- Add docstrings to functions and classes -- Keep functions focused and small when possible +From a local clone: +```bash +git clone https://github.com/AdmGenSameer/archpkg-helper.git +cd archpkg-helper +pipx install . +``` -### Code Organization +Upgrade later with: -- Place new package managers in appropriate modules -- Follow the existing project structure -- Import statements should be organized (standard library, third-party, local) +```bash +pipx upgrade archpkg-helper +``` -### Error Handling +Ensure your shell session has pipx's bin path in PATH (pipx prints instructions after pipx ensurepath, typically ~/.local/bin). -- Use appropriate exception handling -- Provide clear error messages to users -- Log errors appropriately for debugging +## Alternative Installation (pip) -## Testing +If you prefer pip, install in user scope to avoid system conflicts: -### Running Tests +From a local clone: +```bash +git clone https://github.com/AdmGenSameer/archpkg-helper.git +cd archpkg-helper +python3 -m pip install --user . +``` +Directly from GitHub: ```bash -# Install test dependencies -pip install -e .[test] +python3 -m pip install --user git+https://github.com/AdmGenSameer/archpkg-helper.git +``` -# Run tests -python -m pytest +If your distro enforces PEP 668 protections for global installs, you may see errors. You can bypass with: -# Run with coverage -python -m pytest --cov=archpkg +```bash +python3 -m pip install --break-system-packages . ``` -### Writing Tests - -- Add tests for new features and bug fixes -- Use descriptive test names -- Test edge cases and error conditions -- Place tests in the `tests/` directory +However, using pipx is strongly recommended instead of breaking system protections. -### Manual Testing +## Usage -Test your changes across different scenarios: -- Different Linux distributions (if possible) -- Various package managers -- Edge cases (empty queries, network issues, etc.) +After installation, the CLI is available as archpkg. -## Documentation +Examples: -### Updating Documentation +```bash +# Search for a package across supported sources +archpkg search -- Update README.md for user-facing changes -- Add docstrings to new functions and classes -- Update help text for new CLI options -- Consider adding examples for complex features +# Generate install command(s) for a package +archpkg install -### Documentation Style +# Generate removal command(s) for a package +archpkg remove +``` -- Use clear, concise language -- Include practical examples -- Keep formatting consistent -- Verify all links work +Additional: -## Getting Help +```bash +archpkg --help +archpkg --version +``` -### Communication Channels +Replace with the package you want to manage. -- **GitHub Issues** - Bug reports, feature requests -- **GitHub Discussions** - Questions, ideas, general discussion -- **Pull Request Comments** - Code review discussions +## File Structure -### Questions and Support +Top-level layout of this repository: -Don't hesitate to ask questions! We're here to help: +``` +archpkg-helper/ +├── archpkg/ # Core Python package code (CLI and logic) +├── install.sh # One-command installer script (uses pipx) +├── pyproject.toml # Build/metadata configuration +├── setup.py # Packaging configuration (entry points, deps) +├── LICENSE # Project license (Apache 2.0) +├── README.md # Project documentation (this file) +├── build/ # Build artifacts (may appear after builds) +├── __pycache__/ # Python bytecode cache (auto-generated) +├── archpkg_helper.egg-info/ # Packaging metadata (auto-generated) +└── archpy.egg-info/ # Packaging metadata (auto-generated) +``` -1. Check existing issues and discussions first -2. Create a new issue for bugs or feature requests -3. Start a discussion for questions or ideas -4. Tag maintainers if you need specific guidance +Some metadata/build directories are generated during packaging and may not be present in fresh clones. -### Maintainer Response +## Contributing -We aim to: -- Acknowledge new issues within 48 hours -- Review pull requests within a week -- Provide constructive feedback -- Help contributors through the process +Contributions are welcome! Please: ---- +- Fork the repository +- Create a feature branch: git checkout -b feature-branch +- Make your changes and commit: git commit -m "Describe your changes" +- Push to your fork: git push origin feature-branch +- Open a Pull Request -Thank you for contributing to archpkg-helper! Your efforts help make package management easier for Linux users everywhere. +Report bugs or request features via the [issue tracker](https://github.com/AdmGenSameer/archpkg-helper/issues). -If you have any questions about this contributing guide or need help with your contribution, please don't hesitate to reach out through GitHub issues or discussions. +## License -Happy contributing! 🚀 \ No newline at end of file +This project is licensed under the [Apache License 2.0](https://github.com/AdmGenSameer/archpkg-helper/blob/main/LICENSE). \ No newline at end of file diff --git a/README.md b/README.md index 09d7b99..6df5fcd 100644 --- a/README.md +++ b/README.md @@ -1,121 +1,93 @@ -# archpkg-helper +# 🚀 archpkg-helper A cross-distro command-line utility that helps you search for packages and generate install commands for native package managers (pacman, AUR, apt, dnf, flatpak, snap). It aims to make discovering and installing software on Linux simpler, regardless of your distribution. -## Table of Contents +## 📑 Table of Contents -- [About](#about) -- [Features](#features) -- [Quick Start (install.sh)](#quick-start-installsh) -- [Installation (Recommended: pipx)](#installation-recommended-pipx) -- [Alternative Installation (pip)](#alternative-installation-pip) -- [Usage](#usage) -- [File Structure](#file-structure) -- [Contributing](#contributing) -- [License](#license) +- [🎯 About](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#about) +- [✨ Features](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#features) +- [⚡Quick Start (install.sh)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#quick-start-installsh) +- [📦 Installation (Recommended: pipx)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#installation-recommended-pipx) +- [🔧 Alternative Installation (pip)](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#alternative-installation-pip) +- [🎮 Usage](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#usage) +- [📁 File Structure](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#file-structure) +- [🤝 Contributing](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#contributing) +- [📄 License](https://github.com/AdmGenSameer/archpkg-helper?tab=readme-ov-file#license) -## About +## 🎯 About -archpkg-helper is designed to work across Linux distributions. While originally inspired by Arch Linux, it detects your system and generates appropriate install commands for common package managers. It’s suitable for both newcomers and experienced users who want a simpler way to search and install packages. +archpkg-helper is designed to work across Linux distributions. While originally inspired by Arch Linux, it detects your system and generates appropriate install commands for common package managers. It's suitable for both newcomers and experienced users who want a simpler way to search and install packages. -## Features +## ✨ Features -- Search for packages and generate install commands for: - - pacman (Arch), AUR, apt (Debian/Ubuntu), dnf (Fedora), flatpak, snap +Search for packages and generate install commands for: +- pacman (Arch), AUR, apt (Debian/Ubuntu), dnf (Fedora), flatpak, snap - Cross-distro support (not limited to Arch) - Clear, readable output and errors -- One-command setup via `install.sh` - -## Quick Start (install.sh) +- One-command setup via install.sh +⚡Quick Start (install.sh) Install directly using the provided installer script. From a cloned repository: -```sh + git clone https://github.com/AdmGenSameer/archpkg-helper.git cd archpkg-helper bash install.sh -``` +🌐 Or run directly from the web: -Or run directly from the web: -```sh curl -fsSL https://raw.githubusercontent.com/AdmGenSameer/archpkg-helper/main/install.sh | bash # or wget -qO- https://raw.githubusercontent.com/AdmGenSameer/archpkg-helper/main/install.sh | bash -``` - -Notes: -- The installer ensures Python, pip, and pipx are available and installs the CLI via pipx. -- You may be prompted for sudo to install prerequisites on your distro. - -## Installation (Recommended: pipx) +⚠️Notes: +The installer ensures Python, pip, and pipx are available and installs the CLI via pipx. +You may be prompted for sudo to install prerequisites on your distro. +📦 Installation (Recommended: pipx) On Arch and many other distros, system Python may be “externally managed” (PEP 668), which prevents global pip installs. pipx installs Python CLIs into isolated environments and puts their executables on your PATH—this is the easiest, safest method. -1) Install pipx -- Arch Linux: - ```sh - sudo pacman -S pipx - pipx ensurepath - ``` -- Debian/Ubuntu: - ```sh - sudo apt update - sudo apt install pipx - pipx ensurepath - ``` -- Fedora: - ```sh - sudo dnf install pipx - pipx ensurepath - ``` - -2) Install archpkg-helper with pipx -- Directly from GitHub: - ```sh - pipx install git+https://github.com/AdmGenSameer/archpkg-helper.git - ``` -- From a local clone: - ```sh - git clone https://github.com/AdmGenSameer/archpkg-helper.git - cd archpkg-helper - pipx install . - ``` - +Install pipx +Arch Linux: +sudo pacman -S pipx +pipx ensurepath +Debian/Ubuntu: +sudo apt update +sudo apt install pipx +pipx ensurepath +Fedora: +sudo dnf install pipx +pipx ensurepath +Install archpkg-helper with pipx +Directly from GitHub: +pipx install git+https://github.com/AdmGenSameer/archpkg-helper.git +From a local clone: +git clone https://github.com/AdmGenSameer/archpkg-helper.git +cd archpkg-helper +pipx install . Upgrade later with: -```sh -pipx upgrade archpkg-helper -``` -Ensure your shell session has pipx’s bin path in PATH (pipx prints instructions after `pipx ensurepath`, typically `~/.local/bin`). - -## Alternative Installation (pip) +pipx upgrade archpkg-helper +Ensure your shell session has pipx’s bin path in PATH (pipx prints instructions after pipx ensurepath, typically ~/.local/bin). +🔧Alternative Installation (pip) If you prefer pip, install in user scope to avoid system conflicts: -- From a local clone: - ```sh - git clone https://github.com/AdmGenSameer/archpkg-helper.git - cd archpkg-helper - python3 -m pip install --user . - ``` -- Directly from GitHub: - ```sh - python3 -m pip install --user git+https://github.com/AdmGenSameer/archpkg-helper.git - ``` - +From a local clone: +git clone https://github.com/AdmGenSameer/archpkg-helper.git +cd archpkg-helper +python3 -m pip install --user . +Directly from GitHub: +python3 -m pip install --user git+https://github.com/AdmGenSameer/archpkg-helper.git If your distro enforces PEP 668 protections for global installs, you may see errors. You can bypass with: -```sh + python3 -m pip install --break-system-packages . -``` However, using pipx is strongly recommended instead of breaking system protections. -## Usage - -After installation, the CLI is available as `archpkg`. +🎮 Usage +After installation, the CLI is available as archpkg. Examples: -```sh + # Search for a package across supported sources archpkg search @@ -124,19 +96,16 @@ archpkg install # Generate removal command(s) for a package archpkg remove -``` - Additional: -```sh + archpkg --help archpkg --version -``` +Replace with the package you want to manage. -Replace `` with the package you want to manage. - -## File Structure +## 📁File Structure Top-level layout of this repository: + ``` archpkg-helper/ ├── archpkg/ # Core Python package code (CLI and logic) @@ -151,19 +120,20 @@ archpkg-helper/ └── archpy.egg-info/ # Packaging metadata (auto-generated) ``` -Some metadata/build directories are generated during packaging and may not be present in fresh clones. +💡Some metadata/build directories are generated during packaging and may not be present in fresh clones. -## Contributing +## 🤝 Contributing Contributions are welcome! Please: -1. Fork the repository -2. Create a feature branch: `git checkout -b feature-branch` -3. Make your changes and commit: `git commit -m "Describe your changes"` -4. Push to your fork: `git push origin feature-branch` -5. Open a Pull Request + +- Fork the repository +- Create a feature branch: git checkout -b feature-branch +- Make your changes and commit: git commit -m "Describe your changes" +- Push to your fork: git push origin feature-branch +- Open a Pull Request Report bugs or request features via the [issue tracker](https://github.com/AdmGenSameer/archpkg-helper/issues). -## License +## 📄 License -This project is licensed under the [Apache License 2.0](./LICENSE). +This project is licensed under the [Apache License 2.0](https://github.com/AdmGenSameer/archpkg-helper/blob/main/LICENSE). \ No newline at end of file