mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
real fix for #725
This commit is contained in:
+2
-2
@@ -1688,7 +1688,7 @@ def install(
|
||||
|
||||
if requirements:
|
||||
click.echo(crayons.normal(u'Requirements file provided! Importing into Pipfile…', bold=True), err=True)
|
||||
import_requirements(r=requirements, dev=dev)
|
||||
import_requirements(r=project.path_to(requirements), dev=dev)
|
||||
|
||||
if code:
|
||||
click.echo(crayons.normal(u'Discovering imports from local codebase…', bold=True))
|
||||
@@ -2127,7 +2127,7 @@ def check(three=None, python=False, unused=False, style=False, args=None):
|
||||
args = []
|
||||
|
||||
if style:
|
||||
sys.argv = ['magic', style] + list(args)
|
||||
sys.argv = ['magic', project.path_to(style)] + list(args)
|
||||
flake8.main.cli.main()
|
||||
exit()
|
||||
|
||||
|
||||
+10
-3
@@ -35,18 +35,25 @@ class Project(object):
|
||||
self._proper_names_location = None
|
||||
self._pipfile_location = None
|
||||
self._requirements_location = None
|
||||
self._original_dir = None
|
||||
|
||||
# Hack to skip this during pipenv run, or -r.
|
||||
if (
|
||||
('run' not in sys.argv) or
|
||||
('-r' not in sys.argv) or
|
||||
('--requirements' not in sys.argv)
|
||||
('run' not in sys.argv)
|
||||
):
|
||||
try:
|
||||
self._original_dir = os.path.abspath(os.curdir)
|
||||
os.chdir(self.project_directory)
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
|
||||
def path_to(self, p):
|
||||
"""Returns the absolute path to a given relative path."""
|
||||
if os.path.isabs(p):
|
||||
return p
|
||||
|
||||
return os.sep.join([self._original_dir, p])
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
if self._name is None:
|
||||
|
||||
Reference in New Issue
Block a user