From 2c9524aa55cc301131544e9e346033925871e1e7 Mon Sep 17 00:00:00 2001 From: ge Date: Fri, 30 Sep 2022 12:05:57 +0300 Subject: [PATCH] fix package data search --- rsw/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rsw/__init__.py b/rsw/__init__.py index fa4c50a..f6ede5c 100644 --- a/rsw/__init__.py +++ b/rsw/__init__.py @@ -43,14 +43,13 @@ This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. """ -__version__ = '0.1.1' +__version__ = '0.1.2' import os import sys import shutil import datetime import logging -import importlib.resources import toml import jinja2 @@ -377,9 +376,10 @@ def init(dirname: str = '.', no_makefile: bool = False): # Make Makefile if not no_makefile: + # Get package dir `this_dir` + this_dir, this_filename = os.path.split(__file__) makefile = render_template('Makefile.jinja2', - templates_dir = os.path.dirname( - importlib.resources.path('rsw', 'Makefile.jinja2')), + templates_dir = this_dir, content_dir = DEFAULT_CONFIG['dirs']['content_dir'], static_dir = DEFAULT_CONFIG['dirs']['static_dir'], build_dir = DEFAULT_CONFIG['dirs']['build_dir'],