11import datetime
2+ from importlib import resources
23import shutil
34import os
45import re
@@ -241,7 +242,7 @@ def generate_build_script_for_recipe(
241242 script_name , output_path , additional_cmake_args = "" , additional_folder = ""
242243):
243244 """Generate a specific build script directly in the recipe directory."""
244- import pkg_resources
245+ from importlib import resources
245246
246247 # Map script names to their template files
247248 script_templates = {
@@ -256,9 +257,7 @@ def generate_build_script_for_recipe(
256257 }
257258
258259 if script_name in script_templates :
259- template_in = pkg_resources .resource_filename (
260- "vinca" , script_templates [script_name ]
261- )
260+ template_in = resources .files ("vinca" ) / script_templates [script_name ]
262261 with open (output_path , "w" ) as output_file :
263262 extra_globals = {}
264263 if additional_cmake_args :
@@ -284,7 +283,7 @@ def generate_build_script_for_recipe(
284283
285284def generate_activation_scripts_for_recipe (recipe_dir ):
286285 """Generate activation scripts directly in the recipe directory."""
287- import pkg_resources
286+ from importlib import resources
288287
289288 activation_templates = {
290289 "activate.sh" : "templates/activate.sh.in" ,
@@ -296,7 +295,7 @@ def generate_activation_scripts_for_recipe(recipe_dir):
296295 }
297296
298297 for script_name , template_path in activation_templates .items ():
299- template_in = pkg_resources . resource_filename ("vinca" , template_path )
298+ template_in = resources . files ("vinca" ) / template_path
300299 output_path = recipe_dir / script_name
301300 with open (output_path , "w" ) as output_file :
302301 generate_template (
0 commit comments