Skip to content

Commit

Permalink
Add a default skill map name and specify python 3.8 as the min versio…
Browse files Browse the repository at this point in the history
…n to support.
  • Loading branch information
niyue committed Feb 27, 2022
1 parent e84dfb9 commit 2a7a13a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 0.2.3 - 2022-02-27
* add a default skill map name and mark python 3.8 to be the min version
# 0.2.2 - 2022-02-27
* support using different orientation
* support using different orientations
# 0.2.1 - 2022-02-27
* disable a group if all its skills are new or not specified
# 0.2.0 - 2022-02-27
Expand Down
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ setup:
rm -fr ./dist
poetry build && pip install ./dist/skillmap-*-py3-none-any.whl --force-reinstall

publish:
poetry build
poetry publish

build_sample src="tests/url_shortener.toml" dest="dist/url_shortener.md":
echo '```mermaid' > {{ dest }} && skillmap {{ src }} >> {{ dest }} && echo '```' >> {{ dest }}

dev_sample src="tests":
find {{ src }} -iname "*.toml" | entr -s "just build_sample"
find {{ src }} -iname "*.toml" | entr -s "just build_sample"

4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool.poetry]
name = "skillmap"
version = "0.2.2"
version = "0.2.3"
description = "Skillmap generates a skill tree from a toml file"
authors = ["Yue Ni <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.8"
toml = "^0.10.2"

[tool.poetry.dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion skillmap/skillmap_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_orientation(skill_map_dict):

def skill_map_graph(skill_map):
skill_map_dict = skill_map.get("skillmap", {})
map_name = skill_map_dict.get("name", "")
map_name = skill_map_dict.get("name", "unamed_skill_map")
map_id = alphanumerize(map_name)
theme = skill_map_dict.get("theme", "ocean")
orientation = get_orientation(skill_map_dict)
Expand Down
11 changes: 11 additions & 0 deletions tests/skillmap_visitor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ def test_generate():
assert "url_shortener-->groups.backend" in skillmap_graph
assert "class groups.webui" in skillmap_graph

def test_skillmap_node_with_missing_name():
visitor = SkillMapVisitor()
skillmap_graph = visitor.visit(
{
"skillmap": {
}
}
)
assert skillmap_graph
assert "flowchart TD" in skillmap_graph
assert "unamed_skill_map" in skillmap_graph

def test_skillmap_node_with_missing_theme():
visitor = SkillMapVisitor()
Expand Down

0 comments on commit 2a7a13a

Please sign in to comment.