|
22 | 22 | HERE = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))
|
23 | 23 |
|
24 | 24 | ENV_FILE = HERE / "environment.yml"
|
25 |
| -FROZEN_FILE = os.path.splitext(ENV_FILE)[0] + ".lock" |
| 25 | +FROZEN_FILE_T = os.path.splitext(ENV_FILE)[0] + "-{platform}.lock" |
26 | 26 |
|
27 | 27 | ENV_FILE_T = HERE / "environment.py-{py}.yml"
|
28 | 28 |
|
@@ -119,12 +119,19 @@ def set_python(py_env_file, py):
|
119 | 119 | help="Python version(s) to update and freeze",
|
120 | 120 | default=("3.7", "3.8", "3.9", "3.10"),
|
121 | 121 | )
|
| 122 | + parser.add_argument( |
| 123 | + "platform", |
| 124 | + nargs="*", |
| 125 | + help="Platform(s) to update and freeze", |
| 126 | + default=("linux-64", "linux-aarch64"), |
| 127 | + ) |
122 | 128 | args = parser.parse_args()
|
123 | 129 | default_py = "3.7"
|
124 | 130 | for py in args.py:
|
125 |
| - env_file = pathlib.Path(str(ENV_FILE_T).format(py=py)) |
126 |
| - set_python(env_file, py) |
127 |
| - frozen_file = pathlib.Path(os.path.splitext(env_file)[0] + ".lock") |
128 |
| - freeze(env_file, frozen_file) |
129 |
| - if py == default_py: |
130 |
| - shutil.copy(frozen_file, FROZEN_FILE) |
| 131 | + for platform in args.platform: |
| 132 | + env_file = pathlib.Path(str(ENV_FILE_T).format(py=py)) |
| 133 | + set_python(env_file, py) |
| 134 | + frozen_file = pathlib.Path(os.path.splitext(env_file)[0] + f"-{platform}.lock") |
| 135 | + freeze(env_file, frozen_file, platform) |
| 136 | + if py == default_py: |
| 137 | + shutil.copy(frozen_file, FROZEN_FILE_T.format(platform=platform)) |
0 commit comments