Skip to content

Commit 08f4cdb

Browse files
committed
Moved gmsh lib from gitlab to github
1 parent 67027bf commit 08f4cdb

7 files changed

Lines changed: 27 additions & 70 deletions

File tree

.docker/fedora_43/dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,3 @@ RUN git clone --branch master --single-branch --depth 1 https://github.com/flexi
6666
ldconfig
6767

6868
WORKDIR /flexi
69-
70-
# Setup FLEXI with PGO
71-
# RUN git clone --branch master --single-branch --depth 1 git@gitlab.iag.uni-stuttgart.de:flexi/codes/pgo.git /pgo
72-
# RUN cmake -B build -DFLEXI_PERFORMANCE=ON -DFLEXI_PERFORMANCE_OPTLIFT=ON -DFLEXI_INSTRUCTION='-march=x86-64 -mtune=generic'
73-
# WORKDIR /flexi/build
74-
# RUN python /pgo/PGO.py

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ runs:
9898
source .venv/bin/activate
9999
100100
if [[ "${{ inputs.minimal }}" != "true" ]]; then
101-
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
101+
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
102102
uv pip install --no-cache-dir -e .
103103
fi
104104

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ variables:
8686
- uv venv .venv
8787
- source .venv/bin/activate
8888
# Regression checks needs NRG Gmsh, pre-install it
89-
- 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
89+
- 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
9090
# Install all pre-requisites
9191
- uv pip install --no-cache-dir -e .
9292
# Install coverage

.gmsh/build_macos.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,10 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s
221221
GMSH_DIR = os.path.join(WORK_DIR, 'gmsh')
222222
GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source')
223223

224-
# Gitlab "python-gmsh" access
225-
LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de'
226-
# LIB_PROJECT = 'libs/python-gmsh'
227-
LIB_PROJECT = '797'
228-
229-
230224
# Determine the number of available cores and leave 2 for other tasks
231225
total_cores = multiprocessing.cpu_count()
232226
build_cores = max(total_cores - 2, 1)
233227

234-
235228
# ------------------------------------------------------------------------
236229
# Version checks
237230
# ------------------------------------------------------------------------

.gmsh/build_manylinux.py

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,16 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s
223223
GMSH_DIR = os.path.join(WORK_DIR, 'gmsh')
224224
GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source')
225225

226-
# Gitlab "python-gmsh" access
227-
LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de'
228-
# LIB_PROJECT = 'libs/python-gmsh'
229-
LIB_PROJECT = '797'
230-
226+
# Github "python-gmsh" access
227+
LIB_GITHUB = 'github.com'
228+
LIB_OWNER = 'hopr-framework'
229+
LIB_PROJECT = 'python-gmsh'
230+
LIB_BRANCH = 'main'
231231

232232
# Determine the number of available cores and leave 2 for other tasks
233233
total_cores = multiprocessing.cpu_count()
234234
build_cores = max(total_cores - 2, 1)
235235

236-
237236
# ------------------------------------------------------------------------
238237
# Version checks
239238
# ------------------------------------------------------------------------
@@ -754,46 +753,14 @@ def build_fontconfig():
754753
def build_fltk():
755754
print_header('BUILDING FLTK')
756755

757-
# Add system libjpeg-turbo-devel to PATH
758-
# lfs = 'yes'
759-
# lib = f'libjpeg-turbo-devel-1.2.90-8.el7.{arch}'
760-
# 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
761-
# check=True,
762-
# cwd=BUILD_DIR,
763-
# shell=True)
764-
# extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
765-
#
766-
# # Move files into common directory
767-
# shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True)
768-
#
769-
# # Add system libpng-devel to PATH
770-
# lib = f'libpng-devel-1.5.13-8.el7.{arch}'
771-
# 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
772-
# check=True,
773-
# cwd=BUILD_DIR,
774-
# shell=True)
775-
# extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
776-
#
777-
# # Move files into common directory
778-
# shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True)
779-
#
780-
# os.environ['CPPFLAGS'] = '-I{}'.format( os.path.join(BUILD_DIR, 'include'))
781-
# subprocess.check_call(['yum', 'install', '-y', 'libjpeg-turbo-devel', 'libpng-devel'])
782-
783756
fltk_src_dir = os.path.join(BUILD_DIR, f'fltk-{FLTK_VERSION}')
784757
if os.path.exists(fltk_src_dir):
785758
shutil.rmtree(fltk_src_dir)
786759

