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

Lint recipes #40

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/check-magix3d.yml

This file was deleted.

93 changes: 93 additions & 0 deletions .github/workflows/check-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Check push

on:
[push, pull_request]

jobs:
lint-recipes:
name: Lint Recipes
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Flake8 on meshing
uses: py-actions/flake8@v2
with:
ignore: "E501,F405,F403"
path: "meshing"

- name: Flake8 on meshing_supersede
uses: py-actions/flake8@v2
with:
ignore: "E501,F405,F403,W504"
path: "meshing_supersede"

spack-spec-mgx3d:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Linux, Windows or Mac.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
name: Spack Spec Magix3D
runs-on: ubuntu-latest
needs: [lint-recipes]
strategy:
fail-fast: false

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # seems to be needed by codecov
submodules: recursive

- name: Initialize Spack environment
shell: bash
run: |
git clone --depth=1 -b releases/latest https://github.com/spack/spack.git ${{github.workspace}}/spack
source ${{github.workspace}}/spack/share/spack/setup-env.sh
spack repo add ${{github.workspace}}/meshing
spack repo add ${{github.workspace}}/meshing_supersede

- name: Check Spack spec
# We create a subdirectory that will stand as our working directory for all
# subsequent commands
run: |
source ${{github.workspace}}/spack/share/spack/setup-env.sh
spack spec magix3d~smooth3d~pythonaddon+doc ^vtk-maillage~opengl2+qt ^qt+opengl

spack-install-mgx3d:
# Do not replace $GITHUB_WORKSPACE by ${{github.workspace}}
# See https://github.com/actions/runner/issues/2058
name: Spack Install Magix3D
runs-on: ubuntu-latest
needs: [spack-spec-mgx3d]
container:
image: ghcr.io/lihpc-computational-geometry/spack-cgcore:latest
strategy:
fail-fast: false

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # seems to be needed by codecov
submodules: recursive

- name: Initialize Spack Environment
shell: bash
run: |
source /spack/share/spack/setup-env.sh
spack repo add $GITHUB_WORKSPACE/meshing
spack repo add $GITHUB_WORKSPACE/meshing_supersede

- name: Build and Install Magix3D
shell: bash
run: |
source /spack/share/spack/setup-env.sh
spack env activate meshing-env
spack add magix3d~smooth3d~pythonaddon+doc ^vtk-maillage~opengl2+qt ^qt+opengl
spack install -v --no-checksum
28 changes: 0 additions & 28 deletions .github/workflows/check-recipes-style.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/check-spec-magix3d.yml

This file was deleted.

4 changes: 3 additions & 1 deletion meshing_supersede/packages/cgal/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def cmake_args(self):
# Installation instructions:
# https://doc.cgal.org/latest/Manual/installation.html
spec = self.spec
variant_bool = lambda feature: str(feature in spec)

def variant_bool(feature):
str(feature in spec)
cmake_args = []

cmake_args.append("-DBUILD_SHARED_LIBS:BOOL=%s" % variant_bool("+shared"))
Expand Down
11 changes: 6 additions & 5 deletions meshing_supersede/packages/omniorb-anl/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@
#
from spack import *


#
# omniORB 4.1.7 de ATT tres legerement retouche pour qu'il puisse s'installe dans
# omniORB 4.1.7 de ATT tres legerement retouche pour qu'il puisse s'installe dans
# un environnement spack (de base il y a un probleme de shebang ...)
#
class OmniorbAnl(AutotoolsPackage):
"""ORB de ATT"""

homepage = ""
url = "omniorb-anl-4.1.7.tar.gz"
url = "omniorb-anl-4.1.7.tar.gz"
version('4.1.7', sha256='3f42d97cb0344afb25c3b203ec874ad3d2ea944ea75a16bcb5e084c66273691d')
version('4.3.0')

# On a besoin de 2.7 <= python < 3.0.0 :
# depends_on('python@2.7:', type=('link'))
# depends_on('python@:2.7.16', type=('build', 'link'))
# On a besoin de 2.7 <= python < 3.0.0 :
# depends_on('python@2.7:', type=('link'))
# depends_on('python@:2.7.16', type=('build', 'link'))
depends_on('python@:2.7.16', type='run', when="@:4.2.99")
depends_on('python@3:', type='run', when="@4.3.0:")

Expand Down
21 changes: 9 additions & 12 deletions meshing_supersede/packages/opencascade/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class Opencascade(CMakePackage):


##############################################
# WARNING this supersedes the upstream recipe
# WARNING this supersedes the upstream recipe
##############################################

homepage = "https://www.opencascade.com"
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_1_0;sf=tgz"
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_1_0;sf=tgz"

# version('7.4.0', extension='tar.gz',
# sha256='1eace85115ea178f268e9d803ced994b66b72455b5484074b6ad7f643261f0a0')
Expand All @@ -38,7 +38,7 @@ def url_for_version(self, version):

# modifications for internal use
patch('opencascade-7.1.0_a.patch', when='@7.1.0')

variant('tbb', default=False,
description='Build with Intel Threading Building Blocks')
variant('vtk', default=False,
Expand All @@ -60,14 +60,13 @@ def url_for_version(self, version):
variant('draw', default=False,
description='Sets BUILD_MODULE_Draw')
variant('foundationclasses', default=False,
description='Sets BUILD_MODULE_FoundationClasses (probably always ON)' )
description='Sets BUILD_MODULE_FoundationClasses (probably always ON)')
variant('modelingalgorithm', default=False,
description='Sets BUILD_MODULE_ModelingAlgorithm')
variant('modelingdata', default=False,
description='Sets BUILD_MODULE_ModelingData')
variant('visualization', default=False,
description='Sets BUILD_MODULE_Visualization')


depends_on('intel-tbb', when='+tbb')
depends_on('vtk', when='+vtk')
Expand All @@ -76,7 +75,6 @@ def url_for_version(self, version):
depends_on('gl2ps', when='@7.1.0+gl2ps')
depends_on('doxygen', when='+documentation')


depends_on('freetype')
depends_on('tcl')

Expand All @@ -87,11 +85,11 @@ def url_for_version(self, version):

depends_on('gl')

# those two libraries are always used at link phase, but it could be a
# remnant of the optionnal gl2ps module. We might be able to remove
# those two libraries are always used at link phase, but it could be a
# remnant of the optionnal gl2ps module. We might be able to remove
# those dependencies in a future release of OCC.
depends_on('libxmu', type=('build','link'))
depends_on('libxi', type=('build','link'))
depends_on('libxmu', type=('build', 'link'))
depends_on('libxi', type=('build', 'link'))

def cmake_args(self):
args = []
Expand Down Expand Up @@ -131,7 +129,6 @@ def cmake_args(self):
else:
args.append('-DUSE_GL2PS=OFF')


if '+documentation' in self.spec:
args.append('-DBUILD_DOC_Overview=ON')
else:
Expand All @@ -151,7 +148,7 @@ def cmake_args(self):
args.append('-DBUILD_MODULE_Draw=ON')
else:
args.append('-DBUILD_MODULE_Draw=OFF')

if '+foundationclasses' in self.spec:
args.append('-DBUILD_MODULE_FoundationClasses=ON')
else:
Expand Down
Loading