import os
import setuptools


here = os.path.abspath(os.path.dirname(__file__))
# Get __version__ variable
exec(open(os.path.join(here, 'pytorch_pfn_extras', '_version.py')).read())


setuptools.setup(
    name='pytorch-pfn-extras',
    version=__version__,        # NOQA
    description='Supplementary components to accelerate research and '
                'development in PyTorch.',
    author='Preferred Networks, Inc.',
    license='MIT License',
    install_requires=['numpy', 'torch'],
    extras_require={
        'test': ['pytest'],
        'onnx': ['onnx'],
    },
    python_requires='>=3.6.0',
    packages=setuptools.find_packages(exclude=['tests']),
    package_data={'pytorch_pfn_extras': ['py.typed']},
)

setup.py
import os
import setuptools


here = os.path.abspath(os.path.dirname(__file__))
# Get __version__ variable
exec(open(os.path.join(here, 'pytorch_pfn_extras', '_version.py')).read())


setuptools.setup(
    name='pytorch-pfn-extras',
    version=__version__,        # NOQA
    description='Supplementary components to accelerate research and '
                'development in PyTorch.',
    author='Preferred Networks, Inc.',
    license='MIT License',
    install_requires=['numpy', 'torch'],
    extras_require={
        'test': ['pytest'],
        'onnx': ['onnx'],
    },
    python_requires='>=3.6.0',
    packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
    package_data={'pytorch_pfn_extras': ['py.typed']},
)

setup.py
diff --git a/setup.py b/setup.py
index dbea96b73..9c5ab3a43 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,6 @@
         'onnx': ['onnx'],
     },
     python_requires='>=3.6.0',
-    packages=setuptools.find_packages(exclude=['tests']),
+    packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
     package_data={'pytorch_pfn_extras': ['py.typed']},
 )

Tests package is not correctly excluded
Currently test codes are installed to site-packages.

`setuptools.find_packages(exclude=['tests'])` needs to be fixed.
