-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move python deps in
setup.py
+ add install-pydeps-test|dev
make t…
…argets (#651) Add ``make install-pydeps-test`` and ``make install-pydeps-dev`` targets. They can be used to install dependencies meant for running tests and for local development. They can also be installed via ``pip install .[test]`` and ``pip install .[dev]``. Also move python deps from Makefile into setup.py.
- Loading branch information
Showing
6 changed files
with
189 additions
and
125 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
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,58 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>. | ||
# Use of this source code is governed by MIT license that can be | ||
# found in the LICENSE file. | ||
|
||
import sys | ||
|
||
|
||
try: | ||
import pip # noqa: F401 | ||
except ImportError: | ||
pass | ||
else: | ||
print("pip already installed") | ||
sys.exit(0) | ||
|
||
import os | ||
import ssl | ||
import tempfile | ||
|
||
|
||
PY3 = sys.version_info[0] >= 3 | ||
if PY3: | ||
from urllib.request import urlopen | ||
|
||
URL = "https://bootstrap.pypa.io/get-pip.py" | ||
|
||
else: | ||
from urllib2 import urlopen | ||
|
||
URL = "https://bootstrap.pypa.io/pip/2.7/get-pip.py" | ||
|
||
|
||
def main(): | ||
ssl_context = ( | ||
ssl._create_unverified_context() | ||
if hasattr(ssl, "_create_unverified_context") | ||
else None | ||
) | ||
with tempfile.NamedTemporaryFile(suffix=".py") as f: | ||
print("downloading %s into %s" % (URL, f.name)) | ||
kwargs = dict(context=ssl_context) if ssl_context else {} | ||
req = urlopen(URL, **kwargs) | ||
data = req.read() | ||
req.close() | ||
|
||
f.write(data) | ||
f.flush() | ||
print("download finished, installing pip") | ||
|
||
code = os.system("%s %s --user --upgrade" % (sys.executable, f.name)) | ||
|
||
sys.exit(code) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.