Skip to content

Commit

Permalink
Rename project to ansible-dev-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianonicolai committed Jan 22, 2024
1 parent 145ed55 commit 95a6210
Show file tree
Hide file tree
Showing 26 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ cython_debug/
# and should all have detailed explanations

# Version created and populated by setuptools_scm
/src/ansible_development_environment/_version.py
/src/ansible_dev_environment/_version.py

.DS_Store
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "ansible_development_environment",
"module": "ansible_dev_environment",
"args": ["inspect", "-v", "-v", "-vv"],
"justMyCode": true
},
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ansible-development-environment
# ansible-dev-environment

A pip-like install for ansible collections.

Expand All @@ -19,10 +19,10 @@ By placing collections into the python site-packages directory they are discover
### Setting up a development environment

```
$ pip install ansible-development-environment --user
$ pip install ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ansible-development-environment install -e .\[test] --venv venv
$ ansible-dev-environment 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-development-environment uninstall ansible.scm
$ ansible-dev-environment 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-development-environment --help`
`ansible-dev-environment --help`

`ansible-development-environment install --help`
`ansible-dev-environment install --help`

`ansible-development-environment uninstall --help`
`ansible-dev-environment uninstall --help`
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ By placing collections into the python site-packages directory they are discover
### Setting up a development environment

```
$ pip install ansible-development-environment --user
$ pip install ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ansible-development-environment install -e .\[test] --venv venv
$ ansible-dev-environment 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-development-environment uninstall ansible.scm
$ ansible-dev-environment 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-development-environment --help`
`ansible-dev-environment --help`

`ansible-development-environment install --help`
`ansible-dev-environment install --help`

`ansible-development-environment uninstall --help`
`ansible-dev-environment uninstall --help`
10 changes: 5 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
site_name: Ansible Development Environment Documentation
site_url: https://ansible.readthedocs.io/projects/development-environment/
repo_url: https://github.com/ansible/ansible-development-environment
repo_url: https://github.com/ansible/ansible-dev-environment
edit_uri: blob/main/docs/
copyright: Copyright © 2023 Red Hat, Inc.
docs_dir: docs
Expand All @@ -22,10 +22,10 @@ theme:
extra:
social:
- icon: fontawesome/brands/python
link: https://pypi.org/project/ansible-development-environment/
link: https://pypi.org/project/ansible-dev-environment/
name: PyPI
- icon: fontawesome/solid/scroll
link: https://github.com/ansible/ansible-development-environment/releases
link: https://github.com/ansible/ansible-dev-environment/releases
name: Releases
- icon: simple/mastodon
link: https://fosstodon.org/@ansible
Expand All @@ -34,10 +34,10 @@ extra:
link: https://matrix.to/#/#devtools:ansible.com
name: Matrix
- icon: fontawesome/solid/comments
link: https://github.com/ansible/ansible-development-environment/discussions
link: https://github.com/ansible/ansible-dev-environment/discussions
name: Discussions
- icon: fontawesome/brands/github-alt
link: https://github.com/ansible/ansible-development-environment
link: https://github.com/ansible/ansible-dev-environment
name: GitHub

nav:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ dynamic = ["dependencies", "optional-dependencies", "version"]
keywords = ["ansible"]
license = {text = "GPL-3.0-only"}
maintainers = [{"email" = "bthornto@redhat.com", "name" = "Bradley Thornton"}]
name = "ansible-development-environment"
name = "ansible-dev-environment"
readme = "README.md"
requires-python = ">=3.10"

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

[project.urls]
changelog = "https://github.com/cidrblock/ansible-development-environment/releases"
changelog = "https://github.com/cidrblock/ansible-dev-environment/releases"
documentation = "https://ansible.readthedocs.io/projects/development-environment/"
homepage = "https://github.com/ansible/ansible-development-environment"
repository = "https://github.com/ansible/ansible-development-environment"
homepage = "https://github.com/ansible/ansible-dev-environment"
repository = "https://github.com/ansible/ansible-dev-environment"

