If it contains only SQL then you can use a function as below -
import subprocess
def run_sql(sql_file_path,
your_db_name
,location):
subprocess.call(["spark-sql","-S","--hivevar","<DBName>",<your_db_name>,"--hivevar","LOCATION",location,"-f",sql_file_path])
In you have other pieces like spark code and not only sql in that file-
Write a parse function which parse you sql and replace the placeholders like DB Name etc in your sql and then execute the new formed sql.
Maintaining your sql in a separate file though de-couples the code and sql and make it easier from maintenance perspective.