787-
# url = f'https://www.fltk.org/pub/fltk/{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz'
788760
url = f'https://github.com/fltk/fltk/releases/download/release-{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz'
789-
# url = 'https://www.fltk.org/pub/fltk/snapshots/fltk-1.4.x-20241011-013e939c.tar.gz'
790761
file = download(url, BUILD_DIR)
791762
extract(file, BUILD_DIR)
792763

793-
# if os.path.isdir(f'{BUILD_DIR}/fltk-1.4.0'):
794-
# shutil.rmtree(f'{BUILD_DIR}/fltk-1.4.0')
795-
# subprocess.run(['mv', f'{BUILD_DIR}/fltk-1.4.x-20241011-013e939c', f'{BUILD_DIR}/fltk-1.4.0'], check=True)
796-
797764
conf_cmd = [
798765
'./configure',
799766
'--prefix={}'.format(FLTK_DIR),
@@ -1113,12 +1080,14 @@ def build_gmsh() -> None:
11131080

11141081
# Add system libGLU to PATH
11151082
lfs = 'yes'
1083+
branch = 'master'
11161084
lib = f'mesa-libGLU-9.0.0-4.el7.{arch}'
1117-
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
1085+
tar = f'{lib}.tar.gz'
1086+
subprocess.run([f'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501
11181087
check=True,
11191088
cwd=BUILD_DIR,
11201089
shell=True)
1121-
extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
1090+
extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR)
11221091
os.environ['PKG_CONFIG_PATH' ] = '{}'.format( os.path.join(BUILD_DIR, 'lib64', 'pkgconfig'))
11231092
os.environ['CMAKE_PREFIX_PATH' ] = '{}'.format( os.path.join(BUILD_DIR))
11241093
os.environ['CMAKE_LIBRARY_PATH'] = '{}'.format( os.path.join(BUILD_DIR, 'lib64' ))
@@ -1132,11 +1101,12 @@ def build_gmsh() -> None:
11321101
shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'lib64/') , os.path.join(WORK_DIR, 'build', 'lib64') , dirs_exist_ok=True)
11331102

11341103
lib = f'mesa-libGLU-devel-9.0.0-4.el7.{arch}'
1135-
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
1104+
tar = f'{lib}.tar.gz'
1105+
subprocess.run([f'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501
11361106
check=True,
11371107
cwd=BUILD_DIR,
11381108
shell=True)
1139-
extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
1109+
extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR)
11401110

11411111
# Move files into common directory
11421112
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 +1343,7 @@ def package() -> None:
13731343
dependencies = [] # Add any required dependencies
13741344
13751345
[project.urls]
1376-
homepage = 'https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh'
1346+
homepage = 'https://github.com/hopr-framework/python-gmsh'
13771347
13781348
[tool.setuptools]
13791349
packages = ['gmsh']

pyhope/common/common_vars.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ def commit(self) -> str:
136136

137137

