8000 MAINT: resolve pyflake F403 'from module import *' used by mwtoews · Pull Request #15366 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: resolve pyflake F403 'from module import *' used #15366

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

Merged
merged 1 commit into from
Jan 23, 2020
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.
< 8000 div class="select-menu-loading-overlay d-flex flex-items-center flex-justify-center"> Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
MAINT: resolve pyflake F403 'from module import *' used
* For external modules, resolve imported members
* Most internal relative modules were ignored or marked noqa: F403
* Convert a few internal absolute imports to relative imports
  • Loading branch information
mwtoews committed Jan 22, 2020
commit f9c5bd5ed1c241b189cea6cf5aef750526194708
4 changes: 2 additions & 2 deletions numpy/core/multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from . import overrides
from . import _multiarray_umath
import numpy as np
from numpy.core._multiarray_umath import *
from numpy.core._multiarray_umath import (
from ._multiarray_umath import * # noqa: F403
from ._multiarray_umath import (
_fastCopyAndTranspose, _flagdict, _insert, _reconstruct, _vec_string,
_ARRAY_API, _monotonicity, _get_ndarray_c_version
)
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
uses_accelerate_framework, get_sgemv_fix
)
from numpy.compat import npy_load_module
from setup_common import *
from setup_common import * # noqa: F403
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, I had difficulties making this into either a relative or absolute import. I can't recall exactly, but I think I tried from .setup_common import * and from numpy.core.setup_common import *, but both bombed Travis CI tests. If anyone knows why, I'd be interested.


# Set to True to enable relaxed strides checking. This (mostly) means
# that `strides[dim]` is ignored if `shape[dim] == 1` when setting flags.
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/tests/test_umath_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import path
import sys
import pytest
from ctypes import *
from ctypes import c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp

runtest = sys.platform.startswith('linux') and (platform.machine() == 'x86_64')
Expand Down
4 changes: 2 additions & 2 deletions numpy/core/umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"""

from . import _multiarray_umath
from numpy.core._multiarray_umath import *
from numpy.core._multiarray_umath import (
from ._multiarray_umath import * # noqa: F403
from ._multiarray_umath import (
_UFUNC_API, _add_newdoc_ufunc, _ones_like
)

Expand Down
11 changes: 8 additions & 3 deletions numpy/distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
import subprocess
from copy import copy
from distutils import ccompiler
from distutils.ccompiler import *
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
DistutilsPlatformError, CompileError
from distutils.ccompiler import (
compiler_class, gen_lib_options, get_default_compiler, new_compiler,
CCompiler
)
from distutils.errors import (
DistutilsExecError, DistutilsModuleError, DistutilsPlatformError,
CompileError, UnknownFileError
)
from distutils.sysconfig import customize_compiler
from distutils.version import LooseVersion

Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from distutils.core import *
from distutils.core import Distribution, setup

if 'setuptools' in sys.modules:
have_setuptools = True
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/log.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Colored log, requires Python 2.3 or up.
import sys
from distutils.log import *
from distutils.log import * # noqa: F403
from distutils.log import Log as old_Log
from distutils.log import _global_log

Expand Down
4 changes: 2 additions & 2 deletions numpy/distutils/unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""
import os

from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from distutils.errors import CompileError, DistutilsExecError, LibError
from distutils.unixccompiler import UnixCCompiler
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.misc_util import _commandline_dep_string
from numpy.distutils import log
Expand Down
2 changes: 1 addition & 1 deletion numpy/matlib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
# need * as we're copying the numpy namespace (FIXME: this makes little sense)
from numpy import *
from numpy import * # noqa: F403

__version__ = np.__version__

Expand Down
2 changes: 1 addition & 1 deletion tools/swig/test/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python
# System imports
from distutils.core import *
from distutils.core import Extension, setup
from distutils import sysconfig

# Third-party modules - we depend on numpy for everything
Expand Down
0