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

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

Build:
Build:
LAST BUILD BRANCH: pre-commit-ci-update-config
DEFAULT BRANCH: master
Ran 12 Mar 2021 01:37AM UTC
Jobs 1
Files 2
Run time 1s
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

pending completion
#153

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

Jobs
ID Job ID Ran Files Coverage
1 #153.1 12 Mar 2021 01:37AM UTC 0
97.55
Source Files on build #153
Detailed source file information is not available for this build.
  • Back to Repo
  • 3eb47543 on github
  • Prev Build on add-type-hints
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

© 2025 Coveralls, Inc