https://github.com/luisholanda/ppm
The Python Package Manager
https://github.com/luisholanda/ppm
python python-3 python-3-6 python3 pythonpm
Last synced: 3 months ago
JSON representation
The Python Package Manager
- Host: GitHub
- URL: https://github.com/luisholanda/ppm
- Owner: luisholanda
- License: gpl-3.0
- Created: 2017-02-07T11:18:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T00:13:21.000Z (over 9 years ago)
- Last Synced: 2024-10-11T09:12:02.780Z (over 1 year ago)
- Topics: python, python-3, python-3-6, python3, pythonpm
- Language: Python
- Size: 60.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Package Manager
[](https://badge.fury.io/py/pythonpm)
[](https://travis-ci.org/luisholanda/ppm)
Main repository of Python Package Manager (a.k.a ppm), based in npm and yarn from node.
ppm makes project sharing and isolation more easy, using only a `json` file (named `pyckage.json`) to store
the information about your project (name, repository url, dependencies, keywords) like
in Node.js.
It's also create a .ppm.info file to store some information about the modules,
like name of egg_info and dist_info.
### Why?
Because the package handling in Python is too damn difficult. pip does a good job installing
packages, but when we want to make a isolated project, we have to deal with `venv` or others
virtual environments utilities and others stuffs.
When I learn node, my first impression about npm was: "This is so much easy that pip".
So I decided to make a program that was equivalent to npm (more close to yarn if you ask me).
### Features
- Initialize project folders
- Install project dependencies without a requirement file
- Run scripts
- Start your project script
### TODO
- Make a version handling for packages installations.
- Make a package search command.
- Make a show command.
- Think in more commands.
- Remove the pip requirement for the `add` command.
#### Obs about subprocess module
**_This is only need if you will create another python instance from your script_**
If you will use `subprocess` module, you will need to pass the env argument when you will create a new subprocess:
```python
import subprocess.Popen
from ppm.utils import set_env
...
env = set_env()
# Any other modifications of environment variables
...
process = subprocess.Popen(..., env=env, ...)
```
If you don't pass the env argument, the `PYTHONPATH` environment variable will not be set correctly in the subprocess.
More precisely, any class/function that create another python instance will need this fix, sadly, I don't know how to
fix this (someone?).
### Commands
1. **Init**
```
ppm {init, i} [-h]
```
Initialize a python module template and a `pyckage.json` with some basic information that are asked to
the user.
The module template is:
```
┬ module_name
│ ├ __init__.py
│ └ __main__.py
└ entry_point.py
```
Where `module_name` and `entry_point` values are asked.
2. **Add**
```
ppm {add, a} [-h] [-g] [--add] []
```
Install `` in a folder named `python_modules` that will store all
modules that you install with ppm.
If the flag `--add` is passed, the modules will be added to the `dependencies`
field in `pyckage.json`.
You can use the `-g` flag to install the packages globally.
3. **Remove**
```
ppm {remove, rm} [-h] [-g]
```
Removes a ppm installed package.
Like the `add` command, you can use the `-g` flag to remove globally installed packages.
4. **Run**
```
ppm run [-h]
```
Runs a script that must be specified in `pyckage.json`.
5. **Start**
```
ppm {start, st} [-h]
```
Same thing that the `run` command, but only runs the `start` command.