Skip to content

Commit ba2d9f6

Browse files
authored
Lint recipes (#40)
* Test CI with 2 jobs * Fix condition on second job * Fix linter errors * Merge CIs * Fix linter errors on recipes * Change job name * Do not replace $GITHUB_WORKSPACE by ${{github.workspace}}
1 parent 3380734 commit ba2d9f6

File tree

8 files changed

+152
-162
lines changed

8 files changed

+152
-162
lines changed

.github/workflows/check-magix3d.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/check-push.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Check push
2+
3+
on:
4+
[push, pull_request]
5+
6+
jobs:
7+
lint-recipes:
8+
name: Lint Recipes
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Flake8 on meshing
19+
uses: py-actions/flake8@v2
20+
with:
21+
ignore: "E501,F405,F403"
22+
path: "meshing"
23+
24+
- name: Flake8 on meshing_supersede
25+
uses: py-actions/flake8@v2
26+
with:
27+
ignore: "E501,F405,F403,W504"
28+
path: "meshing_supersede"
29+
30+
spack-spec-mgx3d:
31+
# The CMake configure and build commands are platform agnostic and should work equally
32+
# well on Linux, Windows or Mac.
33+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
34+
name: Spack Spec Magix3D
35+
runs-on: ubuntu-latest
36+
needs: [lint-recipes]
37+
strategy:
38+
fail-fast: false
39+
40+
steps:
41+
- name: Checkout Repository
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 2 # seems to be needed by codecov
45+
submodules: recursive
46+
47+
- name: Initialize Spack environment
48+
shell: bash
49+
run: |
50+
git clone --depth=1 -b releases/latest https://github.com/spack/spack.git ${{github.workspace}}/spack
51+
source ${{github.workspace}}/spack/share/spack/setup-env.sh
52+
spack repo add ${{github.workspace}}/meshing
53+
spack repo add ${{github.workspace}}/meshing_supersede
54+
55+
- name: Check Spack spec
56+
# We create a subdirectory that will stand as our working directory for all
57+
# subsequent commands
58+
run: |
59+
source ${{github.workspace}}/spack/share/spack/setup-env.sh
60+
spack spec magix3d~smooth3d~pythonaddon+doc ^vtk-maillage~opengl2+qt ^qt+opengl
61+
62+
spack-install-mgx3d:
63+
# Do not replace $GITHUB_WORKSPACE by ${{github.workspace}}
64+
# See https://github.com/actions/runner/issues/2058
65+
name: Spack Install Magix3D
66+
runs-on: ubuntu-latest
67+
needs: [spack-spec-mgx3d]
68+
container:
69+
image: ghcr.io/lihpc-computational-geometry/spack-cgcore:latest
70+
strategy:
71+
fail-fast: false
72+
73+
steps:
74+
- name: Checkout Repository
75+
uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 2 # seems to be needed by codecov
78+
submodules: recursive
79+
80+
- name: Initialize Spack Environment
81+
shell: bash
82+
run: |
83+
source /spack/share/spack/setup-env.sh
84+
spack repo add $GITHUB_WORKSPACE/meshing
85+
spack repo add $GITHUB_WORKSPACE/meshing_supersede
86+
87+
- name: Build and Install Magix3D
88+
shell: bash
89+
run: |
90+
source /spack/share/spack/setup-env.sh
91+
spack env activate meshing-env
92+
spack add magix3d~smooth3d~pythonaddon+doc ^vtk-maillage~opengl2+qt ^qt+opengl
93+
spack install -v --no-checksum

.github/workflows/check-recipes-style.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/check-spec-magix3d.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

meshing_supersede/packages/cgal/package.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def cmake_args(self):
104104
# Installation instructions:
105105
# https://doc.cgal.org/latest/Manual/installation.html
106106
spec = self.spec
107-
variant_bool = lambda feature: str(feature in spec)
107+
108+
def variant_bool(feature):
109+
str(feature in spec)
108110
cmake_args = []
109111

110112
cmake_args.append("-DBUILD_SHARED_LIBS:BOOL=%s" % variant_bool("+shared"))

meshing_supersede/packages/omniorb-anl/package.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@
3939
#
4040
from spack import *
4141

42+
4243
#
43-
# omniORB 4.1.7 de ATT tres legerement retouche pour qu'il puisse s'installe dans
44+
# omniORB 4.1.7 de ATT tres legerement retouche pour qu'il puisse s'installe dans
4445
# un environnement spack (de base il y a un probleme de shebang ...)
4546
#
4647
class OmniorbAnl(AutotoolsPackage):
4748
"""ORB de ATT"""
4849

4950
homepage = ""
50-
url = "omniorb-anl-4.1.7.tar.gz"
51+
url = "omniorb-anl-4.1.7.tar.gz"
5152
version('4.1.7', sha256='3f42d97cb0344afb25c3b203ec874ad3d2ea944ea75a16bcb5e084c66273691d')
5253
version('4.3.0')
5354

54-
# On a besoin de 2.7 <= python < 3.0.0 :
55-
# depends_on('[email protected]:', type=('link'))
56-
# depends_on('python@:2.7.16', type=('build', 'link'))
55+
# On a besoin de 2.7 <= python < 3.0.0 :
56+
# depends_on('[email protected]:', type=('link'))
57+
# depends_on('python@:2.7.16', type=('build', 'link'))
5758
depends_on('python@:2.7.16', type='run', when="@:4.2.99")
5859
depends_on('python@3:', type='run', when="@4.3.0:")
5960

meshing_supersede/packages/opencascade/package.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class Opencascade(CMakePackage):
1515

1616

1717
##############################################
18-
# WARNING this supersedes the upstream recipe
18+
# WARNING this supersedes the upstream recipe
1919
##############################################
2020

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

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

3939
# modifications for internal use
4040
patch('opencascade-7.1.0_a.patch', when='@7.1.0')
41-
41+
4242
variant('tbb', default=False,
4343
description='Build with Intel Threading Building Blocks')
4444
variant('vtk', default=False,
@@ -60,14 +60,13 @@ def url_for_version(self, version):
6060
variant('draw', default=False,
6161
description='Sets BUILD_MODULE_Draw')
6262
variant('foundationclasses', default=False,
63-
description='Sets BUILD_MODULE_FoundationClasses (probably always ON)' )
63+
description='Sets BUILD_MODULE_FoundationClasses (probably always ON)')
6464
variant('modelingalgorithm', default=False,
6565
description='Sets BUILD_MODULE_ModelingAlgorithm')
6666
variant('modelingdata', default=False,
6767
description='Sets BUILD_MODULE_ModelingData')
6868
variant('visualization', default=False,
6969
description='Sets BUILD_MODULE_Visualization')
70-
7170

7271
depends_on('intel-tbb', when='+tbb')
7372
depends_on('vtk', when='+vtk')
@@ -76,7 +75,6 @@ def url_for_version(self, version):
7675
depends_on('gl2ps', when='@7.1.0+gl2ps')
7776
depends_on('doxygen', when='+documentation')
7877

79-
8078
depends_on('freetype')
8179
depends_on('tcl')
8280

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

8886
depends_on('gl')
8987

90-
# those two libraries are always used at link phase, but it could be a
91-
# remnant of the optionnal gl2ps module. We might be able to remove
88+
# those two libraries are always used at link phase, but it could be a
89+
# remnant of the optionnal gl2ps module. We might be able to remove
9290
# those dependencies in a future release of OCC.
93-
depends_on('libxmu', type=('build','link'))
94-
depends_on('libxi', type=('build','link'))
91+
depends_on('libxmu', type=('build', 'link'))
92+
depends_on('libxi', type=('build', 'link'))
9593

9694
def cmake_args(self):
9795
args = []
@@ -131,7 +129,6 @@ def cmake_args(self):
131129
else:
132130
args.append('-DUSE_GL2PS=OFF')
133131

134-
135132
if '+documentation' in self.spec:
136133
args.append('-DBUILD_DOC_Overview=ON')
137134
else:
@@ -151,7 +148,7 @@ def cmake_args(self):
151148
args.append('-DBUILD_MODULE_Draw=ON')
152149
else:
153150
args.append('-DBUILD_MODULE_Draw=OFF')
154-
151+
155152
if '+foundationclasses' in self.spec:
156153
args.append('-DBUILD_MODULE_FoundationClasses=ON')
157154
else:

0 commit comments

Comments
 (0)