Skip to content
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

Fix build and tests #14

Merged
merged 4 commits into from
Dec 9, 2023
Merged

Fix build and tests #14

merged 4 commits into from
Dec 9, 2023

Commits on Nov 28, 2023

  1. fix(build): replace relative cimports

    _check_error() from pyzoltan/core/zoltan.pyx was imported in .pyx files
    in pyzoltan/core/ without specifing full path from project root. With
    some configurations* this would result in some confusion while cythonizing.
    Seems like it is looking for zoltan.pxd in project root. The error
    reads:
    
    ```
    [3/3] Cythonizing pyzoltan/core/zoltan_dd.pyx
          /usr/share/miniconda/envs/test/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-req-build-ev58duqe/pyzoltan/core/zoltan_dd.pxd
            tree = Parsing.p_module(s, pxd, full_module_name)
    
          Error compiling Cython file:
          ------------------------------------------------------------
          ...
          """Example for the Zoltan Distributed data directory"""
          from zoltan cimport _check_error
          ^
          ------------------------------------------------------------
    
          pyzoltan/core/zoltan_dd.pyx:2:0: 'zoltan.pxd' not found
    
          Error compiling Cython file:
          ------------------------------------------------------------
          ...
          """Example for the Zoltan Distributed data directory"""
          from zoltan cimport _check_error
          ^
          ------------------------------------------------------------
    
          pyzoltan/core/zoltan_dd.pyx:2:0: 'zoltan/_check_error.pxd' not found
    
          Error compiling Cython file:
          ------------------------------------------------------------
          ...
    
                  """
                  self.comm = comm.ob_mpi
                  ierr = Zoltan_DD_Create(&self.dd, self.comm, 1, 1, 0, 0, 0)
    
                  _check_error( ierr )
                 ^
          ------------------------------------------------------------
    
          pyzoltan/core/zoltan_dd.pyx:31:8: '_check_error' is not a constant, variable or function identifier
    
          Error compiling Cython file:
          ------------------------------------------------------------
          ...
    
                  """
                  cdef int nentries = gid.length
                  ierr = Zoltan_DD_Update(self.dd, gid.data, NULL, NULL, part.data, nentries)
    
                  _check_error( ierr )
                 ^
          ------------------------------------------------------------
    
          pyzoltan/core/zoltan_dd.pyx:53:8: '_check_error' is not a constant, variable or function identifier
    
          Error compiling Cython file:
          ------------------------------------------------------------
          ...
                  own.resize( count )
                  part.resize( count )
    
                  ierr = Zoltan_DD_Find( self.dd, gid.data, NULL, NULL,
                                         part.data, count, own.data )
                  _check_error( ierr )
                 ^
          ------------------------------------------------------------
    
          pyzoltan/core/zoltan_dd.pyx:83:8: '_check_error' is not a constant, variable or function identifier
          Traceback (most recent call last):
            File "<string>", line 2, in <module>
            File "<pip-setuptools-caller>", line 34, in <module>
            File "/tmp/pip-req-build-ev58duqe/setup.py", line 423, in <module>
              setup_package()
            File "/tmp/pip-req-build-ev58duqe/setup.py", line 363, in setup_package
              ext_modules = cythonize(
                            ^^^^^^^^^^
            File "/usr/share/miniconda/envs/test/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize
              cythonize_one(*args)
            File "/usr/share/miniconda/envs/test/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one
              raise CompileError(None, pyx_file)
          Cython.Compiler.Errors.CompileError: pyzoltan/core/zoltan_dd.pyx
    ```
    
    doing away with relative imports seems to fix this
    nauaneed committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    807d194 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    24f505f View commit details
    Browse the repository at this point in the history
  3. chore(deps): pin cython<3.0

    nauaneed committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    8b3713e View commit details
    Browse the repository at this point in the history
  4. ci(gha): install cython, numpy bfore build cyarray

    Since cyarray contains cython and numpy as build requirements in
    pyproject.toml, pip should install cython and numpy install before
    cyarray. See https://stackoverflow.com/a/54138355
    
    However, it seems like this does not happen and the numpy import in
    cyarray's setup.py fails with ModuleNotFoundError. So, cython and
    numpy are installed before.
    
    Also installing cyarray/master, not from pypi
    nauaneed committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    4701dcf View commit details
    Browse the repository at this point in the history