Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #221 from dephell/improve-installer
Browse files Browse the repository at this point in the history
install dephell from current branch on TravisCI
  • Loading branch information
orsinium committed Jul 14, 2019
2 parents 0dcccdb + f91d579 commit 9add2ee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ before_install:
# install DepHell
# - curl https://raw.githubusercontent.com/dephell/dephell/master/install.py | /opt/python/3.6/bin/python
# https://github.com/travis-ci/travis-ci/issues/8589
- /opt/python/3.7/bin/python install.py
- /opt/python/3.7/bin/python install.py --branch=$TRAVIS_PULL_REQUEST_BRANCH
- dephell inspect self
install:
- dephell venv create --env=$ENV --python="/opt/python/$TRAVIS_PYTHON_VERSION/bin/python" --level=DEBUG --traceback
Expand Down
11 changes: 10 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Recommend way:
curl https://raw.githubusercontent.com/dephell/dephell/master/install.py | python3
```

It will install DepHell into DepHell's jail ([WE NEED TO GO DEEPER](https://knowyourmeme.com/memes/we-need-to-go-deeper)). However, this script experimental. So, in the project's README presented other way:
It will install DepHell into DepHell's jail ([WE NEED TO GO DEEPER](https://knowyourmeme.com/memes/we-need-to-go-deeper)). This link looks too long, so in the project's README represented another way:

```bash
python3 -m pip install --user dephell[full]
Expand All @@ -20,6 +20,15 @@ python3 -m pip install --user dephell

## Get development version

Install dev version inside of site-packages:

```bash
wget https://raw.githubusercontent.com/dephell/dephell/master/install.py
python3 install.py --branch=master
```

Or get whole project and teach Python to use it:

```bash
$ git clone https://github.com/dephell/dephell.git
$ cd dephell
Expand Down
17 changes: 16 additions & 1 deletion install.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# built-in
import subprocess
from argparse import ArgumentParser
from os import environ, pathsep
from pathlib import Path
from venv import create


# parse CLI arguments
parser = ArgumentParser()
parser.add_argument('--branch', help='install dephell from git from given branch')
parser.add_argument('--version', help='install specified version')
args = parser.parse_args()


# install pip
try:
import pip # noQA: F401
Expand Down Expand Up @@ -48,7 +56,14 @@ def get_data_dir() -> Path:


print('install dephell')
result = subprocess.run([str(python_path), '-m', 'pip', 'install', 'dephell[full]'])
if args.branch:
name = 'git+https://github.com/dephell/dephell.git@{branch}#egg=dephell[full]'
name = name.format(branch=args.version or args.branch)
elif args.version:
name = 'dephell[full]=={version}'.format(version=args.version)
else:
name = 'dephell[full]'
result = subprocess.run([str(python_path), '-m', 'pip', 'install', name])
if result.returncode != 0:
exit(result.returncode)

Expand Down

0 comments on commit 9add2ee

Please sign in to comment.