|
5 | 5 | remove_bitbucket_pytest_steps, |
6 | 6 | update_bitbucket_pytest_steps, |
7 | 7 | ) |
| 8 | +from usethis._config import usethis_config |
8 | 9 | from usethis._console import box_print, tick_print |
9 | 10 | from usethis._integrations.bitbucket.steps import ( |
10 | 11 | add_bitbucket_steps_in_default, |
@@ -170,9 +171,6 @@ def use_pre_commit(*, remove: bool = False) -> None: |
170 | 171 | remove_bitbucket_steps_from_default(tool.get_bitbucket_steps()) |
171 | 172 | _add_bitbucket_linter_steps_to_default() |
172 | 173 |
|
173 | | - # Need pre-commit to be installed so we can uninstall hooks |
174 | | - add_deps_to_group(tool.dev_deps, "dev") |
175 | | - |
176 | 174 | uninstall_pre_commit_hooks() |
177 | 175 |
|
178 | 176 | remove_pre_commit_config() |
@@ -313,19 +311,20 @@ def use_requirements_txt(*, remove: bool = False) -> None: |
313 | 311 |
|
314 | 312 | if not path.exists(): |
315 | 313 | # N.B. this is where a task runner would come in handy, to reduce duplication. |
316 | | - if not (Path.cwd() / "uv.lock").exists(): |
| 314 | + if not (Path.cwd() / "uv.lock").exists() and not usethis_config.frozen: |
317 | 315 | tick_print("Writing 'uv.lock'.") |
318 | 316 | call_uv_subprocess(["lock"]) |
319 | 317 |
|
320 | | - tick_print("Writing 'requirements.txt'.") |
321 | | - call_uv_subprocess( |
322 | | - [ |
323 | | - "export", |
324 | | - "--frozen", |
325 | | - "--no-dev", |
326 | | - "--output-file=requirements.txt", |
327 | | - ] |
328 | | - ) |
| 318 | + if not usethis_config.frozen: |
| 319 | + tick_print("Writing 'requirements.txt'.") |
| 320 | + call_uv_subprocess( |
| 321 | + [ |
| 322 | + "export", |
| 323 | + "--frozen", |
| 324 | + "--no-dev", |
| 325 | + "--output-file=requirements.txt", |
| 326 | + ] |
| 327 | + ) |
329 | 328 |
|
330 | 329 | if not is_pre_commit: |
331 | 330 | _requirements_txt_instructions_basic() |
|
0 commit comments