[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:", "pragma: no cover"]
Expand Down Expand Up @@ -282,7 +282,7 @@ optional-dependencies.test = {file = [".config/requirements-test.in"]}

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/ansible_development_environment/_version.py"
write_to = "src/ansible_dev_environment/_version.py"

[tool.tomlsort]
all = true
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions src/ansible_dev_environment/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""A runpy entry point for ansible-dev-environment.
This makes it possible to invoke CLI
via :command:`python -m ansible_dev_environment`.
"""

from .cli import main

Check warning on line 7 in src/ansible_dev_environment/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_dev_environment/__main__.py#L7

Added line #L7 was not covered by tests


if __name__ == "__main__":
main()

Check warning on line 11 in src/ansible_dev_environment/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_dev_environment/__main__.py#L10-L11

Added lines #L10 - L11 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pkg_resources

__version__ = pkg_resources.get_distribution(
"ansible_development_environment",
"ansible_dev_environment",
).version
except Exception: # pylint: disable=broad-except # noqa: BLE001
# this is the fallback SemVer version picked by setuptools_scm when tag
Expand All @@ -33,7 +33,7 @@ def common_args(parser: ArgumentParser) -> None:
"--lf",
"--log-file <file>",
dest="log_file",
default=str(Path.cwd() / "ansible-development-environment.log"),
default=str(Path.cwd() / "ansible-dev-environment.log"),
help="Log file to write to.",
)
parser.add_argument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path
from typing import TYPE_CHECKING

from ansible_development_environment import subcommands
from ansible_dev_environment import subcommands

from .arg_parser import parse
from .config import Config
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Constants, for now, for ansible-development-environment."""
"""Constants, for now, for ansible-dev-environment."""

from __future__ import annotations

Expand Down Expand Up @@ -51,7 +51,7 @@ def init(self: Config) -> None:
@property
def cache_dir(self: Config) -> Path:
"""Return the cache directory."""
cache_dir = self.venv / ".ansible-development-environment"
cache_dir = self.venv / ".ansible-dev-environment"
if not cache_dir.exists():
cache_dir.mkdir(parents=True)
return cache_dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __init__( # noqa: PLR0913
"warning": 0,
}
self.term_features = term_features
self.logger = logging.getLogger("ansible_development_environment")
self.logger = logging.getLogger("ansible_dev_environment")
if log_level != "notset":
self.logger.setLevel(log_level.upper())
self.log_to_file = bool(log_file)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""The subcommands module contains all the subcommands for ansible-development-environment."""
"""The subcommands module contains all the subcommands for ansible-dev-environment."""

# ruff: noqa: F401

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from packaging.specifiers import InvalidSpecifier, SpecifierSet
from packaging.version import Version

from ansible_development_environment.utils import (
from ansible_dev_environment.utils import (
builder_introspect,
collect_manifests,
oxford_join,
Expand All @@ -19,8 +19,8 @@


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output


class Checker:
Expand Down 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-development-environment install {dep}`"
msg = f"Try running `ansible-dev-environment 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-development-environment check`."
msg = "Install system packages and re-run `ansible-dev-environment 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

from typing import TYPE_CHECKING

from ansible_development_environment.utils import collect_manifests
from ansible_dev_environment.utils import collect_manifests


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output

try:
from pip._vendor.rich import print_json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from pathlib import Path
from typing import TYPE_CHECKING

from ansible_development_environment.collection import (
from ansible_dev_environment.collection import (
Collection,
parse_collection_request,
)
from ansible_development_environment.utils import (
from ansible_dev_environment.utils import (
builder_introspect,
collections_from_requirements,
oxford_join,
Expand All @@ -24,8 +24,8 @@


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output


class Installer:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Lister module for ansible-development-environment."""
"""Lister module for ansible-dev-environment."""

from __future__ import annotations

from typing import TYPE_CHECKING

from ansible_development_environment.utils import collect_manifests, term_link
from ansible_dev_environment.utils import collect_manifests, term_link


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output


class Lister:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

from typing import TYPE_CHECKING

from ansible_development_environment.tree import Tree
from ansible_development_environment.utils import builder_introspect, collect_manifests
from ansible_dev_environment.tree import Tree
from ansible_dev_environment.utils import builder_introspect, collect_manifests


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output

ScalarVal = bool | str | float | int | None
JSONVal = ScalarVal | list["JSONVal"] | dict[str, "JSONVal"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
from pathlib import Path
from typing import TYPE_CHECKING

from ansible_development_environment.collection import (
from ansible_dev_environment.collection import (
Collection,
parse_collection_request,
)
from ansible_development_environment.utils import collections_from_requirements
from ansible_dev_environment.utils import collections_from_requirements


if TYPE_CHECKING:
from ansible_development_environment.config import Config
from ansible_development_environment.output import Output
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output


class UnInstaller:
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions src/ansible_development_environment/__main__.py

This file was deleted.

Loading

0 comments on commit 95a6210

Please sign in to comment.