|
28 | 28 | lock_files, unlock_files, delete_directory, create_setup_py, \ |
29 | 29 | delete_file |
30 | 30 |
|
| 31 | +# Buildme and Cleanme are invoked from another folder |
| 32 | +# so Python will pull in the version of wslwinreg that's |
| 33 | +# already installed. To force it to use the one in this |
| 34 | +# folder, manually purge it first, then insert the current |
| 35 | +# working directory into the search path, then reload |
| 36 | +# with the import call |
| 37 | + |
| 38 | +# Remove old copy of wslwinreg |
| 39 | +if "wslwinreg" in sys.modules: |
| 40 | + del sys.modules["wslwinreg"] |
| 41 | + |
| 42 | +# Update the path |
| 43 | +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) |
| 44 | + |
| 45 | +# Import this copy of wslwinreg |
| 46 | +# pylint: disable=wrong-import-position |
31 | 47 | from wslwinreg import __version__ |
32 | 48 |
|
33 | 49 | # If set to True, ``buildme -r``` will not parse directories in this folder. |
|
42 | 58 | # ``cleanme`` will clean the listed folders before cleaning this folder. |
43 | 59 | CLEANME_DEPENDENCIES = ["src"] |
44 | 60 |
|
45 | | - |
46 | 61 | # Directories to clean |
47 | 62 | CLEAN_DIR_LIST = [ |
48 | 63 | "wslwinreg.egg-info", |
@@ -89,6 +104,7 @@ def build(working_directory, configuration): |
89 | 104 | None if not implemented, otherwise an integer error code. |
90 | 105 | """ |
91 | 106 |
|
| 107 | + # Create setup.py for Python 2.7 distribution |
92 | 108 | input_file = os.path.join(working_directory, "pyproject.toml") |
93 | 109 | output_file = os.path.join(working_directory, "setup.py") |
94 | 110 | create_setup_py(input_file, output_file) |
|
0 commit comments