• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pyscaffold / configupdater / #153 / 1
98%
master: 97%

Build:
Build:
LAST BUILD BRANCH: pre-commit-ci-update-config
DEFAULT BRANCH: master
Ran 12 Mar 2021 01:37AM UTC
Files 2
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Mar 2021 01:08AM UTC coverage: 97.552% (-0.5%) from 98.074%
#153.1

push

coveralls-python

abravalheri
Add type hints (mypy assumed as reference/standard)

This is an attempt to start addressing issue #16.

Adding type checking to an untyped codebase is usually a challenge and
sometimes require pragmatic approaches, such as the one adopted in this
commit.

`# type: ignore` is used sporadically, but is still present when the
type checker is not "smart enough", when the current Python syntax does
not allow expressing the most correct type information or when it was
too hard to introduce it.

It was necessary to remove explicit inheritance from `MuttableMapping`,
since the abstract methods are being overwritten with a non matching
signature that is more convenient for ConfigUpdater.

Functions that use `_UNSET` are currently not completely well typed,
it is still necessary to find an alternative (can we consider `Optional[T]`?)

---
As a quick report, the process used to produce the type annotations was
"semi-manual", with the following steps:

1. Using `pytype` as type checker, the type errors were debugged and
   fixed or "workaround"-ed
2. Using `pytype`, initial type stubs were created
3. Using `retype`, the type stubs were merged back into the source code
   (for some reason `pytype`'s `merge-pyi` did not work)
4. Manual checking/refactoring/fixing of the annotated file
5. Introduction of new annotations not generated by `pytype`
6. Using `mypy` as type checker, the type errors were debugged and fixed
   or "workaround"-ed

mypy does seem to have a tool for generating type stubs, but I have
never worked with it...

225 of 237 branches covered (94.94%)

Branch coverage included in aggregate %.

572 of 580 relevant lines covered (98.62%)

0.99 hits per line

Source Files on job #153.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 153
  • 3eb47543 on github
  • Prev Job for on add-type-hints (##150.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc