diff --git a/.docker/fedora_43/dockerfile b/.docker/fedora_43/dockerfile index 00646f12..69b31731 100644 --- a/.docker/fedora_43/dockerfile +++ b/.docker/fedora_43/dockerfile @@ -66,9 +66,3 @@ RUN git clone --branch master --single-branch --depth 1 https://github.com/flexi ldconfig WORKDIR /flexi - -# Setup FLEXI with PGO -# RUN git clone --branch master --single-branch --depth 1 git@gitlab.iag.uni-stuttgart.de:flexi/codes/pgo.git /pgo -# RUN cmake -B build -DFLEXI_PERFORMANCE=ON -DFLEXI_PERFORMANCE_OPTLIFT=ON -DFLEXI_INSTRUCTION='-march=x86-64 -mtune=generic' -# WORKDIR /flexi/build -# RUN python /pgo/PGO.py diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 6b063b49..09c24f67 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -98,7 +98,7 @@ runs: source .venv/bin/activate if [[ "${{ inputs.minimal }}" != "true" ]]; then - uv pip install --no-cache-dir https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl + uv pip install --no-cache-dir https://github.com/hopr-framework/python-gmsh/raw/refs/heads/main/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl uv pip install --no-cache-dir -e . fi diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9614746..a3b50014 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,7 +86,7 @@ variables: - uv venv .venv - source .venv/bin/activate # Regression checks needs NRG Gmsh, pre-install it - - uv pip install --no-cache-dir https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl + - uv pip install --no-cache-dir https://github.com/hopr-framework/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl # Install all pre-requisites - uv pip install --no-cache-dir -e . # Install coverage diff --git a/.gmsh/build_macos.py b/.gmsh/build_macos.py index a7cd2327..a3a2e8d3 100755 --- a/.gmsh/build_macos.py +++ b/.gmsh/build_macos.py @@ -221,17 +221,10 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s GMSH_DIR = os.path.join(WORK_DIR, 'gmsh') GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source') -# Gitlab "python-gmsh" access -LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de' -# LIB_PROJECT = 'libs/python-gmsh' -LIB_PROJECT = '797' - - # Determine the number of available cores and leave 2 for other tasks total_cores = multiprocessing.cpu_count() build_cores = max(total_cores - 2, 1) - # ------------------------------------------------------------------------ # Version checks # ------------------------------------------------------------------------ diff --git a/.gmsh/build_manylinux.py b/.gmsh/build_manylinux.py index b6a41e50..a3827311 100755 --- a/.gmsh/build_manylinux.py +++ b/.gmsh/build_manylinux.py @@ -223,17 +223,16 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s GMSH_DIR = os.path.join(WORK_DIR, 'gmsh') GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source') -# Gitlab "python-gmsh" access -LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de' -# LIB_PROJECT = 'libs/python-gmsh' -LIB_PROJECT = '797' - +# Github "python-gmsh" access +LIB_GITHUB = 'github.com' +LIB_OWNER = 'hopr-framework' +LIB_PROJECT = 'python-gmsh' +LIB_BRANCH = 'main' # Determine the number of available cores and leave 2 for other tasks total_cores = multiprocessing.cpu_count() build_cores = max(total_cores - 2, 1) - # ------------------------------------------------------------------------ # Version checks # ------------------------------------------------------------------------ @@ -754,46 +753,14 @@ def build_fontconfig(): def build_fltk(): print_header('BUILDING FLTK') - # Add system libjpeg-turbo-devel to PATH - # lfs = 'yes' - # lib = f'libjpeg-turbo-devel-1.2.90-8.el7.{arch}' - # subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501 - # check=True, - # cwd=BUILD_DIR, - # shell=True) - # extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR) - # - # # Move files into common directory - # shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True) - # - # # Add system libpng-devel to PATH - # lib = f'libpng-devel-1.5.13-8.el7.{arch}' - # subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501 - # check=True, - # cwd=BUILD_DIR, - # shell=True) - # extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR) - # - # # Move files into common directory - # shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True) - # - # os.environ['CPPFLAGS'] = '-I{}'.format( os.path.join(BUILD_DIR, 'include')) - # subprocess.check_call(['yum', 'install', '-y', 'libjpeg-turbo-devel', 'libpng-devel']) - fltk_src_dir = os.path.join(BUILD_DIR, f'fltk-{FLTK_VERSION}') if os.path.exists(fltk_src_dir): shutil.rmtree(fltk_src_dir) - # url = f'https://www.fltk.org/pub/fltk/{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz' url = f'https://github.com/fltk/fltk/releases/download/release-{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz' - # url = 'https://www.fltk.org/pub/fltk/snapshots/fltk-1.4.x-20241011-013e939c.tar.gz' file = download(url, BUILD_DIR) extract(file, BUILD_DIR) - # if os.path.isdir(f'{BUILD_DIR}/fltk-1.4.0'): - # shutil.rmtree(f'{BUILD_DIR}/fltk-1.4.0') - # subprocess.run(['mv', f'{BUILD_DIR}/fltk-1.4.x-20241011-013e939c', f'{BUILD_DIR}/fltk-1.4.0'], check=True) - conf_cmd = [ './configure', '--prefix={}'.format(FLTK_DIR), @@ -1112,13 +1079,13 @@ def build_gmsh() -> None: # subprocess.check_call(['yum', 'install', '-y', 'mesa-libGLU-devel']) # Add system libGLU to PATH - lfs = 'yes' lib = f'mesa-libGLU-9.0.0-4.el7.{arch}' - subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501 + tar = f'{lib}.tar.gz' + subprocess.run([rf'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501 check=True, cwd=BUILD_DIR, shell=True) - extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR) + extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR) os.environ['PKG_CONFIG_PATH' ] = '{}'.format( os.path.join(BUILD_DIR, 'lib64', 'pkgconfig')) os.environ['CMAKE_PREFIX_PATH' ] = '{}'.format( os.path.join(BUILD_DIR)) os.environ['CMAKE_LIBRARY_PATH'] = '{}'.format( os.path.join(BUILD_DIR, 'lib64' )) @@ -1132,11 +1099,12 @@ def build_gmsh() -> None: shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'lib64/') , os.path.join(WORK_DIR, 'build', 'lib64') , dirs_exist_ok=True) lib = f'mesa-libGLU-devel-9.0.0-4.el7.{arch}' - subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501 + tar = f'{lib}.tar.gz' + subprocess.run([rf'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501 check=True, cwd=BUILD_DIR, shell=True) - extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR) + extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR) # Move files into common directory shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'lib64/') , os.path.join(WORK_DIR, 'build', 'lib64' ) , dirs_exist_ok=True, symlinks=True) # noqa: E501 @@ -1373,7 +1341,7 @@ def package() -> None: dependencies = [] # Add any required dependencies [project.urls] - homepage = 'https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh' + homepage = 'https://github.com/hopr-framework/python-gmsh' [tool.setuptools] packages = ['gmsh'] diff --git a/pyhope/common/common_vars.py b/pyhope/common/common_vars.py index a0e6dc1a..7eccb26d 100644 --- a/pyhope/common/common_vars.py +++ b/pyhope/common/common_vars.py @@ -136,11 +136,12 @@ def commit(self) -> str: @final -class Gitlab: +class Github: # Gitlab "python-gmsh" access - LIB_GITLAB: str = 'gitlab.iag.uni-stuttgart.de' - # LIB_PROJECT = 'libs/python-gmsh' - LIB_PROJECT: str = '797' + LIB_GITHUB: str = 'github.com' + LIB_OWNER: str = 'hopr-framework' + LIB_PROJECT: str = 'python-gmsh' + LIB_BRANCH: str = 'main' LIB_VERSION: dict[str, dict[str, str]] = { # noqa: RUF012 'linux': { 'x86_64' : '4.15.1.post1', diff --git a/pyhope/gmsh/gmsh_install.py b/pyhope/gmsh/gmsh_install.py index a4bbb548..94409c94 100644 --- a/pyhope/gmsh/gmsh_install.py +++ b/pyhope/gmsh/gmsh_install.py @@ -70,7 +70,7 @@ def PkgsCheckGmsh() -> None: # Local imports ---------------------------------------- import pyhope.output.output as hopout from pyhope.common.common import IsInteractive - from pyhope.common.common_vars import Gitlab + from pyhope.common.common_vars import Github # ------------------------------------------------------ # Check the current platform @@ -81,7 +81,7 @@ def PkgsCheckGmsh() -> None: if gmsh_version is None: # Gmsh is not installed if IsInteractive(): - if system in Gitlab.LIB_SUPPORT and arch in Gitlab.LIB_SUPPORT[system]: + if system in Github.LIB_SUPPORT and arch in Github.LIB_SUPPORT[system]: print(hopout.warn('\n')) warning = 'Gmsh is not installed. For compatibility, the NRG Gmsh version will be installed. Continue? (Y/n):' response = input(hopout.warn(warning) + '\n') @@ -109,7 +109,7 @@ def PkgsCheckGmsh() -> None: if PkgsMetaData('gmsh', 'Intended Audience :: NRG'): return None - if system not in Gitlab.LIB_SUPPORT or arch not in Gitlab.LIB_SUPPORT[system]: + if system not in Github.LIB_SUPPORT or arch not in Github.LIB_SUPPORT[system]: warning = hopout.warn(f'Detected non-NRG Gmsh version on unsupported platform [{system}/{arch}]. ' + 'Functionality may be limited.') print(warning) @@ -138,7 +138,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None: import tempfile # Local imports ---------------------------------------- import pyhope.output.output as hopout - from pyhope.common.common_vars import Gitlab + from pyhope.common.common_vars import Github # ------------------------------------------------------ # Get our package manager # > Check if 'uv' is available @@ -160,8 +160,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None: if version == 'nrg': # Gitlab "python-gmsh" access - lfs = 'yes' - lib = f'gmsh-{Gitlab.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl' + lib = f'gmsh-{Github.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl' # Create a temporary directory with tempfile.TemporaryDirectory() as path: @@ -173,7 +172,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None: else: pkgs = os.path.join(path, lib) - curl = [f'curl https://{Gitlab.LIB_GITLAB}/api/v4/projects/{Gitlab.LIB_PROJECT}/repository/files/{lib}/raw?lfs={lfs} --output {pkgs}'] # noqa: E501 + curl = [rf'curl -L https://{Github.LIB_GITHUB}/{Github.LIB_OWNER}/{Github.LIB_PROJECT}/raw/refs/heads/{Github.LIB_BRANCH}/{lib}?download\= --output {pkgs}'] # noqa: E501 _ = subprocess.run(curl, check=True, shell=True) # Compare the hash @@ -184,7 +183,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None: for chunk in iter(lambda: f.read(4096), b""): sha256.update(chunk) - if sha256.hexdigest() == Gitlab.LIB_SUPPORT[system][arch]: + if sha256.hexdigest() == Github.LIB_SUPPORT[system][arch]: hopout.info('Hash matches, installing Gmsh wheel...') else: hopout.error('Hash mismatch, exiting...')