import distutils.sysconfig
from glob import glob
import os
from os.path import join as pjoin, basename
from shutil import copy
from sys import platform

def main():
    """
    Copy HDF5 DLLs into installed h5py package
    """
    # This is the function Tox also uses to locate site-packages (Apr 2019)
    sitepackagesdir = distutils.sysconfig.get_python_lib(plat_specific=True)
    print("site packages dir:", sitepackagesdir)

    hdf5_path = os.environ.get("HDF5_DIR")
    print("HDF5_DIR", hdf5_path)

    # HDF5_DIR is not set when we're testing wheels; these should already have
    # the necessary libraries bundled in.
    if platform.startswith('win') and hdf5_path is not None:
        for f in glob(pjoin(hdf5_path, 'lib/*.dll')):
            copy(f, pjoin(sitepackagesdir, 'h5py', basename(f)))
            print("Copied", f)

        zlib_root = os.environ.get("ZLIB_ROOT")
        if zlib_root:
            f = pjoin(zlib_root, 'bin_release', 'zlib.dll')
            copy(f, pjoin(sitepackagesdir, 'h5py', 'zlib.dll'))
            print("Copied", f)

    print("In installed h5py:", os.listdir(pjoin(sitepackagesdir, 'h5py')))

if __name__ == '__main__':
    main()

import distutils.sysconfig
from glob import glob
import os
from os.path import join as pjoin, basename
from shutil import copy
from sys import platform

def main():
    """
    Copy HDF5 DLLs into installed h5py package
    """
    # This is the function Tox also uses to locate site-packages (Apr 2019)
    sitepackagesdir = distutils.sysconfig.get_python_lib(plat_specific=True)
    print("site packages dir:", sitepackagesdir)

    hdf5_path = os.environ.get("HDF5_DIR")
    print("HDF5_DIR", hdf5_path)

    # HDF5_DIR is not set when we're testing wheels; these should already have
    # the necessary libraries bundled in.
    if platform.startswith('win') and hdf5_path is not None:
        for f in glob(pjoin(hdf5_path, 'lib/*.dll')):
            copy(f, pjoin(sitepackagesdir, 'h5py', basename(f)))
            print("Copied", f)

        zlib_root = os.environ.get("ZLIB_ROOT")
        if zlib_root:
            f = pjoin(zlib_root, 'bin_release', 'zlib.dll')
            copy(f, pjoin(sitepackagesdir, 'h5py', 'zlib.dll'))
            print("Copied", f)

        print("In installed h5py:", sorted(os.listdir(pjoin(sitepackagesdir, 'h5py'))))

if __name__ == '__main__':
    main()

Sort list of files inside h5py
Sort list of files inside h5py

  import distutils.sysconfig
  from glob import glob
  import os
  from os.path import join as pjoin, basename
  from shutil import copy
  from sys import platform
  
  def main():
      """
      Copy HDF5 DLLs into installed h5py package
      """
      # This is the function Tox also uses to locate site-packages (Apr 2019)
      sitepackagesdir = distutils.sysconfig.get_python_lib(plat_specific=True)
      print("site packages dir:", sitepackagesdir)
  
      hdf5_path = os.environ.get("HDF5_DIR")
      print("HDF5_DIR", hdf5_path)
  
      # HDF5_DIR is not set when we're testing wheels; these should already have
      # the necessary libraries bundled in.
      if platform.startswith('win') and hdf5_path is not None:
          for f in glob(pjoin(hdf5_path, 'lib/*.dll')):
              copy(f, pjoin(sitepackagesdir, 'h5py', basename(f)))
              print("Copied", f)
  
          zlib_root = os.environ.get("ZLIB_ROOT")
          if zlib_root:
              f = pjoin(zlib_root, 'bin_release', 'zlib.dll')
              copy(f, pjoin(sitepackagesdir, 'h5py', 'zlib.dll'))
              print("Copied", f)
  
-     print("In installed h5py:", os.listdir(pjoin(sitepackagesdir, 'h5py')))
+         print("In installed h5py:", sorted(os.listdir(pjoin(sitepackagesdir, 'h5py'))))
  
  if __name__ == '__main__':
      main()
  
Sort list of files inside h5py
## Code Before:
import distutils.sysconfig
from glob import glob
import os
from os.path import join as pjoin, basename
from shutil import copy
from sys import platform

def main():
    """
    Copy HDF5 DLLs into installed h5py package
    """
    # This is the function Tox also uses to locate site-packages (Apr 2019)
    sitepackagesdir = distutils.sysconfig.get_python_lib(plat_specific=True)
    print("site packages dir:", sitepackagesdir)

    hdf5_path = os.environ.get("HDF5_DIR")
    print("HDF5_DIR", hdf5_path)

    # HDF5_DIR is not set when we're testing wheels; these should already have
    # the necessary libraries bundled in.
    if platform.startswith('win') and hdf5_path is not None:
        for f in glob(pjoin(hdf5_path, 'lib/*.dll')):
            copy(f, pjoin(sitepackagesdir, 'h5py', basename(f)))
            print("Copied", f)

        zlib_root = os.environ.get("ZLIB_ROOT")
        if zlib_root:
            f = pjoin(zlib_root, 'bin_release', 'zlib.dll')
            copy(f, pjoin(sitepackagesdir, 'h5py', 'zlib.dll'))
            print("Copied", f)

    print("In installed h5py:", os.listdir(pjoin(sitepackagesdir, 'h5py')))

if __name__ == '__main__':
    main()

## Instruction:
Sort list of files inside h5py
## Code After:
import distutils.sysconfig
from glob import glob
import os
from os.path import join as pjoin, basename
from shutil import copy
from sys import platform

def main():
    """
    Copy HDF5 DLLs into installed h5py package
    """
    # This is the function Tox also uses to locate site-packages (Apr 2019)
    sitepackagesdir = distutils.sysconfig.get_python_lib(plat_specific=True)
    print("site packages dir:", sitepackagesdir)

    hdf5_path = os.environ.get("HDF5_DIR")
    print("HDF5_DIR", hdf5_path)

    # HDF5_DIR is not set when we're testing wheels; these should already have
    # the necessary libraries bundled in.
    if platform.startswith('win') and hdf5_path is not None:
        for f in glob(pjoin(hdf5_path, 'lib/*.dll')):
            copy(f, pjoin(sitepackagesdir, 'h5py', basename(f)))
            print("Copied", f)

        zlib_root = os.environ.get("ZLIB_ROOT")
        if zlib_root:
            f = pjoin(zlib_root, 'bin_release', 'zlib.dll')
            copy(f, pjoin(sitepackagesdir, 'h5py', 'zlib.dll'))
            print("Copied", f)

        print("In installed h5py:", sorted(os.listdir(pjoin(sitepackagesdir, 'h5py'))))

if __name__ == '__main__':
    main()
