Skip to content

Commit

Permalink
Merge pull request #27 from james-smith-za/enable-mypy
Browse files Browse the repository at this point in the history
Enable mypy type-checking
  • Loading branch information
slightlynybbled authored Dec 6, 2023
2 parents bbc9206 + 442d5b9 commit 69ed91e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion engineering_notation/engineering_notation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from string import digits
import sys

from typing import Optional

try:
import numpy
except ImportError:
Expand Down Expand Up @@ -51,7 +53,7 @@ class EngUnit:
Represents an engineering number, complete with units
"""
def __init__(self, value,
precision=2, significant=0, unit: str = None, separator=""):
precision=2, significant=0, unit: Optional[str] = None, separator=""):
"""
Initialize engineering with units
:param value: the desired value in the form of a string, int, or float
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup, find_packages
from setuptools import setup

import os

__version__ = None
Expand Down Expand Up @@ -36,7 +37,8 @@
author='Jason R. Jones',
author_email='[email protected]',
url='https://github.com/slightlynybbled/engineering_notation',
packages=find_packages(),
packages=["engineering_notation"],
package_data={"engineering_notation": ["py.typed"]},
install_requires=requirements,
setup_requires=['flake8', 'pytest'],
license='MIT',
Expand Down

0 comments on commit 69ed91e

Please sign in to comment.