Skip to content

Commit

Permalink
Refactor mpip to mmp module taken
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsocv12 committed Apr 25, 2021
1 parent 143878b commit dc7d6b3
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 28 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions mpip/cli/main.py → mmp/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def dispatch():
dispatcher = DocoptDispatcher(
TopLevelCommand, {
'options_first': True,
'version': get_version_info('mpip')
'version': get_version_info('mmp')
}
)
options, handler, command_options = dispatcher.parse(sys.argv[1:])
Expand All @@ -64,11 +64,11 @@ class TopLevelCommand:
'''Install and handle your pip dependencies fast and easy
usage:
mpip [options] [--] [COMMAND] [ARGS...]
mpip -h|--help
mmp [options] [--] [COMMAND] [ARGS...]
mmp -h|--help
Options:
-v, --version Shows mpip version
-v, --version Shows mmp version
Commands:
run Run python files with the environment modules
Expand Down Expand Up @@ -116,24 +116,24 @@ def install(self, options=None):
if not os.path.exists('requirements.txt'):
bcolors.printColor('FAIL', 'missing requirements.txt')
print('\nSUGGESTION: This command could help')
print(' $ mpip init')
print(' $ mmp init')
return
os.system("./pip_modules/bin/pip install -r requirements.txt")
bcolors.printColor('OKGREEN', 'Finish installation')

def init(self, options=None):
'''
Init the mpip environment
Init the mmp environment
For example:
$ mpip init
$ mmp init
By default, creates the virtualenv in pip_modules dir on the proyect
and a requirements.txt without any line on the requirements file
usage: init
'''
bcolors.printColor('HEADER', 'Initializing mpip')
bcolors.printColor('HEADER', 'Initializing mmp')
self.__check_virtual_env()
self.__check_requirements()
bcolors.printColor('OKGREEN', 'Finish init')
Expand All @@ -143,7 +143,7 @@ def uninstall(self, options=None):
Uninstall a lib from the pip_modules
For example:
$ mpip uninstall mpip
$ mmp uninstall mmp
usage: uninstall [COMMAND]
'''
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions mpip/cli/utils.py → mmp/cli/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import mpip
import mmp

def get_version_info(scope):
versioninfo = 'mpip version {}'.format(mpip.__version__)
versioninfo = 'mmp version {}'.format(mmp.__version__)

if scope == 'mpip':
if scope == 'mmp':
return versioninfo

raise ValueError("{} is not a valid version scope".format(scope))
23 changes: 13 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# mpip
# mmp

[![Python 3](https://img.shields.io/badge/python-3-blue.svg)](https://www.python.org/downloads/release/python-3)
[![Upload Python Package](https://github.com/alfonsocv12/mpip/actions/workflows/python-publish.yml/badge.svg)](https://github.com/alfonsocv12/mpip/actions/workflows/python-publish.yml)
[![Upload Python Package](https://github.com/alfonsocv12/mmp/actions/workflows/python-publish.yml/badge.svg)](https://github.com/alfonsocv12/mmp/actions/workflows/python-publish.yml)

This is a cli solution for an easier and faster way to handle you python modules
Module manager python is a cli solution for an easier and faster way to handle you python modules
with your projects.

I know that the name its wrong but mmp was taken by the time that i build this
solution.

## Inspiration

The inspiration and the goal to deliver its a similar way of handling node modules
Expand All @@ -14,35 +17,35 @@ into consideration the difference in use cases between both programming language

## Quickstart

To start using mpip, first install the program, at this early stages we just have
To start using PyMm, first install the program, at this early stages we just have
the installation by pip so its required for you to have that also the app just works
with python 3 and up so you need to use pip3 in the case that you have python 2 as
your default python version.

```bash
$ pip3 install mpip
$ pip3 install mmp
```

After you install the program, go to the proyect that you want to use mpip and
After you install the program, go to the proyect that you want to use mmp and
start installing dependencies with this simple command

```bash
$ mpip install [module_name]
$ mmp install [module_name]
```

To run your project/script its ass simple to use the run command, this command defaults
to a run.py file but you can specify the file that you want to run by adding the file
full name at the end like this

```bash
$ mpip run my_perfect_script.py
$ mmp run my_perfect_script.py
```

In the case that you want to know a little more off the commands that you can run
with the program just ask for help with the -h on every section of the program for
example.

```bash
$ mpip -h
$ mpip run -h
$ mmp -h
$ mmp run -h
```
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
import sys
import json

from mpip.cli.colors import bcolors
# from setuptools.command.install import install
from mmp.cli.colors import bcolors
from setuptools import find_packages
from setuptools import setup


setup(
name='mpip',
name='mmp',
version='0.0.1',
authro='Alfonso Villaobos',
author_email='[email protected]',
url='https://github.com/alfonsocv12/mpip',
url='https://github.com/alfonsocv12/mmp',
license='MIT',
description='mpip gives a faster way to handle pip librarys with a projects scope',
description='MMP gives a faster way to handle pip librarys with a projects scope',
packages=find_packages(exclude=['tests.*', 'tests']),
long_description=open('readme.md', 'r').read(),
long_description_content_type='text/markdown',
entry_points={
'console_scripts': ['mpip=mpip.cli.main:main']
'console_scripts': ['mmp=mmp.cli.main:main']
},
install_requires=[
'virtualenv>=20.4.4',
Expand Down

0 comments on commit dc7d6b3

Please sign in to comment.