mirror of
https://github.com/pacnpal/pip-add.git
synced 2025-12-20 04:01:05 -05:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24fa3971bf | ||
|
|
7ee17f6479 | ||
|
|
330bc93df6 | ||
|
|
7712950aed | ||
|
|
40b618f97f | ||
|
|
6f125da2cb | ||
|
|
228ff8aae9 | ||
|
|
99cfafa3fa | ||
|
|
ee077907e8 | ||
|
|
141c6c8294 | ||
|
|
d780ea9092 | ||
|
|
a81a56a55a | ||
|
|
6019d260fc | ||
|
|
5672586ce0 | ||
|
|
e046250444 | ||
|
|
78e4b463f9 | ||
|
|
08be12c63e | ||
|
|
ec082f4174 | ||
|
|
fd44299f11 | ||
|
|
5047dc8093 | ||
|
|
7092c203f9 | ||
|
|
7292393eec | ||
|
|
af517b1283 | ||
|
|
e821ca9ec4 | ||
|
|
854c784eab | ||
|
|
5d6c25a50e | ||
|
|
1067ba9529 | ||
|
|
b6fe7168c9 | ||
|
|
b41794765c | ||
|
|
0d507f79f0 | ||
|
|
252aa284f2 |
7
.deepsource.toml
Normal file
7
.deepsource.toml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version = 1
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "python"
|
||||||
|
|
||||||
|
[analyzers.meta]
|
||||||
|
runtime_version = "3.x.x"
|
||||||
34
.github/workflows/claude-review.yml
vendored
Normal file
34
.github/workflows/claude-review.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Claude Code Review
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Run on new/updated PRs
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
|
# Allow manual triggers for existing PRs
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
pr_number:
|
||||||
|
description: 'Pull Request Number'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
code-review:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run Claude Review
|
||||||
|
uses: pacnpal/claude-code-review@v1.0.6
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
anthropic-key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
pr-number: ${{ github.event.pull_request.number || inputs.pr_number }}
|
||||||
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@@ -25,6 +25,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install build
|
pip install build
|
||||||
|
- name: Run Pytest tests
|
||||||
|
run: |
|
||||||
|
pip install pytest pytest-cov
|
||||||
|
pytest --cov --cov-report=xml
|
||||||
|
- name: Upload coverage reports to Codecov
|
||||||
|
uses: codecov/codecov-action@v5
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: python -m build
|
run: python -m build
|
||||||
|
|||||||
41
.github/workflows/python-multiversion.yml
vendored
Normal file
41
.github/workflows/python-multiversion.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||||
|
|
||||||
|
name: Python test for 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install flake8 pytest
|
||||||
|
python -m pip install .
|
||||||
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
|
- name: Lint with flake8
|
||||||
|
run: |
|
||||||
|
# stop the build if there are Python syntax errors or undefined names
|
||||||
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
|
- name: Test with pytest
|
||||||
|
run: |
|
||||||
|
pytest
|
||||||
37
.github/workflows/python-tests.yml
vendored
Normal file
37
.github/workflows/python-tests.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Python pytest and upload to Codecov
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install .
|
||||||
|
pip install pytest pytest-cov
|
||||||
|
- name: Run coverage & upload to Codecov
|
||||||
|
run: |
|
||||||
|
pytest --cov --cov-report=xml
|
||||||
|
- name: Upload results to Codecov
|
||||||
|
uses: codecov/codecov-action@v5
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
- name: Run pytest tests
|
||||||
|
run: |
|
||||||
|
pytest --cov --junitxml=junit.xml -o junit_family=legacy
|
||||||
|
- name: Upload test results to Codecov
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
uses: codecov/test-results-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
113
README.md
113
README.md
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
A command-line tool that combines package installation and requirements.txt management. Install, update, or remove Python packages and their dependencies with automatic requirements.txt handling.
|
A command-line tool that combines package installation and requirements.txt management. Install, update, or remove Python packages and their dependencies with automatic requirements.txt handling.
|
||||||
|
|
||||||
|
Compatible with Python 3.9, 3.10, 3.11, 3.12, and 3.13.
|
||||||
|
|
||||||
|
[](https://codecov.io/gh/pacnpal/pip-add)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Single command for package management and requirements.txt updates
|
- Single command for package management and requirements.txt updates
|
||||||
@@ -12,10 +16,19 @@ A command-line tool that combines package installation and requirements.txt mana
|
|||||||
- Clean, informative output with version information
|
- Clean, informative output with version information
|
||||||
- Preserves requirements.txt comments and formatting
|
- Preserves requirements.txt comments and formatting
|
||||||
- Creates requirements.txt if it doesn't exist
|
- Creates requirements.txt if it doesn't exist
|
||||||
|
- Support for custom requirements file paths
|
||||||
|
- Smart detection of multiple requirements files
|
||||||
|
- Full support for Python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
It's recommended to install pip-add within a virtual environment to avoid conflicts with system packages:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Create and activate virtual environment
|
||||||
|
python -m venv venv
|
||||||
|
source venv/bin/activate # or `venv\Scripts\activate` on Windows
|
||||||
|
|
||||||
# Install from PyPI
|
# Install from PyPI
|
||||||
pip install pip-add
|
pip install pip-add
|
||||||
|
|
||||||
@@ -23,9 +36,16 @@ pip install pip-add
|
|||||||
pip install --upgrade pip-add
|
pip install --upgrade pip-add
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For global installation (use with caution), you can install with pipx:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install globally using pipx
|
||||||
|
pipx install pip-add
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Installation
|
### Package Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Basic package installation
|
# Basic package installation
|
||||||
@@ -50,6 +70,34 @@ pip-add -d requests
|
|||||||
# - requests (2.32.3)
|
# - requests (2.32.3)
|
||||||
# - urllib3 (2.2.3)
|
# - urllib3 (2.2.3)
|
||||||
# ✓ Updated requirements.txt
|
# ✓ Updated requirements.txt
|
||||||
|
|
||||||
|
# Install using custom requirements file
|
||||||
|
pip-add -f requirements/dev.txt requests
|
||||||
|
# Output:
|
||||||
|
# Installing requests...
|
||||||
|
# ✓ Successfully installed requests (2.32.3)
|
||||||
|
# ✓ Updated requirements/dev.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multiple Requirements Files
|
||||||
|
|
||||||
|
When multiple requirements files are found in your project:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Tool will show available files:
|
||||||
|
pip-add requests
|
||||||
|
# Output:
|
||||||
|
# ℹ️ Found multiple requirements files:
|
||||||
|
# - requirements.txt
|
||||||
|
# - requirements/dev.txt
|
||||||
|
# - requirements/prod.txt
|
||||||
|
#
|
||||||
|
# Using: requirements.txt
|
||||||
|
# To use a specific file, run the command with -f/--requirements-file option:
|
||||||
|
# Example: pip-add -f requirements/dev.txt requests
|
||||||
|
|
||||||
|
# Specify which file to use:
|
||||||
|
pip-add -f requirements/dev.txt requests
|
||||||
```
|
```
|
||||||
|
|
||||||
### Removal
|
### Removal
|
||||||
@@ -76,12 +124,19 @@ pip-add -d -r requests
|
|||||||
# - idna (needed by: email-validator, cryptography)
|
# - idna (needed by: email-validator, cryptography)
|
||||||
#
|
#
|
||||||
# ✓ Updated requirements.txt
|
# ✓ Updated requirements.txt
|
||||||
|
|
||||||
|
# Remove from specific requirements file
|
||||||
|
pip-add -r -f requirements/dev.txt requests
|
||||||
|
# Output:
|
||||||
|
# Removing packages...
|
||||||
|
# ✓ Successfully uninstalled requests (2.32.3)
|
||||||
|
# ✓ Updated requirements/dev.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
## Command Line Options
|
## Command Line Options
|
||||||
|
|
||||||
```
|
```bash
|
||||||
pip-add [-h] [-d] [-e] [-r] package
|
pip-add [-h] [-d] [-e] [-r] [-f REQUIREMENTS_FILE] package
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
package Package to install or remove
|
package Package to install or remove
|
||||||
@@ -91,6 +146,8 @@ options:
|
|||||||
-d, --dependencies Include dependencies when installing or removing
|
-d, --dependencies Include dependencies when installing or removing
|
||||||
-e, --exact Use == instead of >= for version specification
|
-e, --exact Use == instead of >= for version specification
|
||||||
-r, --remove Remove package(s) and their entries from requirements.txt
|
-r, --remove Remove package(s) and their entries from requirements.txt
|
||||||
|
-f, --requirements-file
|
||||||
|
Path to custom requirements.txt file
|
||||||
```
|
```
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
@@ -100,7 +157,7 @@ options:
|
|||||||
1. Installs the specified package using pip
|
1. Installs the specified package using pip
|
||||||
2. Retrieves installed version information
|
2. Retrieves installed version information
|
||||||
3. With `-d`: tracks and installs all dependencies
|
3. With `-d`: tracks and installs all dependencies
|
||||||
4. Updates requirements.txt with new package(s)
|
4. Updates requirements.txt (or specified requirements file) with new package(s)
|
||||||
5. Uses `>=` by default or `==` with `-e` flag
|
5. Uses `>=` by default or `==` with `-e` flag
|
||||||
|
|
||||||
### Removal Process
|
### Removal Process
|
||||||
@@ -109,9 +166,21 @@ options:
|
|||||||
2. Identifies which dependencies are safe to remove
|
2. Identifies which dependencies are safe to remove
|
||||||
3. Checks if any dependencies are needed by other packages
|
3. Checks if any dependencies are needed by other packages
|
||||||
4. Safely removes unused packages
|
4. Safely removes unused packages
|
||||||
5. Updates requirements.txt
|
5. Updates requirements.txt (or specified requirements file)
|
||||||
6. Reports kept dependencies and their dependents
|
6. Reports kept dependencies and their dependents
|
||||||
|
|
||||||
|
### Requirements File Handling
|
||||||
|
|
||||||
|
1. By default, looks for requirements.txt in the current directory
|
||||||
|
2. Creates requirements.txt if it doesn't exist
|
||||||
|
3. With `-f`: uses specified requirements file path
|
||||||
|
4. Creates directories if needed for custom file paths
|
||||||
|
5. Preserves comments and formatting in existing files
|
||||||
|
6. When multiple files are found:
|
||||||
|
- Lists all available requirements files
|
||||||
|
- Shows which file will be used by default
|
||||||
|
- Provides example command to specify a particular file
|
||||||
|
|
||||||
## Safe Dependency Handling
|
## Safe Dependency Handling
|
||||||
|
|
||||||
The tool is designed to safely handle dependencies:
|
The tool is designed to safely handle dependencies:
|
||||||
@@ -123,35 +192,26 @@ The tool is designed to safely handle dependencies:
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Python 3.6+
|
- Python 3.11, 3.12, or 3.13
|
||||||
- pip
|
- pip
|
||||||
- setuptools
|
- setuptools
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Local Setup
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Clone the repository
|
|
||||||
git clone https://github.com/PacNPal/pip-add.git
|
|
||||||
cd pip-add
|
|
||||||
|
|
||||||
# Create virtual environment
|
|
||||||
python -m venv venv
|
|
||||||
source venv/bin/activate # or `venv\Scripts\activate` on Windows
|
|
||||||
|
|
||||||
# Install in development mode
|
|
||||||
pip install -e .
|
|
||||||
```
|
|
||||||
|
|
||||||
## Common Scenarios
|
## Common Scenarios
|
||||||
|
|
||||||
### New Project
|
### New Project
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# First time setup
|
# First time setup
|
||||||
|
pip-add flask
|
||||||
|
# Creates requirements.txt and adds Flask
|
||||||
|
|
||||||
pip-add -d flask
|
pip-add -d flask
|
||||||
# Creates requirements.txt and adds Flask with dependencies
|
# Creates requirements.txt and adds Flask with dependencies
|
||||||
|
|
||||||
|
# Multiple requirements files
|
||||||
|
pip-add -f requirements/dev.txt pytest
|
||||||
|
pip-add -f requirements/prod.txt gunicorn
|
||||||
|
# Manages separate requirement files for different environments
|
||||||
```
|
```
|
||||||
|
|
||||||
### Updating Dependencies
|
### Updating Dependencies
|
||||||
@@ -175,6 +235,7 @@ pip-add -d -r flask
|
|||||||
1. **Package not found in requirements.txt**
|
1. **Package not found in requirements.txt**
|
||||||
- The file will be created automatically
|
- The file will be created automatically
|
||||||
- Existing comments are preserved
|
- Existing comments are preserved
|
||||||
|
- Use `-f` to specify a different requirements file
|
||||||
|
|
||||||
2. **Dependency conflicts**
|
2. **Dependency conflicts**
|
||||||
- Uses `>=` by default to minimize conflicts
|
- Uses `>=` by default to minimize conflicts
|
||||||
@@ -183,3 +244,9 @@ pip-add -d -r flask
|
|||||||
3. **Dependencies not removing**
|
3. **Dependencies not removing**
|
||||||
- Check the output for dependencies kept
|
- Check the output for dependencies kept
|
||||||
- Tool will show which packages need them
|
- Tool will show which packages need them
|
||||||
|
|
||||||
|
4. **Multiple requirements files**
|
||||||
|
- Tool will list all available requirements files
|
||||||
|
- Shows which file will be used by default
|
||||||
|
- Provides example command to specify a particular file
|
||||||
|
- Use `-f` to specify which file to use
|
||||||
|
|||||||
@@ -4,14 +4,27 @@ import subprocess
|
|||||||
import pkg_resources
|
import pkg_resources
|
||||||
import argparse
|
import argparse
|
||||||
from pkg_resources import working_set
|
from pkg_resources import working_set
|
||||||
|
from .utils import find_requirements as utils_find_requirements
|
||||||
|
|
||||||
def find_requirements():
|
def find_requirements(custom_path=None):
|
||||||
"""Find requirements.txt in current directory or create it"""
|
"""Find requirements.txt using utils or use custom path"""
|
||||||
req_file = 'requirements.txt'
|
if custom_path:
|
||||||
|
# If custom path provided, ensure directory exists
|
||||||
|
os.makedirs(os.path.dirname(os.path.abspath(custom_path)), exist_ok=True)
|
||||||
|
if not os.path.exists(custom_path):
|
||||||
|
with open(custom_path, 'w') as f:
|
||||||
|
f.write('# Python dependencies\n')
|
||||||
|
return custom_path
|
||||||
|
|
||||||
if not os.path.exists(req_file):
|
# Use utils.find_requirements() to search for requirements files
|
||||||
with open(req_file, 'w') as f:
|
req_file, found_files = utils_find_requirements()
|
||||||
f.write('# Python dependencies\n')
|
if len(found_files) > 1:
|
||||||
|
print("\nℹ️ Found multiple requirements files:")
|
||||||
|
for f in found_files:
|
||||||
|
print(f" - {f}")
|
||||||
|
print(f"\nUsing: {req_file}")
|
||||||
|
print("To use a specific file, run the command with -f/--requirements-file option:")
|
||||||
|
print(f"Example: pip-add -f {found_files[0]} <package>")
|
||||||
|
|
||||||
return req_file
|
return req_file
|
||||||
|
|
||||||
@@ -168,10 +181,12 @@ def main():
|
|||||||
help='Use == instead of >= for version specification')
|
help='Use == instead of >= for version specification')
|
||||||
parser.add_argument('-r', '--remove', action='store_true',
|
parser.add_argument('-r', '--remove', action='store_true',
|
||||||
help='Remove package(s) and their entries from requirements.txt')
|
help='Remove package(s) and their entries from requirements.txt')
|
||||||
|
parser.add_argument('-f', '--requirements-file',
|
||||||
|
help='Path to custom requirements.txt file')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
package = args.package
|
package = args.package
|
||||||
req_file = find_requirements()
|
req_file = find_requirements(args.requirements_file)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if args.remove:
|
if args.remove:
|
||||||
@@ -235,4 +250,4 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
16
setup.py
16
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pip-add",
|
name="pip-add",
|
||||||
version="0.1.1",
|
version="0.2.5",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"pip",
|
"pip",
|
||||||
@@ -15,19 +15,29 @@ setup(
|
|||||||
},
|
},
|
||||||
author="PacNPal",
|
author="PacNPal",
|
||||||
author_email="pac@pacnp.al",
|
author_email="pac@pacnp.al",
|
||||||
description="A CLI tool to install packages and manage requirements.txt in one command",
|
description="A modern Python package manager that combines pip install with requirements.txt management. Supports Python 3.11, 3.12, and 3.13.",
|
||||||
long_description=open('README.md').read(),
|
long_description=open('README.md').read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
url="https://github.com/PacNPal/pip-add",
|
url="https://github.com/PacNPal/pip-add",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
|
"Environment :: Console",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
|
"Intended Audience :: Information Technology",
|
||||||
|
"Intended Audience :: System Administrators",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Natural Language :: English",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
"Programming Language :: Python :: 3.13",
|
"Programming Language :: Python :: 3.13",
|
||||||
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
|
"Topic :: System :: Installation/Setup",
|
||||||
|
"Topic :: System :: Software Distribution",
|
||||||
|
"Topic :: System :: Systems Administration",
|
||||||
|
"Topic :: Utilities",
|
||||||
],
|
],
|
||||||
python_requires=">=3.11",
|
python_requires=">=3.8",
|
||||||
)
|
)
|
||||||
|
|||||||
48
tests/test_cli.py
Normal file
48
tests/test_cli.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import pytest
|
||||||
|
from pip_add.cli import (
|
||||||
|
find_requirements,
|
||||||
|
get_package_dependencies,
|
||||||
|
find_dependent_packages,
|
||||||
|
analyze_dependencies,
|
||||||
|
remove_from_requirements,
|
||||||
|
add_to_requirements,
|
||||||
|
install_package,
|
||||||
|
uninstall_packages,
|
||||||
|
main
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_find_requirements():
|
||||||
|
# Add test cases for find_requirements
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_get_package_dependencies():
|
||||||
|
# Add test cases for get_package_dependencies
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_find_dependent_packages():
|
||||||
|
# Add test cases for find_dependent_packages
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_analyze_dependencies():
|
||||||
|
# Add test cases for analyze_dependencies
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_remove_from_requirements():
|
||||||
|
# Add test cases for remove_from_requirements
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_add_to_requirements():
|
||||||
|
# Add test cases for add_to_requirements
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_install_package():
|
||||||
|
# Add test cases for install_package
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_uninstall_packages():
|
||||||
|
# Add test cases for uninstall_packages
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_main():
|
||||||
|
# Add test cases for main
|
||||||
|
pass
|
||||||
10
tests/test_utils.py
Normal file
10
tests/test_utils.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import pytest
|
||||||
|
from pip_add.utils import find_requirements, add_to_requirements
|
||||||
|
|
||||||
|
def test_find_requirements():
|
||||||
|
# Add test cases for find_requirements
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_add_to_requirements():
|
||||||
|
# Add test cases for add_to_requirements
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user