From 617ef444192f11104ced88a9f8618e708c685b83 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 10:45:40 -0600 Subject: [PATCH 1/7] changed function name so it could be imported --- pipenv/help.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipenv/help.py b/pipenv/help.py index 0d06680d27..4f853266c7 100644 --- a/pipenv/help.py +++ b/pipenv/help.py @@ -16,8 +16,8 @@ def print_utf(line): print(line.encode('utf-8')) -def main(): - print('
$ python -m pipenv.help output') +def get_pipenv_diagnostics(): + print('
$ pipenv --support') print('') print('Pipenv version: `{0!r}`'.format(__version__)) print('') @@ -93,5 +93,5 @@ def main(): if __name__ == '__main__': - main() + get_pipenv_diagnostics() From fa967853f57b7ba3a7f1b98b8d7c64145cbf0a10 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 10:46:05 -0600 Subject: [PATCH 2/7] added cli option for --support --- pipenv/cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pipenv/cli.py b/pipenv/cli.py index bb41c103a5..16cd76c758 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -152,6 +152,11 @@ def validate_pypi_mirror(ctx, param, value): callback=validate_pypi_mirror, help="Specify a PyPI mirror.", ) +@option( + '--support', + is_flag=True, + help="Output diagnostic information for use in Github issues." +) @version_option( prog_name=crayons.normal('pipenv', bold=True), version=__version__ ) @@ -171,6 +176,7 @@ def cli( man=False, completion=False, pypi_mirror=None, + support=None ): if completion: # Handle this ASAP to make shell startup fast. from . import shells @@ -229,6 +235,10 @@ def cli( elif py: do_py() sys.exit() + elif support: + from .help import get_pipenv_diagnostics + get_pipenv_diagnostics() + sys.exit(0) # --venv was passed... elif venv: # There is no virtualenv yet. From 4cb677ac02ac726ca7517110f21f4f95ee64dbff Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 10:47:49 -0600 Subject: [PATCH 3/7] add news fragment for feature 2477 --- news/2477.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2477.feature diff --git a/news/2477.feature b/news/2477.feature new file mode 100644 index 0000000000..0b433bcec5 --- /dev/null +++ b/news/2477.feature @@ -0,0 +1 @@ +Added new flag `pipenv --support` to replace the diagnostic command `python -m pipenv.help`. \ No newline at end of file From 7048bcb786d8658b8e2996c38150a80772e3aff2 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sat, 30 Jun 2018 01:30:53 +0800 Subject: [PATCH 4/7] Update issue templates --- .github/ISSUE_TEMPLATE.md | 22 +++++--- .github/ISSUE_TEMPLATE/Bug_report.md | 66 +++++++++++++---------- .github/ISSUE_TEMPLATE/Custom.md | 29 +++++++--- .github/ISSUE_TEMPLATE/Feature_request.md | 40 ++++++++------ 4 files changed, 97 insertions(+), 60 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 10506bc01e..b232655538 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,14 +1,10 @@ Be sure to check the existing issues (both open and closed!). -Describe the issue briefly here. - -Please run `$ python -m pipenv.help`, and paste the results here. - -If you're on MacOS, just run the following: +------------ - $ python -m pipenv.help | pbcopy +##### Issue description ------------- +Describe the issue briefly here. ##### Expected result @@ -21,3 +17,15 @@ When possible, provide the verbose output (`--verbose`), especially for locking ##### Steps to replicate Provide the steps to replicate (which usually at least includes the commands and the Pipfile). + +------------- + +Please run `$ pipenv --support`, and paste the results here. Don't put backticks (`` ` ``) around it! The output already contains Markdown formatting. + +If you're on macOS, run the following: + + $ pipenv --support | pbcopy + +If you're on Windows, run the following: + + > pipenv --support | clip diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 03aa41a1b2..c6b478765a 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -1,29 +1,37 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Be sure to check the existing issues (both open and closed!). - -Describe the issue briefly here. - -Please run `$ python -m pipenv.help`, and paste the results here. - -If you're on MacOS, just run the following: - - $ python -m pipenv.help | pbcopy - ------------- - -##### Expected result - -Describe what you expected. - -##### Actual result - -When possible, provide the verbose output (`--verbose`), especially for locking and dependencies resolving issues. - -##### Steps to replicate - -Provide the steps to replicate (which usually at least includes the commands and the Pipfile). +--- +name: Bug report +about: Create a report to help us improve + +--- + +Be sure to check the existing issues (both open and closed!). + +------------ + +##### Issue description + +Describe the issue briefly here. + +##### Expected result + +Describe what you expected. + +##### Actual result + +When possible, provide the verbose output (`--verbose`), especially for locking and dependencies resolving issues. + +##### Steps to replicate + +Provide the steps to replicate (which usually at least includes the commands and the Pipfile). + +------------- + +Please run `$ pipenv --support`, and paste the results here. Don't put backticks (`` ` ``) around it! The output already contains Markdown formatting. + +If you're on macOS, run the following: + + $ pipenv --support | pbcopy + +If you're on Windows, run the following: + + > pipenv --support | clip diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md index d31ed75eaf..5166a09e62 100644 --- a/.github/ISSUE_TEMPLATE/Custom.md +++ b/.github/ISSUE_TEMPLATE/Custom.md @@ -1,7 +1,22 @@ ---- -name: Usage / Requests for Help -about: Requests for assistance or general usage guidance. - ---- - -Please refer to our [StackOverflow tag](https://stackoverflow.com/questions/tagged/pipenv) for more information. +--- +name: Usage / Requests for Help +about: Requests for assistance or general usage guidance. + +--- + +Please refer to our [StackOverflow tag](https://stackoverflow.com/questions/tagged/pipenv) for more information. + +If Pipenv is not functioning as you would like it to, consider filing either a bug report, or a feature request instead. + + +------------- + +Please run `$ pipenv --support`, and paste the results here. Don't put backticks (`` ` ``) around it! The output already contains Markdown formatting. + +If you're on macOS, run the following: + + $ pipenv --support | pbcopy + +If you're on Windows, run the following: + + > pipenv --support | clip diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index 5384295126..4876c2a899 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -1,17 +1,23 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. +--- +name: Feature request +about: Suggest an idea for this project + +--- + +Be sure to check the existing issues (both open and closed!). + +##### Is your feature request related to a problem? Please describe. + +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +##### Describe the solution you'd like + +A clear and concise description of what you want to happen. + +##### Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered. + +##### Additional context + +Add any other context or screenshots about the feature request here. It may be a good idea to mention that platform and Python version you are on. From 58ceb0ccd380d767d0072634ac5dc652b00abb74 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 11:32:51 -0600 Subject: [PATCH 5/7] fix quotes for rst files --- news/2477.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/2477.feature b/news/2477.feature index 0b433bcec5..9276e1cbe2 100644 --- a/news/2477.feature +++ b/news/2477.feature @@ -1 +1 @@ -Added new flag `pipenv --support` to replace the diagnostic command `python -m pipenv.help`. \ No newline at end of file +Added new flag ``pipenv --support`` to replace the diagnostic command ``python -m pipenv.help``. \ No newline at end of file From 48970d901dbcc6b7a17479495bd61cd874dd15f4 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 11:33:37 -0600 Subject: [PATCH 6/7] new test for pipenv --support --- tests/integration/test_cli.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 56ae2210a4..a51095ce73 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -31,6 +31,12 @@ def test_pipenv_py(PipenvInstance): assert os.path.basename(python).startswith('python') +@pytest.mark.cli +def test_pipenv_support(PipenvInstance): + with PipenvInstance() as p: + assert p.pipenv('--support').out + + @pytest.mark.cli def test_pipenv_rm(PipenvInstance): with PipenvInstance() as p: From 1c2a6e229066fc9e3dfed10a3e7624653fd456d9 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 29 Jun 2018 11:35:54 -0600 Subject: [PATCH 7/7] comment --- pipenv/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pipenv/cli.py b/pipenv/cli.py index 16cd76c758..646cd0ac8c 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -235,6 +235,7 @@ def cli( elif py: do_py() sys.exit() + # --support was passed... elif support: from .help import get_pipenv_diagnostics get_pipenv_diagnostics()