This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
488 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
MIT License | ||
MIT License | ||
|
||
Copyright (c) 2019 Gram | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice (including the next | ||
paragraph) shall be included in all copies or substantial portions of the | ||
Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
# ![DepHell](./assets/logo.png) | ||
|
||
Dependency resolution for Python. | ||
**DepHell** -- dependency management for Python. | ||
|
||
+ Manage dependencies: convert between formats, install, lock, resolve conflicts. | ||
+ Manage virtual environments: create, remove, run shell, run commands inside. | ||
+ Install CLI tools into isolated environments. | ||
+ Build packages (to upload on PyPI). | ||
+ Discover licenses of all project dependencies. | ||
+ Generate .editorconfig, LICENSE, AUTHORS. | ||
|
||
## Installation | ||
|
||
```bash | ||
sudo pip3 install dephell | ||
``` | ||
|
||
## Python lib usage | ||
|
||
```python | ||
from dephell import PIPConverter, Requirement | ||
|
||
loader = PIPConverter(lock=False) | ||
resolver = loader.load_resolver(path='requirements.in') | ||
|
||
resolver.resolve() | ||
reqs = Requirement.from_graph(resolver.graph, lock=True) | ||
|
||
dumper = PIPConverter(lock=True) | ||
dumper.dump(reqs=reqs, path='requirements.txt') | ||
python3 -m pip install --user dephell | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# autocomplete | ||
# dephell autocomplete | ||
|
||
Enable dephell autocompletion for current shell. Supported shells: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# build | ||
# dephell build | ||
|
||
Build package for project: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# dephell deps install | ||
|
||
Install project dependencies. | ||
|
||
Dependencies from `to` option will be used if available. This is because when you specified in config file source dependencies in `from` and locked dependencies in `to` then, of course, you want to install dependencies from lock file. However, if `to` (and `to-format` and `to-file`) isn't specified in the config and CLI arguments then `from` will be used. | ||
|
||
Place to install lookup: | ||
|
||
1. If some virtual environment already active in the current shell then this environment will be used. | ||
1. If virtual environment for current project and environment exists then this virtual environment will be used. This is the reason why you have to [create virtual environment](cmd-venv-create) before dependencies installation. | ||
1. If virtual environment isn't found then your current python will be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# dephell deps licenses | ||
|
||
This command shows license for all your project's dependencies (from `from` section of current environment) in JSON format. Dephell detects the same license described in the different ways, like "MIT" and "MIT License", and combine these dependencies together. Dephell shows licenses **for all project's dependencies** including dependencies of dependencies. | ||
|
||
```bash | ||
$ dephell deps licenses | ||
|
||
INFO resolved | ||
{ | ||
"Apache-2.0": [ | ||
"aiofiles", | ||
"aiohttp", | ||
... | ||
], | ||
... | ||
"Python Software Foundation License": [ | ||
"backports-weakref", | ||
"editorconfig", | ||
"typing", | ||
"typing-extensions" | ||
], | ||
} | ||
``` | ||
|
||
If you want to process this JSON to other tool disable dephell's helping output with `--level` and `--silent` arguments: | ||
|
||
```bash | ||
$ dephell deps licenses --level=WARNING --silent | jq --compact-output '."Apache-2.0"' | ||
["aiofiles","aiohttp",...] | ||
``` | ||
|
||
This example uses [jq](https://stedolan.github.io/jq/) to filter only one license from output. However, for simple filtering by license name you can just pass this name as positional argument in the command: | ||
|
||
```bash | ||
$ dephell deps licenses Apache-2.0 | ||
|
||
INFO resolved | ||
[ | ||
"aiofiles", | ||
"aiohttp", | ||
... | ||
] | ||
``` | ||
|
||
## More info | ||
|
||
1. [How dephell works with config and parameters](config) | ||
1. [Full list of config parameters](params) | ||
1. [Example of this command usage](use-licenses) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# dephell generate authors | ||
|
||
This command looks into your git commits history, get list of all contributors, removes duplicates by e-mail and saves it into `AUTHORS` file. | ||
|
||
```bash | ||
$ dephell generate authors | ||
``` | ||
|
||
Easy :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# dephell generate config | ||
|
||
This command scans project directory for known dependencies files, try to combine them into known most common combinations like `Pipfile + Pipfile.lock` and makes dephell config for them. | ||
|
||
```bash | ||
$ dephell generate config | ||
``` | ||
|
||
Good for quick start. | ||
|
||
## More info | ||
|
||
1. [How dephell works with config and parameters](config) | ||
1. [Full list of config parameters](params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# dephell inspect config | ||
|
||
Shows current dephell config options. You can combine it with different arguments to inspect dephell behavior. | ||
|
||
## Show all config | ||
|
||
```bash | ||
$ dephell inspect config | ||
{ | ||
"bin": "/home/gram/.local/bin", | ||
"bitbucket": "https://api.bitbucket.org/2.0", | ||
"cache": { | ||
"path": "/home/gram/.local/share/dephell/cache", | ||
"ttl": 3600 | ||
}, | ||
"envs": [ | ||
"main" | ||
], | ||
... | ||
"warehouse": "https://pypi.org/pypi/" | ||
} | ||
``` | ||
|
||
## Filter output | ||
|
||
Show one section: | ||
|
||
```bash | ||
$ dephell inspect config from | ||
{ | ||
"format": "poetry", | ||
"path": "pyproject.toml" | ||
} | ||
|
||
``` | ||
|
||
Show one value: | ||
|
||
```bash | ||
$ dephell inspect config from-format | ||
poetry | ||
|
||
$ dephell inspect config warehouse | ||
https://pypi.org/pypi/ | ||
``` | ||
|
||
## Combine it with arguments | ||
|
||
```bash | ||
$ dephell inspect config --from-path=lol from | ||
{ | ||
"format": "poetry", | ||
"path": "lol" | ||
} | ||
|
||
$ dephell inspect config --from=setup.py from | ||
{ | ||
"format": "setuppy", | ||
"path": "setup.py" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# dephell venv create | ||
|
||
Create virtual environment for current project and environment. |
Oops, something went wrong.