Skip to content

Commit

Permalink
bug fix in loading package specific resources
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyjs committed Nov 26, 2023
1 parent 6f706bb commit 82287bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nhlpy/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Should this be driven by the main pyproject.toml file? yes, is it super convoluted? yes, can it wait? sure

__version__ = "2.1.0"
__version__ = "2.1.1"
4 changes: 2 additions & 2 deletions nhlpy/api/teams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import os
import importlib.resources

from typing import List

Expand All @@ -26,5 +26,5 @@ def teams_info(self) -> dict:
:return: dict
"""

with open(os.path.join(os.getcwd(), "nhlpy/data/teams_20232024.json"), "r") as f:
with importlib.resources.open_text("nhlpy.data", "teams_20232024.json") as f:
return json.load(f)
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "nhl-api-py"
version = "2.1.0"
version = "2.1.1"
description = "NHL API. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods for easy data loading in Pandas or any ML applications."
authors = ["Corey Schaf <cschaf@gmail.com>"]
readme = "README.md"
Expand All @@ -26,6 +26,9 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules"
]

[tool.poetry.include]
package = ["nhlpy/data/*"]

[tool.poetry.dependencies]
python = "^3.10"
httpx = "*"
Expand Down

0 comments on commit 82287bb

Please sign in to comment.