Skip to content

Commit

Permalink
fix: Add package recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcHLuehr committed Dec 3, 2024
1 parent 9b7bc3d commit 0903cb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Empty file added cooker/__init__.py
Empty file.
5 changes: 4 additions & 1 deletion cooker/cooker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from abc import ABC, abstractmethod
from collections.abc import Mapping
from typing import List
import cooker

__version__ = '1.4.0'

Expand Down Expand Up @@ -763,7 +764,9 @@ def log(self, build_name, menu_from_file, menu_to_file, history, log_format):
"""
Generates a log of the build sources revision changes between two menu file version.
"""
schema = pyjson5.loads(pkg_resources.resource_string(__name__, "cooker-menu-schema.json").decode('utf-8'))

schema_file = importlib.resources.files('cooker').joinpath('cooker-menu-schema.json').read_text()
schema = pyjson5.loads(schema_file)
menu_from = self.load_and_validate_menu(menu_from_file, schema)
menu_to = self.menu

Expand Down
4 changes: 2 additions & 2 deletions test/cooker
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import sys, os
# realpath resolves links
thisdir = os.path.dirname(os.path.realpath(sys.argv[0]))

sys.path.append(os.path.join(thisdir, '..', 'cooker'))
sys.path.append(os.path.join(thisdir, '..'))

from cooker import main
from cooker.cooker import main

if __name__ == '__main__':
main()

0 comments on commit 0903cb2

Please sign in to comment.