Skip to content

Commit 7cadd0f

Browse files
committed
Revert "Merge pull request #534 from jorenham/static-typing"
This reverts commit bce38b4, reversing changes made to cd730c8.
1 parent fcf995a commit 7cadd0f

File tree

17 files changed

+510
-832
lines changed

17 files changed

+510
-832
lines changed

.github/workflows/typecheck.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ repos:
1818
hooks:
1919
- id: isort
2020

21-
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v1.18.2
23-
hooks:
24-
- id: mypy
25-
args: [--config-file=pyproject.toml]
26-
exclude: ^(bench/|build/|doc/|issues/|setup.py)
27-
additional_dependencies: [numpy, pytest]
21+
# Too many things to fix, let's just ignore it for now
22+
#- repo: https://github.com/pre-commit/mirrors-mypy
23+
# rev: v1.8.0
24+
# hooks:
25+
# - id: mypy
26+
# exclude: ^(docs/|setup.py)

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include MANIFEST.in VERSION
22

33
include *.rst *.txt *.cfg site.cfg.example
44

5-
recursive-include numexpr *.cpp *.hpp *.py *.pyi py.typed
5+
recursive-include numexpr *.cpp *.hpp *.py
66
recursive-include numexpr/win32 *.c *.h
77
exclude numexpr/__config__.py RELEASING.txt site.cfg
88

RELEASE_NOTES.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Changes from 2.13.0 to 2.13.1
2525
* Patch to maximum/minimum functions in order to match NumPy NaN handling
2626
* Patch to convert '+'->'|' and '*'->'&' for booleans
2727
28-
2928
Changes from 2.12.1 to 2.13.0
3029
-----------------------------
3130

numexpr/__init__.py

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,62 +21,46 @@
2121
2222
"""
2323

24-
from typing import TYPE_CHECKING, Final
24+
from numexpr.interpreter import __BLOCK_SIZE1__, MAX_THREADS, use_vml
2525

26-
if TYPE_CHECKING:
27-
import unittest
28-
29-
# the `import _ as _` are needed for mypy to understand these are re-exports
30-
31-
from numexpr.interpreter import __BLOCK_SIZE1__ as __BLOCK_SIZE1__
32-
from numexpr.interpreter import MAX_THREADS as MAX_THREADS
33-
from numexpr.interpreter import use_vml as use_vml
34-
35-
is_cpu_amd_intel: Final = False # DEPRECATION WARNING: WILL BE REMOVED IN FUTURE RELEASE
26+
is_cpu_amd_intel = False # DEPRECATION WARNING: WILL BE REMOVED IN FUTURE RELEASE
3627

3728
# cpuinfo imports were moved into the test submodule function that calls them
3829
# to improve import times.
3930

40-
from numexpr.expressions import E as E
41-
from numexpr.necompiler import NumExpr as NumExpr
42-
from numexpr.necompiler import disassemble as disassemble
43-
from numexpr.necompiler import evaluate as evaluate
44-
from numexpr.necompiler import re_evaluate as re_evaluate
45-
from numexpr.necompiler import validate as validate
46-
from numexpr.utils import _init_num_threads
47-
from numexpr.utils import detect_number_of_cores as detect_number_of_cores
48-
from numexpr.utils import detect_number_of_threads as detect_number_of_threads
49-
from numexpr.utils import get_num_threads as get_num_threads
50-
from numexpr.utils import get_vml_version as get_vml_version
51-
from numexpr.utils import set_num_threads as set_num_threads
52-
from numexpr.utils import set_vml_accuracy_mode as set_vml_accuracy_mode
53-
from numexpr.utils import set_vml_num_threads as set_vml_num_threads
31+
from numexpr.expressions import E
32+
from numexpr.necompiler import (NumExpr, disassemble, evaluate, re_evaluate,
33+
validate)
34+
from numexpr.utils import (_init_num_threads, detect_number_of_cores,
35+
detect_number_of_threads, get_num_threads,
36+
get_vml_version, set_num_threads,
37+
set_vml_accuracy_mode, set_vml_num_threads)
5438

5539
# Detect the number of cores
56-
ncores: Final = detect_number_of_cores()
40+
ncores = detect_number_of_cores()
5741
# Initialize the number of threads to be used
58-
nthreads: Final = _init_num_threads()
42+
nthreads = _init_num_threads()
5943
# The default for VML is 1 thread (see #39)
6044
# set_vml_num_threads(1)
6145

62-
from . import version as version
46+
from . import version
6347

64-
__version__: Final = version.version
48+
__version__ = version.version
6549

66-
def print_versions() -> None:
50+
def print_versions():
6751
"""Print the versions of software that numexpr relies on."""
6852
try:
6953
import numexpr.tests
70-
return numexpr.tests.print_versions() # type: ignore[no-untyped-call]
54+
return numexpr.tests.print_versions()
7155
except ImportError:
7256
# To maintain Python 2.6 compatibility we have simple error handling
7357
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')
7458

75-
def test(verbosity: int = 1) -> "unittest.result.TestResult":
59+
def test(verbosity=1):
7660
"""Run all the tests in the test suite."""
7761
try:
7862
import numexpr.tests
79-
return numexpr.tests.test(verbosity=verbosity) # type: ignore[no-untyped-call]
63+
return numexpr.tests.test(verbosity=verbosity)
8064
except ImportError:
8165
# To maintain Python 2.6 compatibility we have simple error handling
8266
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')

0 commit comments

Comments
 (0)