Skip to content

Commit 18ca7e5

Browse files
committed
JWB initial increase to Python 3.9
These were the first commits to change to Python 3.9, and they do not work on their own but instead open the door to finding issues to make the rest of the changes
1 parent eac0906 commit 18ca7e5

3 files changed

Lines changed: 23 additions & 88 deletions

File tree

.github/workflows/CI.yml

Lines changed: 13 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -51,66 +51,14 @@ env:
5151

5252

5353
jobs:
54-
build-osx:
55-
runs-on: macos-13
56-
# skip scheduled runs from forks
57-
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
58-
defaults:
59-
run:
60-
shell: bash -l {0}
61-
steps:
62-
- name: Checkout RMG-Py
63-
uses: actions/checkout@v4
64-
65-
# Step to create a custom condarc.yml before setting up conda
66-
- name: Create custom conda config file
67-
run: |
68-
RUNNER_CWD=$(pwd)
69-
echo "channels:" > $RUNNER_CWD/condarc.yml
70-
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
71-
echo " - rmg" >> $RUNNER_CWD/condarc.yml
72-
echo " - cantera" >> $RUNNER_CWD/condarc.yml
73-
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
74-
75-
# configures the mamba environment manager and builds the environment
76-
- name: Setup Miniforge Python 3.7
77-
uses: conda-incubator/setup-miniconda@v3
78-
with:
79-
environment-file: environment.yml
80-
miniforge-variant: Miniforge3
81-
miniforge-version: latest
82-
python-version: 3.7
83-
condarc-file: condarc.yml
84-
activate-environment: rmg_env
85-
use-mamba: true
86-
87-
# list the environment for debugging purposes
88-
- name: mamba info
89-
run: |
90-
mamba info
91-
mamba list
92-
93-
# Clone RMG-database
94-
- name: Clone RMG-database
95-
run: |
96-
cd ..
97-
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
98-
99-
# modify env variables as directed in the RMG installation instructions
100-
- name: Set Environment Variables
101-
run: |
102-
RUNNER_CWD=$(pwd)
103-
echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
104-
echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH
105-
106-
# RMG build step
107-
- name: make RMG
108-
run: |
109-
make clean
110-
make
111-
112-
build-and-test-linux:
113-
runs-on: ubuntu-latest
54+
build-and-test:
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
python-version: ["3.9"]
59+
os: [macos-13, macos-latest, ubuntu-latest]
60+
runs-on: ${{ matrix.os }}
61+
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }}
11462
# skip scheduled runs from forks
11563
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
11664
env:
@@ -123,27 +71,17 @@ jobs:
12371
- name: Checkout RMG-Py
12472
uses: actions/checkout@v4
12573

126-
# Step to create a custom condarc.yml before setting up conda
127-
- name: Create custom condarc.yml
128-
run: |
129-
RUNNER_CWD=$(pwd)
130-
echo "channels:" > $RUNNER_CWD/condarc.yml
131-
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
132-
echo " - rmg" >> $RUNNER_CWD/condarc.yml
133-
echo " - cantera" >> $RUNNER_CWD/condarc.yml
134-
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
135-
136-
# configures the mamba environment manager and builds the environment
137-
- name: Setup Miniforge Python 3.7
74+
- name: Setup Miniforge Python ${{ matrix.python-version }}
13875
uses: conda-incubator/setup-miniconda@v3
13976
with:
14077
environment-file: environment.yml
14178
miniforge-variant: Miniforge3
14279
miniforge-version: latest
143-
python-version: 3.7
144-
condarc-file: condarc.yml
80+
python-version: ${{ matrix.python-version }}
14581
activate-environment: rmg_env
14682
use-mamba: true
83+
show-channel-urls: true
84+
channels: conda-forge,cantera,rmg
14785

14886
# list the environment for debugging purposes
14987
- name: mamba info
@@ -386,7 +324,7 @@ jobs:
386324
# who knows ¯\_(ツ)_/¯
387325
#
388326
# taken from https://github.com/docker/build-push-action
389-
needs: build-and-test-linux
327+
needs: build-and-test
390328
runs-on: ubuntu-latest
391329
if: github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py'
392330
steps:

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ jobs:
2626
with:
2727
fetch-depth: 0
2828

29-
- name: Setup Mambaforge Python 3.7
29+
- name: Setup Miniforge Python 3.9
3030
uses: conda-incubator/setup-miniconda@v3
3131
with:
3232
environment-file: environment.yml
3333
miniforge-variant: Miniforge3
3434
miniforge-version: latest
35-
python-version: 3.7
35+
python-version: 3.9
3636
activate-environment: rmg_env
3737
use-mamba: true
38+
show-channel-urls: true
39+
channels: conda-forge,cantera,rmg
3840

3941
- name: Make libtiff Symlink to Avoid Runner Bug
4042
run: | # This action may need to be removed/adjusted in future runs.

environment.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
# - April 17, 2024 Limit versions of cclib at advice of maintainers.
2020
# - August 4, 2024 Restricted pyrms to <2
2121
# - May 14, 2024 Removed diffeqpy by switching to call SciMLBase and Sundials using JuliaCall
22-
22+
# - March 15, 2024 - started migration to Python 3.9
23+
#
2324
name: rmg_env
2425
channels:
2526
- rmg
@@ -45,7 +46,7 @@ dependencies:
4546

4647
# external software tools for chemistry
4748
- coolprop
48-
- cantera::cantera=2.6
49+
- cantera::cantera >=3
4950
- conda-forge::mopac
5051
# see https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2639#issuecomment-2050292972
5152
- conda-forge::cclib >=1.6.3,<1.9
@@ -57,11 +58,11 @@ dependencies:
5758
- conda-forge::pyjuliacall # for calling julia packages
5859

5960
# Python tools
60-
- python >=3.7
61+
- python >=3.9 # leave as GEQ so that GitHub actions can add EQ w/o breaking (contradictory deps)
6162
- coverage
6263
- cython >=0.25.2
6364
- scikit-learn
64-
- scipy <1.11
65+
- scipy
6566
- numpy >=1.10.0
6667
- pydot
6768
- jinja2
@@ -72,13 +73,7 @@ dependencies:
7273
- networkx
7374
- pytest
7475
- pytest-cov
75-
# we use a the pytest-check plugin, which is on Conda and PyPI, but the
76-
# version compatible with Python 3.7 is only on PyPI
77-
# switch to the conda version after upgrading to 3.11
78-
# - conda-forge::pytest-check
79-
- pip
80-
- pip:
81-
- pytest-check
76+
- conda-forge::pytest-check
8277
- matplotlib >=1.5
8378
- mpmath
8479
- pandas

0 commit comments

Comments
 (0)