File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 96
96
- name : Package libqfieldsync
97
97
run : |
98
98
pip wheel $(grep -o -P '(https://.*.tar.gz)' requirements.txt)
99
- mv libqfieldsync-*.whl qfieldsync/libqfieldsync.whl
99
+ LIBQFIELDSYNC_COMMIT_SHA=$(echo $(grep -o -P '(https://.*.tar.gz)' requirements.txt) | grep -Eo '[0-9a-f]{40}')
100
+ mv libqfieldsync-*.whl qfieldsync/libqfieldsyncq_${LIBQFIELDSYNC_COMMIT_SHA}.whl
100
101
101
102
- name : Release
102
103
run : |
Original file line number Diff line number Diff line change 24
24
25
25
from __future__ import absolute_import
26
26
27
+ import importlib
27
28
import pathlib
29
+ import re
28
30
import sys
29
31
30
32
src_dir = pathlib .Path (__file__ ).parent .resolve ()
31
33
32
- libqfieldsync_whl = src_dir / "libqfieldsync.whl"
33
- if libqfieldsync_whl .exists ():
34
+ # remove previously loaded `libqfieldsync.whl` from the python import path
35
+ for python_path in sys .path :
36
+ if re .search (r"libqfieldsync.*\.whl$" , python_path ):
37
+ sys .path .remove (python_path )
38
+
39
+ # add the new `libqfieldsync.whl` file to the python import path
40
+ for libqfieldsync_whl in src_dir .glob ("libqfieldsync*.whl" ):
34
41
sys .path .append (str (libqfieldsync_whl ))
35
42
43
+ # force reload all the `libqfieldsync` modules from the new path
44
+ module_names = list (sys .modules .keys ())
45
+ for module_name in module_names :
46
+ if module_name .startswith ("libqfieldsync" ):
47
+ importlib .reload (sys .modules [module_name ])
48
+
36
49
37
50
# noinspection PyPep8Naming
38
51
def classFactory (iface ): # pylint: disable=invalid-name
You can’t perform that action at this time.
0 commit comments