Skip to content

Commit 53499b1

Browse files
committed
Fix path resolving
1 parent c1b20cf commit 53499b1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

py_swagger_ui/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from pathlib import Path
22

33
try:
4-
import importlib.resources as importlib_resources
5-
except ImportError: # < Python 3.9
64
import importlib_resources as importlib_resources
5+
except ImportError: # < Python 3.9
6+
import importlib.resources as importlib_resources
77

88

9-
swagger_ui_path: Path = importlib_resources.files("py-swagger-ui") / "vendor/swagger-ui-4.15.5"
9+
swagger_ui_path: Path = importlib_resources.files("py_swagger_ui") / "vendor/swagger-ui-4.15.5"

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "py_swagger_ui"
3-
version = 'test'
3+
version = '1.0.0'
44
description = "Swagger UI bundled for usage with Python"
55
readme = "README.rst"
66
keywords = ["swagger-ui"]
@@ -31,7 +31,8 @@ classifiers = [
3131

3232
[tool.poetry.dependencies]
3333
python = "^3.7"
34-
Jinja2 = "^2.0"
34+
Jinja2 = "^3.0.0"
35+
importlib_resources = { version = "^5.7.1", python = "<3.9" }
3536

3637
[tool.poetry.group.test.dependencies]
3738
pytest = "^7.1.3"

tests/test_can_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
def test_import_ui():
44
from py_swagger_ui import swagger_ui_path
5-
open(swagger_ui_path + "/index.html")
5+
open(swagger_ui_path / "index.html")

0 commit comments

Comments
 (0)