Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improved static type checking in setup.py #221

Merged
merged 4 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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