Skip to content

Commit

Permalink
fix: poly libs and poly check - open files with encoding (#74)
Browse files Browse the repository at this point in the history
* fix(poly libs and check): open files with utf-8 encoding, ignore errors

* bump version to 1.5.0
  • Loading branch information
DavidVujic authored Mar 28, 2023
1 parent c7fafac commit 4fabe4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/polylith/libs/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def parse_imports(node: ast.AST) -> List[str]:


def parse_module(path: pathlib.Path) -> ast.AST:
with open(path.as_posix(), "r") as f:
with open(path.as_posix(), "r", encoding="utf-8", errors="ignore") as f:
tree = ast.parse(f.read(), path.name)

return tree
Expand Down
2 changes: 1 addition & 1 deletion components/polylith/project/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def get_workspace_toml(path: Path) -> dict:
with open(str(path / repo.default_toml), "r") as f:
with open(str(path / repo.default_toml), "r", errors="ignore") as f:
data: dict = tomlkit.loads(f.read())

return data
Expand Down
2 changes: 1 addition & 1 deletion components/polylith/project/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_project_name(data) -> str:


def get_toml(root: Path) -> tomlkit.TOMLDocument:
with root.open() as f:
with root.open(encoding="utf-8", errors="ignore") as f:
return tomlkit.loads(f.read())


Expand Down
2 changes: 1 addition & 1 deletion projects/poetry_polylith_plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-polylith-plugin"
version = "1.4.1"
version = "1.5.0"
description = "A Poetry plugin that adds tooling support for the Polylith Architecture"
authors = ["David Vujic"]
homepage = "https://davidvujic.github.io/python-polylith-docs/"
Expand Down

0 comments on commit 4fabe4b

Please sign in to comment.