Skip to content

Commit

Permalink
use standard library to import package resource
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 23, 2019
1 parent 7a1f687 commit e91c65d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions qgispluginci/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from github import Github, GithubException
import xmlrpc.client
import re
import pkg_resources
try:
import importlib.resources as importlib_resources
except ImportError:
# In Py<3.7 fall-back to backported `importlib_resources`.
import importlib_resources
import datetime
import pyqt5ac

Expand Down Expand Up @@ -65,9 +69,6 @@ def release(parameters: Parameters,
tr.pull()
tr.compile_strings()

# compile qrc files


output = '{project_slug}-{release_version}.zip'.format(project_slug=parameters.project_slug,
release_version=release_version)
create_archive(parameters, output=output, add_translations=transifex_token is not None)
Expand Down Expand Up @@ -211,9 +212,7 @@ def create_plugin_repo(parameters: Parameters,
"""
Creates the plugin repo as an XML file
"""
xml_template = pkg_resources.resource_filename('qgispluginci', 'plugins.xml.template')
_, xml_repo = mkstemp(suffix='.xml')

replace_dict = {
'__RELEASE_VERSION__': release_version,
'__RELEASE_TAG__': release_tag or release_version,
Expand All @@ -235,7 +234,8 @@ def create_plugin_repo(parameters: Parameters,
'__HOMEPAGE__': parameters.homepage,
'__REPO_URL__': parameters.repository_url
}
configure_file(xml_template, xml_repo, replace_dict)
with importlib_resources.path('qgispluginci', 'plugins.xml.template') as xml_template:
configure_file(xml_template, xml_repo, replace_dict)
return xml_repo


Expand Down

0 comments on commit e91c65d

Please sign in to comment.