Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #321 from dephell/mv-autocomplete
Browse files Browse the repository at this point in the history
Drop `other` category from docs
  • Loading branch information
orsinium committed Dec 17, 2019
2 parents ea37d7f + 903f650 commit a9edbec
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ First of all, install DepHell and activate autocomplete:

```bash
python3 -m pip install --user dephell[full]
dephell autocomplete
dephell self autocomplete
```

Let's get [sampleproject](https://github.com/pypa/sampleproject) and make it better.
Expand Down
5 changes: 2 additions & 3 deletions dephell/commands/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

# keep sorted
_NAMES = (
'auth',
'autocomplete',

'deps add',
'deps audit',
'deps check',
Expand Down Expand Up @@ -61,6 +58,8 @@
'project test',
'project validate',

'self auth',
'self autocomplete',
'self uncache',
'self upgrade',

Expand Down
7 changes: 2 additions & 5 deletions dephell/commands/auth.py → dephell/commands/self_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
from .base import BaseCommand


class AuthCommand(BaseCommand):
class SelfAuthCommand(BaseCommand):
"""Insert, update or delete credentials.
"""
_global_config_path = get_data_dir() / GLOBAL_CONFIG_NAME

@classmethod
def get_parser(cls) -> ArgumentParser:
parser = ArgumentParser(
prog='dephell auth',
description=cls.__doc__,
)
parser = cls._get_default_parser()
builders.build_config(parser)
builders.build_output(parser)
parser.add_argument('hostname', help='server hostname')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
from .base import BaseCommand


class AutocompleteCommand(BaseCommand):
class SelfAutocompleteCommand(BaseCommand):
"""Enable DepHell commands autocomplete for current shell.
"""

@classmethod
def get_parser(cls) -> ArgumentParser:
parser = ArgumentParser(
prog='dephell autocomplete',
description=cls.__doc__,
)
parser = cls._get_default_parser()
builders.build_config(parser)
builders.build_output(parser)
return parser
Expand Down
2 changes: 1 addition & 1 deletion dephell/templates/docker_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ python3 -m pip install -U pip
wget -O /tmp/install.py https://raw.githubusercontent.com/dephell/dephell/master/install.py
bash -c "python3 /tmp/install.py"
rm /tmp/install.py
# dephell autocomplete
# dephell self autocomplete
6 changes: 3 additions & 3 deletions docs/cmd-inspect-auth.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# dephell inspect auth

Shows all [added credentials](cmd-auth).
Shows all [added credentials](cmd-self-auth).

```bash
$ dephell auth example.com gram "p@ssword"
$ dephell self auth example.com gram "p@ssword"
INFO credentials added (hostname=example.com, username=gram)

$ dephell inspect auth
Expand All @@ -30,6 +30,6 @@ $ dephell inspect auth --filter="#.hostname+username.each()"

## See also

1. [dephell auth](cmd-auth) to add new credentials.
1. [dephell self auth](cmd-self-auth) to add new credentials.
1. [dephell inspect config](cmd-inspect-config) to show all other params in the config.
1. [Private PyPI repository](use-warehouse) usage details and examples.
2 changes: 1 addition & 1 deletion docs/cmd-inspect-self.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $ dephell inspect self

1. [dephell self uncache](cmd-self-uncache) to remove dephell cache.
1. [dephell self upgrade](cmd-self-upgrade) to upgrade dephell and dependencies to the latest version.
1. [dephell autocomplete](cmd-venv-create) to enable params autocomplete for commands in your shell.
1. [dephell self autocomplete](cmd-venv-create) to enable params autocomplete for commands in your shell.
1. [dephell inspect config](cmd-inspect-config) to get information about config parameters.
8 changes: 4 additions & 4 deletions docs/cmd-auth.md → docs/cmd-self-auth.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# dephell auth
# dephell self auth

Manage credentials: add, update, remove. These credentials are used for [Basic HTTP authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) for [custom PyPI repositories](https://www.python.org/dev/peps/pep-0503/).

Add new credentials:

```bash
$ dephell auth pypi.example.com my-useranme "my-p@ssword"
$ dephell self auth pypi.example.com my-useranme "my-p@ssword"
INFO credentials added (hostname=pypi.example.com, username=my-useranme)
```

Remove credentials for user:

```bash
$ dephell auth pypi.example.com my-useranme
$ dephell self auth pypi.example.com my-useranme
INFO credentials removed (hostname=pypi.example.com, username=my-useranme)
```

Remove credentials for all users for given hostname:

```bash
$ dephell auth pypi.example.com
$ dephell self auth pypi.example.com
INFO credentials removed (hostname=pypi.example.com, count=1)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/cmd-autocomplete.md → docs/cmd-self-autocomplete.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# dephell autocomplete
# dephell self autocomplete

Enable dephell autocompletion for current shell. Supported shells:

1. bash
1. zsh

This command generates shell script to achieve better suggestions performance. So, please, execute `dephell autocomplete` after DepHell update again.
This command generates shell script to achieve better suggestions performance. So, please, execute `dephell self autocomplete` after DepHell update again.
11 changes: 0 additions & 11 deletions docs/index-other.md

This file was deleted.

4 changes: 3 additions & 1 deletion docs/index-self.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# **self**: manage dephell

Commands to manage dephell installation: [upgrade to the latest version](cmd-self-upgrade), [clear cache](cmd-self-uncache).
Commands to manage dephell installation: [upgrade to the latest version](cmd-self-upgrade), [clear cache](cmd-self-uncache), [enable autocomplete](cmd-self-autocomplete), [add credentials](cmd-self-auth).

```eval_rst
.. toctree::
:maxdepth: 1
cmd-self-auth
cmd-self-autocomplete
cmd-self-uncache
cmd-self-upgrade
```
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ And that's it! Now you can use any tools with any Python project. Every other co
index-self
index-vendor
index-venv
index-other
.. toctree::
:maxdepth: 1
Expand Down
4 changes: 2 additions & 2 deletions docs/use-warehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ $ dephell inspect config --warehouse --filter="warehouse"

## Authentication

Use [dephell auth](cmd-auth) to add credentials for host in global config:
Use [dephell self auth](cmd-self-auth) to add credentials for host in global config:

```bash
$ dephell auth example.com gram "p@ssword"
$ dephell self auth example.com gram "p@ssword"
INFO credentials added (hostname=example.com, username=gram)
```

Expand Down

0 comments on commit a9edbec

Please sign in to comment.