Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request: Refactor Codebase and Enhance CLI Functionality #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ABDELLAH-Hallou
Copy link

Summary

This pull request introduces structural changes to the Pip With Packages (pwp) , to enhance code organization, CLI functionality, and requirements management.

Changes

  1. Codebase Refactoring:
    • Created a new utils directory to house separated components.
    • Decomposed main.py into multiple, focused files:
      • pwp_manager.py: Manages the core package functionalities.
      • pwp_parser.py: Handles argument parsing and command processing.
      • requirements_manager.py: Manages package requirements.
  2. Functionality Enhancements:
    • Command Handling:
      • Updated install and uninstall functions to accept args and unknown_args, allowing for more flexible command-line usage.
      • Added support for specifying a custom requirements file with args.req_file.
      • Implemented functionality to pass unknown arguments to pip, facilitating advanced usage.
    • Requirements Management:
      • Replaced create_or_update_requirements with add_requirement and rm_requirement functions for more specialized handling.
      • Added get_package_version function to retrieve and track package versions using pip show.
    • Enhanced add_requirement and rm_requirement Functions:
      • add_requirement now supports version-specific entries and custom requirements file names.
  3. CLI Improvements:
    • Replaced basic argument parsing with argparse, for more robust CLI experience.
    • Added --req-file option to specify a custom requirements file.

Thank you for creating such a great package; it is truly a lifesaver!

- Added package versions to requirements.txt
- Implemented support for additional pip options
- Added functionality to handle custom requirements file names
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