# Tracking Progress in Long CircuitPython Library Updates

---

*Circup now shows each module’s position in the update list, making long update runs easier to follow.*

CircuitPython is Python for microcontrollers. Adafruit and other contributors publish libraries that let a board use sensors, displays, motors, and other hardware without every project having to write those drivers from scratch. Circup is the command-line tool that installs and updates those libraries.

When a project has many libraries installed, `circup update --all` can take a while. Circup already printed a line when each update succeeded, but the output did not show how far through the planned work it had reached. A list of names told me what had finished, not where I was in the list.

![Figure 1. Circup displays the current module position and total update count in terminal output.](https://cdn.hashnode.com/uploads/covers/6b0a762e1551beb5c5821976/72ae3f87-4b21-4708-8b24-a6a02011c9f4.png align="center")

*Figure 1. The progress indicator reports a module's position in the pending update list.*

## The change

The update command now numbers each successful update by its position in the list of modules that need work. For example:

```text
5/389 Updated adafruit_gps
```

The implementation uses the list that Circup has already built:

```python
for index, module in enumerate(modules_to_update, start=1):
    ...
    click.echo(f"{index}/{len(modules_to_update)} Updated {module.name}")
```

If there are `n` modules to update, the displayed position `i` is in the range `1 ≤ i ≤ n`.

This is a list position, not a count of successful updates. The index advances through the planned list even if an earlier item is skipped or fails. That keeps later messages tied to the same module position rather than making the count look like a success tally.

## Why a small counter helps

During a long update, the operator can estimate how much of the original work list remains. The counter also gives a quick way to relate terminal output to a log or a reported failure. The command still updates the same modules in the same order, and the counter does not change success or failure behavior.

The implementation stays in the existing loop. It does not add a progress-bar dependency, keep a second count, or alter module selection. The total comes directly from `modules_to_update`, so the numerator and denominator describe the same work list.

## Review and merge

I submitted this change as [@shaxntanu](https://github.com/shaxntanu). [@FoamyGuy](https://github.com/FoamyGuy) reviewed the behavior, suggested dropping a standalone test that was not needed, and later approved the updated PR. [@FoamyGuy](https://github.com/FoamyGuy) merged the contribution into Adafruit’s Circup repository.

## Validation

During review, the maintainer asked to drop the standalone test case, so the final diff keeps the implementation in the existing update loop. The PR’s validation notes report a targeted CLI check, and the hosted GitHub Actions `test` job passed. The full local Windows run reported 65 passing tests and five failures in unchanged path-format and CLI/network-sensitive tests.

The contribution was merged in [Adafruit Circup PR #291](https://github.com/adafruit/circup/pull/291), fixing [issue #273](https://github.com/adafruit/circup/issues/273).

## What I took away

A useful progress indicator does not need to own the update process. Reusing the order already present in the program made the output clearer with a small change and without changing what Circup updates.

## References

- [Merged PR #291: Show progress when updating multiple modules](https://github.com/adafruit/circup/pull/291)
- [Issue #273](https://github.com/adafruit/circup/issues/273)
