Skip to content

Commit

Permalink
Better import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
techalchemy committed Mar 13, 2018
1 parent e672a80 commit ef27a6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 6 additions & 4 deletions pipenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import os
import sys


PIPENV_ROOT = os.path.dirname(os.path.realpath(__file__))
PIPENV_VENDOR = os.sep.join([PIPENV_ROOT, 'vendor'])
PIPENV_PATCHED = os.sep.join([PIPENV_ROOT, 'patched'])
# Inject vendored directory into system path.
v_path = os.path.abspath(os.path.sep.join([os.path.dirname(os.path.realpath(__file__)), 'vendor']))
sys.path.insert(0, v_path)
sys.path.insert(0, PIPENV_VENDOR)

# Inject patched directory into system path.
v_path = os.path.abspath(os.path.sep.join([os.path.dirname(os.path.realpath(__file__)), 'patched']))
sys.path.insert(0, v_path)
sys.path.insert(0, PIPENV_PATCHED)

from .cli import cli
from . import resolver
Expand Down
9 changes: 3 additions & 6 deletions pipenv/pew/__main__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import os
import sys

from ..pipenv import PIPENV_VENDOR, PIPENV_PATCHED
import pew

pipenv_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
pipenv_vendor = os.sep.join([pipenv_root, 'vendor'])
pipenv_patched = os.sep.join([pipenv_root, 'patched'])


if __name__ == '__main__':
sys.path.insert(0, pipenv_vendor)
sys.path.insert(0, pipenv_patched)
sys.path.insert(0, PIPENV_VENDOR)
sys.path.insert(0, PIPENV_PATCHED)
pew.pew.pew()

0 comments on commit ef27a6b

Please sign in to comment.