Skip to content

Commit 4a6e9fc

Browse files
authored
Merge pull request #2820 from JacksonBurns/fix/conda_package
Make RMG-Py `conda` Work Again 🎉
2 parents 74e498d + 5cae69f commit 4a6e9fc

File tree

12 files changed

+434
-338
lines changed

12 files changed

+434
-338
lines changed

.conda/build.sh

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

.conda/conda_build_config.yaml

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

.conda/meta.yaml

Lines changed: 163 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,185 @@
1-
# For conda build
1+
# meta.yaml
2+
#
3+
# welcome to meta.yaml, poor soul that you are. this file specifies the 'recipe' for compiling
4+
# RMG-Py into binaries which can then be uploaded for access via the conda package manager
5+
# to use this file, you can follow the procedure shown in .github/workflows/conda_build.yml
6+
#
27
package:
38
name: rmg
4-
version: 3.2.0
9+
version: 3.3.0
510

611
source:
712
path: ../
813

914
build:
10-
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
15+
number: 0
16+
script: |
17+
python utilities.py check-pydas # write the rmgpy/solver/settings.pxi file
18+
python setup.py install --single-version-externally-managed --record=record.txt
1119
1220
requirements:
1321
build:
14-
- {{ compiler('c') }} # [unix]
22+
- {{ compiler('c') }}
1523
host:
16-
- cython >=0.25.2
17-
- numpy
18-
- openbabel >=3
19-
- pydas >=1.0.2
20-
- pydqed >=1.0.1
21-
- pyrdl
22-
- python
23-
- quantities
24-
- rdkit >=2018
25-
- scipy
26-
- setuptools
24+
- conda-forge::cairo
25+
- conda-forge::cairocffi
26+
- conda-forge::ffmpeg >=7
27+
- conda-forge::xlrd
28+
- conda-forge::xlwt
29+
- conda-forge::h5py
30+
- conda-forge::graphviz >=12
31+
- conda-forge::markupsafe
32+
- conda-forge::psutil
33+
- conda-forge::ncurses
34+
- conda-forge::suitesparse
35+
- conda-forge::graphviz
36+
- conda-forge::pyopenssl >20
37+
- conda-forge::coolprop
38+
- conda-forge::cantera =2.6
39+
- conda-forge::mopac
40+
- conda-forge::cclib >=1.6.3,<1.9
41+
- conda-forge::openbabel >=3
42+
- conda-forge::rdkit >=2022.09.1
43+
- conda-forge::python >=3.9
44+
- conda-forge::setuptools <80
45+
- conda-forge::coverage
46+
- conda-forge::cython >=0.25.2,<3.1
47+
- conda-forge::scikit-learn
48+
- conda-forge::scipy >=1.9
49+
- conda-forge::numpy >=1.10.0,<2
50+
- conda-forge::pydot
51+
- conda-forge::jinja2
52+
- conda-forge::jupyter
53+
- conda-forge::pymongo
54+
- conda-forge::pyparsing
55+
- conda-forge::pyyaml
56+
- conda-forge::networkx
57+
- conda-forge::pytest
58+
- conda-forge::pytest-cov
59+
- conda-forge::pytest-check
60+
- conda-forge::pyutilib
61+
- conda-forge::matplotlib >=1.5
62+
- conda-forge::mpmath
63+
- conda-forge::pandas
64+
- conda-forge::gprof2dot
65+
- conda-forge::numdifftools
66+
- conda-forge::quantities !=0.16.0,!=0.16.1
67+
- conda-forge::ringdecomposerlib-python
68+
- rmg::pydas >=1.0.3
69+
- rmg::pydqed >=1.0.3
70+
- rmg::symmetry
71+
- rmg::rmgdatabase =3.3.0
72+
- blas=*=openblas
2773
run:
28-
- cairo
29-
- cairocffi
30-
- cantera >=2.3.0
31-
- cclib >=1.6.3
32-
- coolprop
33-
- coverage
34-
- cython >=0.25.2
35-
- ffmpeg
36-
- gprof2dot
37-
- graphviz
38-
- h5py
39-
- jinja2
40-
- jupyter
41-
- markupsafe
42-
- matplotlib >=1.5
43-
- mopac
44-
- mpmath
45-
- muq2
46-
- networkx
47-
- nose
48-
- numdifftools
49-
- {{ pin_compatible('numpy') }}
50-
- openbabel >=3
51-
- pandas
52-
- psutil
53-
- pydas >=1.0.2
54-
- pydot
55-
- pydqed >=1.0.1
56-
- pymongo
57-
- pyparsing
58-
- pyrdl
59-
- python
60-
- pyyaml
61-
- pyzmq
62-
- quantities
63-
- rdkit >=2018
64-
- rmgdatabase >=3.2.0
65-
- scikit-learn
66-
- scipy
67-
- symmetry
68-
- xlrd
69-
- xlwt
74+
- conda-forge::cairo
75+
- conda-forge::cairocffi
76+
- conda-forge::ffmpeg >=7
77+
- conda-forge::xlrd
78+
- conda-forge::xlwt
79+
- conda-forge::h5py
80+
- conda-forge::graphviz >=12
81+
- conda-forge::markupsafe
82+
- conda-forge::psutil
83+
- conda-forge::ncurses
84+
- conda-forge::suitesparse
85+
- conda-forge::graphviz
86+
- conda-forge::pyopenssl >20
87+
- conda-forge::coolprop
88+
- conda-forge::cantera =2.6
89+
- conda-forge::mopac
90+
- conda-forge::cclib >=1.6.3,<1.9
91+
- conda-forge::openbabel >=3
92+
- conda-forge::rdkit >=2022.09.1
93+
- conda-forge::python >=3.9
94+
- conda-forge::setuptools <80
95+
- conda-forge::coverage
96+
- conda-forge::cython >=0.25.2,<3.1
97+
- conda-forge::scikit-learn
98+
- conda-forge::scipy >=1.9
99+
- conda-forge::numpy >=1.10.0,<2
100+
- conda-forge::pydot
101+
- conda-forge::jinja2
102+
- conda-forge::jupyter
103+
- conda-forge::pymongo
104+
- conda-forge::pyparsing
105+
- conda-forge::pyyaml
106+
- conda-forge::networkx
107+
- conda-forge::pytest
108+
- conda-forge::pytest-cov
109+
- conda-forge::pytest-check
110+
- conda-forge::pyutilib
111+
- conda-forge::matplotlib >=1.5
112+
- conda-forge::mpmath
113+
- conda-forge::pandas
114+
- conda-forge::gprof2dot
115+
- conda-forge::numdifftools
116+
- conda-forge::quantities !=0.16.0,!=0.16.1
117+
- conda-forge::ringdecomposerlib-python
118+
- rmg::pydas >=1.0.3
119+
- rmg::pydqed >=1.0.3
120+
- rmg::symmetry
121+
- rmg::rmgdatabase =3.3.0
122+
- blas=*=openblas
70123
test:
124+
requires:
125+
- conda-forge::cairo
126+
- conda-forge::cairocffi
127+
- conda-forge::ffmpeg >=7
128+
- conda-forge::xlrd
129+
- conda-forge::xlwt
130+
- conda-forge::h5py
131+
- conda-forge::graphviz >=12
132+
- conda-forge::markupsafe
133+
- conda-forge::psutil
134+
- conda-forge::ncurses
135+
- conda-forge::suitesparse
136+
- conda-forge::graphviz
137+
- conda-forge::pyopenssl >20
138+
- conda-forge::coolprop
139+
- conda-forge::cantera =2.6
140+
- conda-forge::mopac
141+
- conda-forge::cclib >=1.6.3,<1.9
142+
- conda-forge::openbabel >=3
143+
- conda-forge::rdkit >=2022.09.1
144+
- conda-forge::python >=3.9
145+
- conda-forge::setuptools <80
146+
- conda-forge::coverage
147+
- conda-forge::cython >=0.25.2,<3.1
148+
- conda-forge::scikit-learn
149+
- conda-forge::scipy >=1.9
150+
- conda-forge::numpy >=1.10.0,<2
151+
- conda-forge::pydot
152+
- conda-forge::jinja2
153+
- conda-forge::jupyter
154+
- conda-forge::pymongo
155+
- conda-forge::pyparsing
156+
- conda-forge::pyyaml
157+
- conda-forge::networkx
158+
- conda-forge::pytest
159+
- conda-forge::pytest-cov
160+
- conda-forge::pytest-check
161+
- conda-forge::pyutilib
162+
- conda-forge::matplotlib >=1.5
163+
- conda-forge::mpmath
164+
- conda-forge::pandas
165+
- conda-forge::gprof2dot
166+
- conda-forge::numdifftools
167+
- conda-forge::quantities !=0.16.0,!=0.16.1
168+
- conda-forge::ringdecomposerlib-python
169+
- rmg::pydas >=1.0.3
170+
- rmg::pydqed >=1.0.3
171+
- rmg::symmetry
172+
- rmg::rmgdatabase =3.3.0
173+
- blas=*=openblas
71174
source_files:
72175
- 'examples/rmg/superminimal'
73-
- 'examples/arkane/networks/n-butanol'
176+
- 'examples/arkane/networks/n-butanol_msc'
74177
imports:
75178
- rmgpy
76179
- arkane
77180
commands:
78-
- rmg.py examples/rmg/superminimal/input.py # [unix]
79-
- Arkane.py examples/arkane/networks/n-butanol/input.py # [unix]
80-
- python %SCRIPTS%\rmg.py examples\rmg\superminimal\input.py # [win]
81-
- python %SCRIPTS\Arkane.py examples\arkane\networks\n-butanol\input.py # [win]
181+
- rmg.py examples/rmg/superminimal/input.py
182+
- Arkane.py examples/arkane/networks/n-butanol_msc/input.py
82183

