Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
whitews committed Nov 5, 2024
2 parents 5cba751 + 7effde1 commit 2f8a881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 6 additions & 16 deletions src/flowkit/_resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
"""
Contains non-code resources used in FlowKit
"""
from pkg_resources import resource_filename

from importlib import resources
from lxml import etree
import os
import pathlib

resource_path = resource_filename('flowkit', '_resources')
# force POSIX-style path, even on Windows
resource_path = pathlib.Path(resource_path).as_posix()
resource_dir = resources.files("flowkit")
xsd_file = resource_dir / "_resources" / "Gating-ML.v2.0.xsd"

# We used to edit the import paths for Transformations & DataTypes,
# but it still caused an XMLSchemaParseError when FlowKit was
# installed in a location where the path contained "special"
# characters (i.e. accented letters). Instead, we now change
# directories temporarily to the XSD location, read in the files,
# and then change back to the original CWD.
orig_dir = os.getcwd()
os.chdir(resource_path)
gml_tree = etree.parse('Gating-ML.v2.0.xsd')
with xsd_file.open("rb") as file:
gml_tree = etree.parse(file)
gml_schema = etree.XMLSchema(gml_tree)
os.chdir(orig_dir)
2 changes: 1 addition & 1 deletion src/flowkit/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
FlowKit version
"""
__version__ = "1.2.0"
__version__ = "1.2.1"

0 comments on commit 2f8a881

Please sign in to comment.