Skip to content

Commit

Permalink
Fix pipfile creation with unnamed project
Browse files Browse the repository at this point in the history
- Fixes #3260

Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Nov 20, 2018
1 parent 206a59c commit f99de85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/3260.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue which sometimes prevented successful creation of project pipfiles.
1 change: 1 addition & 0 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ def create_pipfile(self, python=None):
ConfigOptionParser, make_option_group, index_group
)

name = self.name if self.name is not None else "Pipfile"
config_parser = ConfigOptionParser(name=self.name)
config_parser.add_option_group(make_option_group(index_group, config_parser))
install = config_parser.option_groups[0]
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/test_install_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,11 @@ def test_system_and_deploy_work(PipenvInstance, pypi):
)
c = p.pipenv("install --system")
assert c.return_code == 0


@pytest.mark.install
def test_install_creates_pipfile(PipenvInstance):
with PipenvInstance(chdir=True) as p:
c = p.pipenv("install")
assert c.return_code == 0
assert os.path.isfile(p.pipfile_path)

0 comments on commit f99de85

Please sign in to comment.