Skip to content

Commit

Permalink
ci: resolve code broken by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Dec 7, 2024
1 parent 85fc961 commit b4c638a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,5 @@ repos:
- id: copier-forbidden-files
- id: lint-fix
stages: ["pre-commit"]
additional_dependencies:
- ruff>=0.8.0
- id: tags
stages: ["pre-push"]
14 changes: 7 additions & 7 deletions calcipy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@ def start_program(
"""
# Manipulate 'sys.argv' to hide arguments that invoke can't parse
gto = GlobalTaskOptions()
lgto = GlobalTaskOptions()
sys_argv: List[str] = sys.argv[:1]
last_argv = ''
for argv in sys.argv[1:]:
if not last_argv.startswith('-') and Path(argv).is_file():
gto.file_args.append(Path(argv))
lgto.file_args.append(Path(argv))
# Check for CLI flags
elif argv in {'-v', '-vv', '-vvv', '--verbose'}:
gto.verbose = argv.count('v')
lgto.verbose = argv.count('v')
elif argv == '--keep-going':
gto.keep_going = True
lgto.keep_going = True
# Check for CLI arguments with values
elif last_argv == '--working-dir':
gto.working_dir = Path(argv).resolve()
lgto.working_dir = Path(argv).resolve()
elif argv != '--working-dir':
sys_argv.append(argv)
last_argv = argv
gto.file_args = [_f if _f.is_absolute() else Path.cwd() / _f for _f in gto.file_args]
lgto.file_args = [_f if _f.is_absolute() else Path.cwd() / _f for _f in lgto.file_args]
sys.argv = sys_argv

class _CalcipyConfig(CalcipyConfig):
gto: GlobalTaskOptions = gto
gto: GlobalTaskOptions = lgto

if module and collection:
raise ValueError('Only one of collection or module can be specified')
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
## Unreleased

### Fix

- partial revert of copier-update

## 5.0.0 (2024-11-07)

### Feat

- remove licensecheck
- remove 'stale' module and pytest-recording

## 4.3.0 (2024-10-31)
Expand Down
42 changes: 21 additions & 21 deletions docs/docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,40 @@ poetry config pypi-token.pypi ...
| File | Statements | Missing | Excluded | Coverage |
|-----------------------------------------------------|-----------:|--------:|---------:|---------:|
| `calcipy/__init__.py` | 4 | 0 | 0 | 100.0% |
| `calcipy/_runtime_type_check_setup.py` | 13 | 0 | 33 | 100.0% |
| `calcipy/_runtime_type_check_setup.py` | 12 | 0 | 37 | 100.0% |
| `calcipy/can_skip.py` | 14 | 1 | 0 | 88.9% |
| `calcipy/cli.py` | 34 | 1 | 88 | 92.9% |
| `calcipy/cli.py` | 34 | 2 | 88 | 89.5% |
| `calcipy/code_tag_collector/__init__.py` | 5 | 2 | 0 | 60.0% |
| `calcipy/code_tag_collector/_collector.py` | 130 | 2 | 0 | 93.9% |
| `calcipy/collection.py` | 41 | 3 | 52 | 86.5% |
| `calcipy/code_tag_collector/_collector.py` | 126 | 2 | 0 | 96.9% |
| `calcipy/collection.py` | 37 | 4 | 52 | 83.7% |
| `calcipy/dot_dict/__init__.py` | 5 | 2 | 0 | 60.0% |
| `calcipy/dot_dict/_dot_dict.py` | 6 | 0 | 0 | 100.0% |
| `calcipy/dot_dict/_dot_dict.py` | 5 | 0 | 0 | 100.0% |
| `calcipy/experiments/__init__.py` | 0 | 0 | 0 | 100.0% |
| `calcipy/experiments/bump_programmatically.py` | 22 | 22 | 0 | 0.0% |
| `calcipy/experiments/check_duplicate_test_names.py` | 33 | 0 | 2 | 98.2% |
| `calcipy/experiments/sync_package_dependencies.py` | 47 | 47 | 0 | 0.0% |
| `calcipy/file_search.py` | 32 | 0 | 2 | 100.0% |
| `calcipy/invoke_helpers.py` | 27 | 4 | 0 | 83.8% |
| `calcipy/markdown_table.py` | 29 | 4 | 0 | 81.8% |
| `calcipy/invoke_helpers.py` | 27 | 6 | 0 | 72.4% |
| `calcipy/markdown_table.py` | 29 | 4 | 0 | 80.5% |
| `calcipy/md_writer/__init__.py` | 5 | 2 | 0 | 60.0% |
| `calcipy/md_writer/_writer.py` | 93 | 6 | 0 | 89.7% |
| `calcipy/md_writer/_writer.py` | 91 | 7 | 0 | 88.7% |
| `calcipy/noxfile/__init__.py` | 5 | 2 | 0 | 60.0% |
| `calcipy/noxfile/_noxfile.py` | 39 | 2 | 51 | 91.5% |
| `calcipy/noxfile/_noxfile.py` | 39 | 2 | 51 | 91.1% |
| `calcipy/scripts.py` | 6 | 0 | 51 | 100.0% |
| `calcipy/tasks/__init__.py` | 0 | 0 | 0 | 100.0% |
| `calcipy/tasks/all_tasks.py` | 37 | 0 | 0 | 93.9% |
| `calcipy/tasks/cl.py` | 26 | 5 | 0 | 78.1% |
| `calcipy/tasks/defaults.py` | 17 | 0 | 0 | 90.5% |
| `calcipy/tasks/doc.py` | 29 | 0 | 8 | 94.9% |
| `calcipy/tasks/executable_utils.py` | 32 | 0 | 0 | 90.9% |
| `calcipy/tasks/lint.py` | 38 | 2 | 0 | 86.2% |
| `calcipy/tasks/all_tasks.py` | 36 | 2 | 0 | 94.7% |
| `calcipy/tasks/cl.py` | 25 | 6 | 0 | 70.4% |
| `calcipy/tasks/defaults.py` | 17 | 0 | 0 | 94.7% |
| `calcipy/tasks/doc.py` | 29 | 0 | 8 | 100.0% |
| `calcipy/tasks/executable_utils.py` | 31 | 2 | 0 | 91.4% |
| `calcipy/tasks/lint.py` | 38 | 2 | 0 | 87.0% |
| `calcipy/tasks/most_tasks.py` | 29 | 0 | 0 | 100.0% |
| `calcipy/tasks/nox.py` | 8 | 0 | 0 | 100.0% |
| `calcipy/tasks/pack.py` | 39 | 10 | 0 | 64.9% |
| `calcipy/tasks/tags.py` | 18 | 1 | 0 | 90.9% |
| `calcipy/tasks/test.py` | 39 | 1 | 2 | 90.9% |
| `calcipy/tasks/types.py` | 11 | 0 | 0 | 93.3% |
| **Totals** | 913 | 119 | 289 | 82.6% |
| `calcipy/tasks/pack.py` | 39 | 12 | 0 | 61.7% |
| `calcipy/tasks/tags.py` | 18 | 1 | 0 | 90.0% |
| `calcipy/tasks/test.py` | 39 | 1 | 2 | 93.6% |
| `calcipy/tasks/types.py` | 11 | 0 | 0 | 100.0% |
| **Totals** | 898 | 131 | 293 | 81.7% |

Generated on: 2024-11-07
Generated on: 2024-12-07
<!-- {cte} -->
4 changes: 2 additions & 2 deletions docs/docs/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ After further reduction of dependencies, the CLI performance has continued to im
```sh
> hyperfine -m 20 --warmup 5 ./run
Benchmark 1: ./run
Time (mean ± σ): 397.1 ms ± 12.2 ms [User: 268.4 ms, System: 57.0 ms]
Range (min … max): 385.9 ms … 421.5 ms 20 runs
Time (mean ± σ): 397.1 ms ± 12.2 ms [User: 268.4 ms, System: 57.0 ms]
Range (min … max): 385.9 ms … 421.5 ms 20 runs
```

## `v4`
Expand Down

0 comments on commit b4c638a

Please sign in to comment.