83184
about:
84185
home: https://github.com/ReactionMechanismGenerator/RMG-Py

.github/workflows/conda_build.yml

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,66 @@
11
name: Conda Build
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
37
on:
8+
pull_request:
9+
workflow_dispatch:
410
push:
511
branches:
612
- stable
713
jobs:
8-
build-linux:
9-
runs-on: ubuntu-latest
14+
build:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-13, macos-latest]
19+
numpy-version: ["1.26"]
20+
python-version: ["3.9"]
21+
runs-on: ${{ matrix.os }}
22+
name: Build ${{ matrix.os }} Python ${{ matrix.python-version }} Numpy ${{ matrix.numpy-version }}
1023
defaults:
1124
run:
1225
shell: bash -l {0}
1326
steps:
14-
- uses: actions/checkout@v2
15-
- uses: conda-incubator/setup-miniconda@v2
27+
- uses: actions/checkout@v4
28+
29+
- name: Setup Miniforge
30+
uses: conda-incubator/setup-miniconda@v3
1631
with:
17-
environment-file: environment.yml
18-
python-version: 3.7
19-
activate-environment: rmg_env
20-
- name: Conda info
32+
miniforge-variant: Miniforge3
33+
miniforge-version: latest
34+
auto-update-conda: true
35+
show-channel-urls: true
36+
conda-remove-defaults: "true"
37+
auto-activate-base: "true"
38+
activate-environment: ""
39+
40+
- name: Install Build Tools
41+
run: conda install python anaconda-client conda-build
42+
43+
- name: Configure Auto-Upload
44+
if: github.ref == 'refs/heads/stable'
2145
run: |
22-
conda info
23-
conda list
46+
conda config --set anaconda_upload yes
47+
2448
- name: Build Binary
25-
env:
26-
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
2749
run: |
28-
conda install -y conda-build
29-
conda install -y anaconda-client
50+
# set a default value to the conda_token if needed (like from forks)
51+
: "${CONDA_TOKEN:=${{ secrets.ANACONDA_TOKEN }}}"
52+
: "${CONDA_TOKEN:=default_value}"
53+
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
3054
conda config --add channels rmg
31-
conda config --set anaconda_upload yes
32-
conda build --token $CONDA_TOKEN --user rmg .conda
33-
build-osx:
34-
runs-on: macos-latest
35-
defaults:
36-
run:
37-
shell: bash -l {0}
55+
conda config --add channels conda-forge
56+
CONDA_NPY=${{ matrix.numpy-version }} CONDA_PY=${{ matrix.python-version }} conda build --token $CONDA_TOKEN --user rmg .
57+
58+
result:
59+
if: ${{ always() }}
60+
runs-on: ubuntu-latest
61+
name: Final Results
62+
needs: [build]
3863
steps:
39-
- uses: actions/checkout@v2
40-
- uses: conda-incubator/setup-miniconda@v2
41-
with:
42-
environment-file: environment.yml
43-
python-version: 3.7
44-
activate-environment: rmg_env
45-
- name: Conda info
46-
run: |
47-
conda info
48-
conda list
49-
- name: Build Binary
50-
env:
51-
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
52-
run: |
53-
conda install -y conda-build
54-
conda install -y anaconda-client
55-
conda config --add channels rmg
56-
conda config --set anaconda_upload yes
57-
xcrun --show-sdk-path
58-
conda build --token $CONDA_TOKEN --user rmg .conda
64+
- run: exit 1
65+
# see https://github.com/orgs/community/discussions/26822?sort=new#discussioncomment-8285141
66+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

0 commit comments

Comments
 (0)