Skip to content

Commit

Permalink
Rename project to ansible-development-environment
Browse files Browse the repository at this point in the history
Related: #59
  • Loading branch information
ssbarnea committed Nov 23, 2023
1 parent 86aa5cf commit 43b5298
Show file tree
Hide file tree
Showing 28 changed files with 143 additions and 81 deletions.
1 change: 0 additions & 1 deletion .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fqcn
levelname
levelno
netcommon
pip4a
reqs
setenv
specp
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ cython_debug/
# and should all have detailed explanations

# Version created and populated by setuptools_scm
/src/pip4a/_version.py
/src/ansible-development-environment/_version.py
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ repos:
- pytest
- pyyaml
- subprocess_tee
- setuptools
- tox

- repo: https://github.com/pre-commit/mirrors-mypy.git
Expand Down
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": "pip4a",
"module": "ansible_development_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 @@
# pip4a
# ansible-development-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 pip4a --user
$ pip install ansible-development-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ pip4a install -e .\[test] --venv venv
$ ansible-development-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

```
$ pip4a uninstall ansible.scm
$ ansible-development-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

`pip4a --help`
`ansible-development-environment --help`

`pip4a install --help`
`ansible-development-environment install --help`

`pip4a uninstall --help`
`ansible-development-environment uninstall --help`
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ dynamic = ["dependencies", "optional-dependencies", "version"]
keywords = ["ansible"]
license = {text = "GPL-3.0-only"}
maintainers = [{"email" = "bthornto@redhat.com", "name" = "Bradley Thornton"}]
name = "pip4a"
name = "ansible-development-environment"
readme = "README.md"
requires-python = ">=3.9"

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

[project.urls]
changelog = "https://github.com/cidrblock/pip4a/releases"
documentation = "https://pip4a.readthedocs.io/en/latest/"
homepage = "https://github.com/cidrblock/pip4a"
repository = "https://github.com/cidrblock/pip4a"
changelog = "https://github.com/cidrblock/ansible-development-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"

[tool.mypy]
files = ["src", "tests"]
Expand Down Expand Up @@ -261,7 +261,7 @@ optional-dependencies.test = {file = [".config/requirements-test.txt"]}

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

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

from .cli import main


if __name__ == "__main__":
main()
17 changes: 17 additions & 0 deletions src/ansible_development_environment/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Union

VERSION_TUPLE = tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = "0.2.18.dev2"
__version_tuple__ = version_tuple = (0, 2, 18, "dev2")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
try:
import pkg_resources

__version__ = pkg_resources.get_distribution("pip4a").version
__version__ = pkg_resources.get_distribution(
"ansible_development_environment",
).version
except Exception: # pylint: disable=broad-except # noqa: BLE001
# this is the fallback SemVer version picked by setuptools_scm when tag
# information is not available.
Expand All @@ -31,7 +33,7 @@ def common_args(parser: ArgumentParser) -> None:
"--lf",
"--log-file <file>",
dest="log_file",
default=str(Path.cwd() / "pip4a.log"),
default=str(Path.cwd() / "ansible-development-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 pip4a import subcommands
from ansible_development_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 pip4a."""
"""Constants, for now, for ansible-development-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 / ".pip4a"
cache_dir = self.venv / ".ansible-development-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("pip4a")
self.logger = logging.getLogger("ansible_development_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 pip4a."""
"""The subcommands module contains all the subcommands for ansible-development-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 pip4a.utils import (
from ansible_development_environment.utils import (
builder_introspect,
collect_manifests,
oxford_join,
Expand All @@ -19,8 +19,8 @@


if TYPE_CHECKING:
from pip4a.config import Config
from pip4a.output import Output
from ansible_development_environment.config import Config
from ansible_development_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 `pip4a install {dep}`"
msg = f"Try running `ansible-development-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 `pip4a check`."
msg = "Install system packages and re-run `ansible-development-environment check`."
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 pip4a.utils import collect_manifests
from ansible_development_environment.utils import collect_manifests


if TYPE_CHECKING:
from pip4a.config import Config
from pip4a.output import Output
from ansible_development_environment.config import Config
from ansible_development_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,8 +9,11 @@
from pathlib import Path
from typing import TYPE_CHECKING

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


if TYPE_CHECKING:
from pip4a.config import Config
from pip4a.output import Output
from ansible_development_environment.config import Config
from ansible_development_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 pip4a."""
"""Lister module for ansible-development-environment."""

from __future__ import annotations

from typing import TYPE_CHECKING

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


if TYPE_CHECKING:
from pip4a.config import Config
from pip4a.output import Output
from ansible_development_environment.config import Config
from ansible_development_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, Union

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


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

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

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


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


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

This file was deleted.

Loading

0 comments on commit 43b5298

Please sign in to comment.