Giter Site home page Giter Site logo

kgritesh / pip-save Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 3.0 22 KB

(Deprecated) A wrapper around pip that when called with an argument --save, stores the requested package with correct version to a requirement.txt file if it exist.

License: ISC License

Python 84.64% Makefile 15.36%

pip-save's Introduction

pip-save

DEPREACATED

I no longer use/support this library. A much better approach to solve this problem is now available at pipenv. Strongly recommend to try that out


pip-save is a simple wrapper around pip so as to add npm --save style functionality to pip.

Currently its a big pain while installing new dependencies using pip. After installing the dependency, you need to figure out the version number and then manually add it to your requirements file. pip-save allows you to install/uninstall any dependecy and automatically add/remove it to/from your requirements file using one command only.

Since its only a wrapper around pip install and uninstall commands, it accepts all options/config as these commands.

Installation

$ pip install pip-save

Usage

To Install a package and add it to your requirements.tx

$ pip-save install [<list of packages>]

To upgrade a package

$ pip-save install --upgrade [<list of packages>]

To uninstall a package and remove it from your requirements.txt

$ pip-save uninstall [<list of packages>]

To install a package from VCS and add it to your requirements file

$ pip-save install -e <url of the repo>

Configuration

For most users the default configuration of pip-save should be fine. If you do want to change pip-save's defaults you do so by adding configuration options to a configuration file. If a .pipconfig file exists in the current working directory, its automatically loaded.

Here is an example of available options along with their default values.

[pip-save]
requirements = requirements.txt
use_compatible = False
Configuration Options
  • requirements:- path to the requirements file to be used. Default value is requirements.txt Can be overwritten by using command line option -r or --requirement

  • use_compatible:- whether to use compatible version specifier instead of exact versions. Default value is False. Can be overwritten by using command line flag --use-compatible

pip-save's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pip-save's Issues

support local install

I'd like to install my packages locally similar to pip install --user <package-name>.

Not Working in Python 3.6

Not sure if this is intended, but keep getting this error when running pip-save:

Traceback (most recent call last):
  File "/Users/faraz/.pyenv/versions/3.6.2/lib/python3.6/configparser.py", line 1138, in _unify_values
    sectiondict = self._sections[section]
KeyError: 'pip-save'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/sepsis-watch-3.6/bin/pip-save", line 11, in <module>
    load_entry_point('pip-save==0.2.0', 'console_scripts', 'pip-save')()
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/sepsis-watch-3.6/lib/python3.6/site-packages/pip_save/cli.py", line 177, in main
    config_dict = parse_config()
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/sepsis-watch-3.6/lib/python3.6/site-packages/pip_save/cli.py", line 46, in parse_config
    config_dict['requirement'] = config.get('pip-save', 'requirement')
  File "/Users/faraz/.pyenv/versions/3.6.2/lib/python3.6/configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "/Users/faraz/.pyenv/versions/3.6.2/lib/python3.6/configparser.py", line 1141, in _unify_values
    raise NoSectionError(section)
configparser.NoSectionError: No section: 'pip-save'

ModuleNotFoundError: No module named 'pip.req' when installing any module

>pip-save install discord.py[voice] 
Traceback (most recent call last):
  File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\allie\AppData\Roaming\Python\Python38\Scripts\pip-save.exe\__main__.py", line 4, in <module>
  File "C:\Users\allie\AppData\Roaming\Python\Python38\site-packages\pip_save\cli.py", line 13, in <module>
    from pip.req import InstallRequirement
ModuleNotFoundError: No module named 'pip.req'

specify python version

I'd like to specify which python version pip-save should use. My default python version is 2.7, but I'd like to use python3. I have a similar alias python2, pip2 and pip3. Hence, I can easily run both python versions. I'm missing something like pip2-save and pip3-save.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.