138138
@final
139-
class Gitlab:
139+
class Github:
140140
# Gitlab "python-gmsh" access
141-
LIB_GITLAB: str = 'gitlab.iag.uni-stuttgart.de'
142-
# LIB_PROJECT = 'libs/python-gmsh'
143-
LIB_PROJECT: str = '797'
141+
LIB_GITHUB: str = 'github.com'
142+
LIB_OWNER: str = 'hopr-framework'
143+
LIB_PROJECT: str = 'python-gmsh'
144+
LIB_BRANCH: str = 'main'
144145
LIB_VERSION: dict[str, dict[str, str]] = { # noqa: RUF012
145146
'linux': {
146147
'x86_64' : '4.15.1.post1',

pyhope/gmsh/gmsh_install.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def PkgsCheckGmsh() -> None:
7070
# Local imports ----------------------------------------
7171
import pyhope.output.output as hopout
7272
from pyhope.common.common import IsInteractive
73-
from pyhope.common.common_vars import Gitlab
73+
from pyhope.common.common_vars import Github
7474
# ------------------------------------------------------
7575

7676
# Check the current platform
@@ -81,7 +81,7 @@ def PkgsCheckGmsh() -> None:
8181
if gmsh_version is None:
8282
# Gmsh is not installed
8383
if IsInteractive():
84-
if system in Gitlab.LIB_SUPPORT and arch in Gitlab.LIB_SUPPORT[system]:
84+
if system in Github.LIB_SUPPORT and arch in Github.LIB_SUPPORT[system]:
8585
print(hopout.warn('\n'))
8686
warning = 'Gmsh is not installed. For compatibility, the NRG Gmsh version will be installed. Continue? (Y/n):'
8787
response = input(hopout.warn(warning) + '\n')
@@ -109,7 +109,7 @@ def PkgsCheckGmsh() -> None:
109109
if PkgsMetaData('gmsh', 'Intended Audience :: NRG'):
110110
return None
111111

112-
if system not in Gitlab.LIB_SUPPORT or arch not in Gitlab.LIB_SUPPORT[system]:
112+
if system not in Github.LIB_SUPPORT or arch not in Github.LIB_SUPPORT[system]:
113113
warning = hopout.warn(f'Detected non-NRG Gmsh version on unsupported platform [{system}/{arch}]. ' +
114114
'Functionality may be limited.')
115115
print(warning)
@@ -138,7 +138,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
138138
import tempfile
139139
# Local imports ----------------------------------------
140140
import pyhope.output.output as hopout
141-
from pyhope.common.common_vars import Gitlab
141+
from pyhope.common.common_vars import Github
142142
# ------------------------------------------------------
143143
# Get our package manager
144144
# > Check if 'uv' is available
@@ -160,8 +160,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
160160

161161
if version == 'nrg':
162162
# Gitlab "python-gmsh" access
163-
lfs = 'yes'
164-
lib = f'gmsh-{Gitlab.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl'
163+
lib = f'gmsh-{Github.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl'
165164

166165
# Create a temporary directory
167166
with tempfile.TemporaryDirectory() as path:
@@ -173,7 +172,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
173172
else:
174173
pkgs = os.path.join(path, lib)
175174

176-
curl = [f'curl https://{Gitlab.LIB_GITLAB}/api/v4/projects/{Gitlab.LIB_PROJECT}/repository/files/{lib}/raw?lfs={lfs} --output {pkgs}'] # noqa: E501
175+
curl = [f'curl -L https://{Github.LIB_GITHUB}/{Github.LIB_OWNER}/{Github.LIB_PROJECT}/raw/refs/heads/{Github.LIB_BRANCH}/{lib}?download\= --output {pkgs}'] # noqa: E501
177176
_ = subprocess.run(curl, check=True, shell=True)
178177

179178
# Compare the hash
@@ -184,7 +183,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
184183
for chunk in iter(lambda: f.read(4096), b""):
185184
sha256.update(chunk)
186185

187-
if sha256.hexdigest() == Gitlab.LIB_SUPPORT[system][arch]:
186+
if sha256.hexdigest() == Github.LIB_SUPPORT[system][arch]:
188187
hopout.info('Hash matches, installing Gmsh wheel...')
189188
else:
190189
hopout.error('Hash mismatch, exiting...')

0 commit comments

Comments
 (0)