Skip to content

Commit

Permalink
Improve static type checking in setup.py (#221)
Browse files Browse the repository at this point in the history
Part of #201

Signed-off-by: Omar Mohamed <[email protected]>
  • Loading branch information
kibablu authored Apr 23, 2021
1 parent 860cda0 commit 2c574ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/221.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document on improving static type checking using mypy. Contributed by Omar Mohamed.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import os.path
from os import PathLike
from typing import Union

from setuptools import find_packages, setup

Expand All @@ -25,7 +27,7 @@
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
def read(fname: Union[str, "PathLike[str]"]) -> str:
return open(os.path.join(os.path.dirname(__file__), fname)).read()


Expand Down

0 comments on commit 2c574ea

Please sign in to comment.