Skip to content

Commit e6da569

Browse files
committed
pants-plugins/pack_metadata: include Markdown files
1 parent 161c641 commit e6da569

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pants-plugins/pack_metadata/python_rules/python_pack_content_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
((PackContentResourceTypes.pack_config_schema,), 4, "config.schema.yaml"),
3737
((PackContentResourceTypes.pack_config_example,), 4, "config.yaml.example"),
3838
((PackContentResourceTypes.pack_icon,), 4, "icon.png"),
39+
((PackContentResourceTypes.pack_doc,), 1, ".md"),
3940
((PackContentResourceTypes.action_metadata,), 5, ".yaml"),
4041
((PackContentResourceTypes.sensor_metadata,), 1, ".yaml"),
4142
((PackContentResourceTypes.rule_metadata,), 0, ""),

pants-plugins/pack_metadata/target_types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class PackContentResourceTypes(Enum):
4343
pack_config_schema = "pack_config_schema"
4444
pack_config_example = "pack_config_example"
4545
pack_icon = "pack_icon"
46+
pack_doc = "pack_doc"
4647
# in subdirectory (see _content_type_by_path_parts below
4748
action_metadata = "action_metadata"
4849
action_chain_workflow = "action_chain_workflow"
@@ -86,6 +87,8 @@ def compute_value(
8687
if value is not None:
8788
return PackContentResourceTypes(value)
8889
path = PurePath(address.relative_file_path)
90+
if path.suffix == ".md":
91+
return PackContentResourceTypes.pack_doc
8992
_yaml_suffixes = (".yaml", ".yml")
9093
if len(path.parent.parts) == 0:
9194
# in the pack root
@@ -123,8 +126,7 @@ class PackMetadataSourcesField(ResourcesGeneratingSourcesField):
123126
"**/*.yml",
124127
"icon.png", # used in st2web ui
125128
# "requirements*.txt", # including this causes target conflicts
126-
# "README.md",
127-
# "HISTORY.md",
129+
"**/*.md", # including README.md, HISTORY.md
128130
# exclude yaml files under tests
129131
"!tests/**/*.yml",
130132
"!tests/**/*.yaml",

0 commit comments

Comments
 (0)