Skip to content

Commit

Permalink
Fix bugs for installing pyquda with pycparser already installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyChiang committed Mar 8, 2024
1 parent fa1bb53 commit ec01e93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyquda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SupportsWriteAndFlush(SupportsWrite[_T_contra], SupportsFlush, Protocol[_T

from mpi4py import MPI

__version__ = "0.6.2"
from .version import __version__ # noqa: F401
from . import pyquda as quda
from .field import LatticeInfo

Expand Down
1 change: 1 addition & 0 deletions pyquda/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.6.3"
8 changes: 5 additions & 3 deletions pyquda_pyx.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def build_pyquda_pyx(pyquda_root, quda_path):
print(f"Building pyquda wrapper from {os.path.join(quda_include, 'quda.h')}")
try:
from pycparser import parse_file, c_ast
except ModuleNotFoundError:
except ImportError or ModuleNotFoundError:
from pycparser.pycparser import parse_file, c_ast

def evaluate(node):
Expand Down Expand Up @@ -316,5 +316,7 @@ def evaluate(node):
# with open(os.path.join(pyquda_root, "pyquda", "pyquda.pyi"), "w") as f:
# f.write(pyquda_pyi)

os.remove(os.path.join(pyquda_root, "yacctab.py"))
os.remove(os.path.join(pyquda_root, "lextab.py"))
if os.path.exists(os.path.join(pyquda_root, "yacctab.py")):
os.remove(os.path.join(pyquda_root, "yacctab.py"))
if os.path.exists(os.path.join(pyquda_root, "lextab.py")):
os.remove(os.path.join(pyquda_root, "lextab.py"))
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = PyQuda
version = attr: pyquda.__version__
version = attr: pyquda.version.__version__
url = https://github.com/CLQCD/PyQuda
author = SaltyChiang
author_email = [email protected]
Expand Down

0 comments on commit ec01e93

Please sign in to comment.