Skip to content

Commit 42046a9

Browse files
committed
fixed reading absolute paths from <include> tags
1 parent 7075a5d commit 42046a9

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
66
The format is based on `Keep a Changelog`_,
77
and this project adheres to `Semantic Versioning`_.
88

9+
`1.4.4`_ - 2020-12-22
10+
--------------------------
11+
Fixed
12+
'''''''
13+
- Reading absolute paths from ``<include>`` tags.
14+
915
`1.4.3`_ - 2020-11-11
1016
--------------------------
1117
Fixed
@@ -184,7 +190,8 @@ Added
184190

185191
.. LINKS
186192
187-
.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.3...HEAD
193+
.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.4...HEAD
194+
.. _`1.4.4`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.3...v1.4.4
188195
.. _`1.4.3`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.2...v1.4.3
189196
.. _`1.4.2`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.1...v1.4.2
190197
.. _`1.4.1`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.0...v1.4.1

src/microstructpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
import microstructpy.seeding
55
import microstructpy.verification
66

7-
__version__ = '1.4.3'
7+
__version__ = '1.4.4'

src/microstructpy/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,11 @@ def _include_expand(inp, filename, key):
208208
if not isinstance(includes, list):
209209
includes = [includes]
210210
for inc_filename in includes:
211-
if os.path.isabs(inc_filename):
212-
fname = inc_filename
211+
inc_fname = os.path.expanduser(inc_filename)
212+
if os.path.isabs(inc_fname):
213+
fname = inc_fname
213214
else:
214-
fname = os.path.join(file_path, inc_filename)
215+
fname = os.path.join(file_path, inc_fname)
215216
inc_dict = input2dict(fname, key)
216217
exp_dict.update(inc_dict[key])
217218
else:

0 commit comments

Comments
 (0)