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

sybrenstuvel / python-rsa
92%
master: 92%

Build:
Build:
LAST BUILD BRANCH: rsa_oaep
DEFAULT BRANCH: master
Repo Added 05 Feb 2016 03:10PM CUT
Files 15
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 saifelse-test-mypy
branch: saifelse-test-mypy
CHANGE BRANCH
x
Reset
  • saifelse-test-mypy
  • cool-RR-2020-06-11-raise-from
  • issue-98-fips-186-4-prime-selection
  • main
  • master
  • saifelse-clean-unittest-output
  • temp-back-to-pipenv
  • temp-poetry
  • temp-travis
  • temp-zipp-fix
  • test-poetry
  • test-py37-support
  • test-threading-fix-173
  • test-tox-p38
  • version-3.4
  • version-3.4-repackaging
  • version-3.4.1
  • version-3.4.2
  • version-4.0
  • version-4.1
  • version-4.2
  • version-4.3
  • version-4.3-py27compatible
  • version-4.4
  • version-4.4.1
  • version-4.5
  • version-4.6
  • version-4.7
  • version-4.7.1
  • version-4.7.2

pending completion
359

push

travis-ci

sybrenstuvel
Fix hashlib mypy types for Python 3.x

As captured in https://github.com/python/typeshed/pull/1663, the types for
SHA-1 and SHA-2 family of functions are callables that return a Hash instance,
whilst the SHA-3 family of functions are Hash `type`s (at least in Python 3.6).
Mixing the two kinds of functions together in a dictionary confuses mypy's type
inference as noted in #153, so we instead add an annotation as a hint.

Also, update test_my.py to match the python version set by tox.ini in CI
instead of always targeting Python 3.7 (as configured in setup.cfg) to
validate the types in all supported Python 3.x versions.

This fix also avoids the issue with the older mypy releases for
Python 3.6 / Python 3.7 found in distro repos...

... for Ubuntu:
```
docker run \
  -v $(pwd):/tmp/rsa \
  -w /tmp/rsa ubuntu:18.04 \
  /bin/bash -c 'apt-get update -qqy \
                  && apt-get install -qqy python3-pyasn1 python3-setuptools python3-mypy \
                  && python3 setup.py test'
```
... and for Fedora:
```
docker run \
  -v $(pwd):/tmp/rsa \
  -w /tmp/rsa docker.io/fedora \
  /bin/bash -c 'dnf -y install wget python3-devel python3-pyasn1 python3-setuptools python3-mypy \
                  && python3 setup.py test'
```

Fixes #153

2 of 2 new or added lines in 1 file covered. (100.0%)

747 of 815 relevant lines covered (91.66%)

3.67 hits per line

Relevant lines Covered
Build:
Build:
815 RELEVANT LINES 747 COVERED LINES
3.67 HITS PER LINE
Source Files on saifelse-test-mypy
  • Tree
  • List 15
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Loading...
Coverage∆FileLinesRelevantCoveredMissedHits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
359 saifelse-test-mypy Fix hashlib mypy types for Python 3.x As captured in https://github.com/python/typeshed/pull/1663, the types for SHA-1 and SHA-2 family of functions are callables that return a Hash instance, whilst the SHA-3 family of functions are Hash `type`s ... push 24 Mar 2021 09:29AM CUT sybrenstuvel travis-ci pending completion  
See All Builds (291)
  • 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