Skip to content

Commit 2b8ab53

Browse files
authored
Rename (#2)
1 parent a381e9f commit 2b8ab53

18 files changed

+324
-23
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.coverage
2-
changedifferently.egg-info
32
coverage.xml
43
dist
54
htmlcov
5+
stackdiff.egg-info

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
3-
"changedifferently"
3+
"epilog",
4+
"stackdiff"
45
]
56
}

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include changedifferently/version/VERSION
1+
include stackdiff/version/VERSION

Pipfile

+6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7+
ansiscape = "~=1.0"
8+
boto3 = "~=1.18"
9+
differently = "==1.0.0a6"
10+
tabulate = "~=0.8"
711

812
[dev-packages]
913
black = "==21.9b0"
14+
boto3-stubs = {extras = ["cloudformation"], version = "*"}
1015
flake8 = "*"
1116
isort = "*"
1217
mypy = "*"
1318
pytest = "*"
1419
pytest-cov = "*"
1520
twine = "*"
21+
types-tabulate = "~=0.8"
1622
shellcheck-py = "*"
1723
yamllint = "*"
1824

Pipfile.lock

+158-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# changedifferently
2-
Visualises the changes described by an Amazon Web Services CloudFormation change set
1+
# stackdiff
2+
3+
Visualises the changes described by an Amazon Web Services CloudFormation stack change set

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
version="-1.-1.-1"
1111
fi
1212

13-
echo "${version}" > changedifferently/version/VERSION
13+
echo "${version}" > stackdiff/version/VERSION
1414
rm -rf dist
1515
python setup.py bdist_wheel
1616
rm -rf build

lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ else
1818
fi
1919

2020
flake8 .
21-
mypy changedifferently
21+
mypy stackdiff
2222
mypy tests

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ profile = 'black'
66
skip = '.venv'
77

88
[tool.pytest.ini_options]
9-
addopts = '--cov=changedifferently --cov-branch --cov-report=html --cov-report=term-missing:skip-covered --cov-report=xml --no-cov-on-fail'
9+
addopts = '--cov=stackdiff --cov-branch --cov-report=html --cov-report=term-missing:skip-covered --cov-report=xml --no-cov-on-fail'
1010
log_cli = 1
1111
testpaths = 'tests'

setup.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup # pyright: reportMissingTypeStubs=false
44

5-
from changedifferently.version import get_version
5+
from stackdiff.version import get_version
66

77
readme_path = Path(__file__).parent / "README.md"
88

@@ -36,21 +36,26 @@
3636
author="Cariad Eccleston",
3737
author_email="[email protected]",
3838
classifiers=classifiers,
39-
description="Visualises the changes described by an Amazon Web Services CloudFormation change set",
39+
description="Visualises the changes described by an Amazon Web Services CloudFormation stack change set",
40+
entry_points={
41+
"console_scripts": [
42+
"stackdiff=stackdiff.__main__:cli_entry",
43+
],
44+
},
4045
include_package_data=True,
4146
license="MIT",
4247
long_description=long_description,
4348
long_description_content_type="text/markdown",
44-
name="changedifferently",
49+
name="stackdiff",
4550
packages=[
46-
"changedifferently",
47-
"changedifferently.version",
51+
"stackdiff",
52+
"stackdiff.version",
4853
],
4954
package_data={
50-
"changedifferently": ["py.typed"],
51-
"changedifferently.version": ["py.typed"],
55+
"stackdiff": ["py.typed"],
56+
"stackdiff.version": ["py.typed"],
5257
},
5358
python_requires=">=3.8",
54-
url="https://github.com/cariad/changedifferently",
59+
url="https://github.com/cariad/stackdiff",
5560
version=version,
5661
)
File renamed without changes.

stackdiff/__main__.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from argparse import ArgumentParser
2+
from sys import stdout
3+
4+
from boto3.session import Session
5+
6+
from stackdiff.stack_diff import StackDiff
7+
from stackdiff.version import get_version
8+
9+
10+
def cli_entry() -> None:
11+
parser = ArgumentParser(
12+
description="Visualises the changes described by an Amazon Web Services CloudFormation stack change set.",
13+
epilog="Made with love by Cariad Eccleston: https://github.com/cariad/stackdiff",
14+
)
15+
16+
parser.add_argument("--change", help="change set ARN, ID or name")
17+
parser.add_argument("--stack", help="stack ARN, ID or name")
18+
parser.add_argument("--version", action="store_true", help="print the version")
19+
20+
args = parser.parse_args()
21+
22+
if args.version:
23+
print(get_version())
24+
exit(0)
25+
26+
cs = StackDiff(change=args.change, session=Session(), stack=args.stack)
27+
cs.render_differences(stdout)
28+
cs.render_changes(stdout)
29+
30+
31+
if __name__ == "__main__":
32+
cli_entry()
File renamed without changes.

0 commit comments

Comments
 (0)