Skip to content

Commit

Permalink
Merge pull request #487 from heitorPB/pack-readme
Browse files Browse the repository at this point in the history
build: add README.md by default
  • Loading branch information
Chris Patterson authored and facundobatista committed Aug 12, 2021
1 parent eb727cf commit 673b324
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions charmcraft/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"mod",
"LICENSE",
"icon.svg",
"README.md",
]


Expand Down
12 changes: 12 additions & 0 deletions tests/commands/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def basic_project(tmp_path):
icon = tmp_path / "icon.svg"
icon.write_text("icon content")

# README
readme = tmp_path / "README.md"
readme.write_text("README content")

yield tmp_path


Expand Down Expand Up @@ -537,6 +541,7 @@ def test_build_basic_complete_structure(basic_project, caplog, monkeypatch, conf
assert zf.read("lib/ops/stuff.txt") == b"ops stuff"
assert zf.read("LICENSE") == b"license content"
assert zf.read("icon.svg") == b"icon content"
assert zf.read("README.md") == b"README content"

# check the manifest is present and with particular values that depend on given info
manifest = yaml.safe_load(zf.read("manifest.yaml"))
Expand Down Expand Up @@ -1354,6 +1359,7 @@ def test_build_entrypoint_from_parts(basic_project, monkeypatch, caplog):
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "my_entrypoint.py",
"charm-requirements": ["reqs.txt"],
Expand Down Expand Up @@ -1424,6 +1430,7 @@ def test_build_entrypoint_from_commandline(basic_project, monkeypatch, caplog):
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "my_entrypoint.py",
"charm-requirements": ["reqs.txt"],
Expand Down Expand Up @@ -1490,6 +1497,7 @@ def test_build_entrypoint_default(basic_project, monkeypatch, caplog):
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "src/charm.py",
"charm-requirements": ["reqs.txt"],
Expand Down Expand Up @@ -1630,6 +1638,7 @@ def test_build_requirements_from_parts(basic_project, monkeypatch, caplog):
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "src/charm.py",
"charm-requirements": ["reqs.txt"],
Expand Down Expand Up @@ -1700,6 +1709,7 @@ def test_build_requirements_from_commandline(basic_project, monkeypatch, caplog)
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "src/charm.py",
"charm-requirements": ["reqs.txt"],
Expand Down Expand Up @@ -1770,6 +1780,7 @@ def test_build_requirements_default(basic_project, monkeypatch, caplog):
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "src/charm.py",
"charm-requirements": ["requirements.txt"],
Expand Down Expand Up @@ -1836,6 +1847,7 @@ def test_build_requirements_no_requirements_txt(basic_project, monkeypatch, capl
"lib",
"LICENSE",
"icon.svg",
"README.md",
],
"charm-entrypoint": "src/charm.py",
"charm-requirements": [],
Expand Down

0 comments on commit 673b324

Please sign in to comment.