Skip to content

Commit

Permalink
Merge pull request #2478 from pypa/feature/2477
Browse files Browse the repository at this point in the history
Feature/2477
Change python -m pipenv.help to pipenv --support
  • Loading branch information
erinxocon authored Jun 29, 2018
2 parents 4bb3262 + 898b1e9 commit 0c58080
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 63 deletions.
22 changes: 15 additions & 7 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
66 changes: 37 additions & 29 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -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
29 changes: 22 additions & 7 deletions .github/ISSUE_TEMPLATE/Custom.md
Original file line number Diff line number Diff line change
@@ -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
40 changes: 23 additions & 17 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions news/2477.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added new flag ``pipenv --support`` to replace the diagnostic command ``python -m pipenv.help``.
11 changes: 11 additions & 0 deletions pipenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
)
Expand All @@ -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
Expand Down Expand Up @@ -229,6 +235,11 @@ def cli(
elif py:
do_py()
sys.exit()
# --support was passed...
elif support:
from .help import get_pipenv_diagnostics
get_pipenv_diagnostics()
sys.exit(0)
# --venv was passed...
elif venv:
# There is no virtualenv yet.
Expand Down
6 changes: 3 additions & 3 deletions pipenv/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def print_utf(line):
print(line.encode('utf-8'))


def main():
print('<details><summary>$ python -m pipenv.help output</summary>')
def get_pipenv_diagnostics():
print('<details><summary>$ pipenv --support</summary>')
print('')
print('Pipenv version: `{0!r}`'.format(__version__))
print('')
Expand Down Expand Up @@ -93,5 +93,5 @@ def main():


if __name__ == '__main__':
main()
get_pipenv_diagnostics()

6 changes: 6 additions & 0 deletions tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0c58080

Please sign in to comment.