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

pyscaffold / configupdater
98%
master: 97%

Build:
Build:
LAST BUILD BRANCH: pre-commit-ci-update-config
DEFAULT BRANCH: master
Repo Added 22 Jun 2018 06:13PM UTC
Files 9
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

LAST BUILD ON BRANCH add-type-hints
branch: add-type-hints
CHANGE BRANCH
x
Reset
  • add-type-hints
  • HEAD
  • add-adopt-option-test
  • add-fallback
  • add-missing-type-hint
  • add-py-typed
  • api_token
  • attach-container
  • badges_template
  • cleanup-insert
  • clear-remove-all
  • deepcopy-option
  • deepcopy-section
  • deepcopy-toplevel
  • dev
  • fix-type-errors
  • fix15
  • fix_liskov
  • fix_option
  • fix_retval
  • fix_setitem_in_document
  • fix_type_errors
  • improve-errors
  • improve-optionxform-issue
  • improve-validation-consistency
  • issue-10
  • issue-31
  • issue-55
  • issue-68
  • link-missing
  • main
  • make-add-line-protected
  • markdown-everywhere
  • master
  • mention-deepcopy-docs
  • ml-comments
  • modify-multiline-values
  • pre-commit-ci-update-config
  • psf-license
  • pyscaffold-update
  • pyscaffold-v4
  • reorganise
  • section_comment
  • simplify-coverage
  • type-improvements
  • update-ci
  • v0.1
  • v0.1.1
  • v0.2
  • v0.3
  • v0.3.1
  • v0.3.2
  • v0.3.2rc2
  • v1.0
  • v3.0
  • v3.0.1
  • v3.0rc1
  • v3.0rc2
  • v3.1
  • v3.1.1
  • v3.2
  • v3.2b1
  • work-on-optionxform
  • workaround

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

Relevant lines Covered
Build:
Build:
580 RELEVANT LINES 572 COVERED LINES
0.99 HITS PER LINE
Source Files on add-type-hints
  • Tree
  • List 2
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
#153 add-type-hints 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 ... push 12 Mar 2021 01:37AM UTC abravalheri coveralls-python pending completion  
#150 add-type-hints Update from PyScaffold v4.0.1rc2 The changes in this commit were generated by doing `putup -U -f .` and then using `git difftool` to merge the differences back. There are some small improvements, such as fixing setuptools warnings due to kebab-c... push 11 Mar 2021 07:23PM UTC abravalheri coveralls-python pending completion  
See All Builds (494)
  • Repo on GitHub
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