Skip to content

Commit

Permalink
Use ade at the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianonicolai committed Jan 23, 2024
1 parent cc251b9 commit aa0a89a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ By placing collections into the python site-packages directory they are discover
$ pip install ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ansible-dev-environment install -e .\[test] --venv venv
$ ade install -e .\[test] --venv venv
INFO: Found collection name: network.interfaces from /home/bthornto/github/network.interfaces/galaxy.yml.
INFO: Creating virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Virtual environment: /home/bthornto/github/network.interfaces/venv
Expand All @@ -44,7 +44,7 @@ source venv/bin/activate
### Tearing down the development environment

```
$ ansible-dev-environment uninstall ansible.scm
$ ade uninstall ansible.scm
INFO Found collection name: ansible.scm from /home/bthornto/github/ansible.scm/galaxy.yml.
INFO Requirements file /home/bthornto/github/ansible.scm/requirements.txt is empty, skipping
INFO Uninstalling python requirements from /home/bthornto/github/ansible.scm/test-requirements.txt
Expand All @@ -57,8 +57,8 @@ INFO Removed collection root: /home/bthornto/github/ansible.scm/venv/lib64/p

## Help

`ansible-dev-environment --help`
`ade --help`

`ansible-dev-environment install --help`
`ade install --help`

`ansible-dev-environment uninstall --help`
`ade uninstall --help`
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ By placing collections into the python site-packages directory they are discover
$ pip install ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ansible-dev-environment install -e .\[test] --venv venv
$ ade install -e .\[test] --venv venv
INFO: Found collection name: network.interfaces from /home/bthornto/github/network.interfaces/galaxy.yml.
INFO: Creating virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Virtual environment: /home/bthornto/github/network.interfaces/venv
Expand All @@ -44,7 +44,7 @@ source venv/bin/activate
### Tearing down the development environment

```
$ ansible-dev-environment uninstall ansible.scm
$ ade uninstall ansible.scm
INFO Found collection name: ansible.scm from /home/bthornto/github/ansible.scm/galaxy.yml.
INFO Requirements file /home/bthornto/github/ansible.scm/requirements.txt is empty, skipping
INFO Uninstalling python requirements from /home/bthornto/github/ansible.scm/test-requirements.txt
Expand All @@ -57,8 +57,8 @@ INFO Removed collection root: /home/bthornto/github/ansible.scm/venv/lib64/p

## Help

`ansible-dev-environment --help`
`ade --help`

`ansible-dev-environment install --help`
`ade install --help`

`ansible-dev-environment uninstall --help`
`ade uninstall --help`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ readme = "README.md"
requires-python = ">=3.10"

[project.scripts]
ansible-dev-environment = "ansible_dev_environment.cli:main"
ade = "ansible_dev_environment.cli:main"

[project.urls]
changelog = "https://github.com/ansible/ansible-dev-environment/releases"
Expand Down
4 changes: 2 additions & 2 deletions src/ansible_dev_environment/subcommands/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _collection_deps(self: Checker) -> None: # noqa: C901, PLR0912, PLR0915
f" {dep} {version} but it is not installed."
)
self._output.error(err)
msg = f"Try running `ansible-dev-environment install {dep}`"
msg = f"Try running `ade install {dep}`"
self._output.hint(msg)
missing = True

Expand All @@ -136,7 +136,7 @@ def _python_deps(self: Checker) -> None:
if self._system_dep_missing:
msg = "System packages are missing. Python dependency checking may fail."
self._output.warning(msg)
msg = "Install system packages and re-run `ansible-dev-environment check`."
msg = "Install system packages and re-run `ade check`."

Check warning on line 139 in src/ansible_dev_environment/subcommands/checker.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_dev_environment/subcommands/checker.py#L139

Added line #L139 was not covered by tests
self._output.hint(msg)
missing_file = self._config.venv_cache_dir / "pip-report.txt"
command = (
Expand Down
20 changes: 10 additions & 10 deletions tests/integration/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_venv(
monkeypatch.setattr(
"sys.argv",
[
"ansible-dev-environment",
"ade",
"install",
str(tmp_path / "cisco.nxos"),
"--venv=venv",
Expand All @@ -57,7 +57,7 @@ def test_venv(

monkeypatch.setattr(
"sys.argv",
["ansible-dev-environment", "list", "--venv=venv"],
["ade", "list", "--venv=venv"],
)
with pytest.raises(SystemExit):
main()
Expand All @@ -70,7 +70,7 @@ def test_venv(
monkeypatch.setattr(
"sys.argv",
[
"ansible-dev-environment",
"ade",
"uninstall",
"ansible.utils",
"--venv=venv",
Expand All @@ -83,7 +83,7 @@ def test_venv(

monkeypatch.setattr(
"sys.argv",
["ansible-dev-environment", "inspect", "--venv=venv", "--no-ansi"],
["ade", "inspect", "--venv=venv", "--no-ansi"],
)
with pytest.raises(SystemExit):
main()
Expand All @@ -95,7 +95,7 @@ def test_venv(

monkeypatch.setattr(
"sys.argv",
["ansible-dev-environment", "check", "--venv=venv"],
["ade", "check", "--venv=venv"],
)
with pytest.raises(SystemExit):
main()
Expand All @@ -112,7 +112,7 @@ def test_non_local(
monkeypatch.setattr(
"sys.argv",
[
"ansible-dev-environment",
"ade",
"install",
"ansible.scm",
f"--venv={tmp_path / 'venv'}",
Expand All @@ -125,7 +125,7 @@ def test_non_local(
assert string in captured.out
monkeypatch.setattr(
"sys.argv",
["ansible-dev-environment", "tree", f"--venv={tmp_path / 'venv'}"],
["ade", "tree", f"--venv={tmp_path / 'venv'}"],
)
with pytest.raises(SystemExit):
main()
Expand All @@ -147,7 +147,7 @@ def test_requirements(
monkeypatch.setattr(
"sys.argv",
[
"ansible-dev-environment",
"ade",
"install",
f"--venv={tmp_path / 'venv'}",
"-r",
Expand All @@ -162,7 +162,7 @@ def test_requirements(
monkeypatch.setattr(
"sys.argv",
[
"ansible-dev-environment",
"ade",
"uninstall",
f"--venv={tmp_path / 'venv'}",
"-r",
Expand All @@ -179,7 +179,7 @@ def test_requirements(

monkeypatch.setattr(
"sys.argv",
["ansible-dev-environment", "list", f"--venv={tmp_path / 'venv'}"],
["ade", "list", f"--venv={tmp_path / 'venv'}"],
)
with pytest.raises(SystemExit):
main()
Expand Down

0 comments on commit aa0a89a

Please sign in to comment.