Skip to content

Commit ded1bff

Browse files
committed
Resolve packaging issue for python 3.12 and above for Windows
1 parent 48bfcf4 commit ded1bff

File tree

228 files changed

+4141
-34839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+4141
-34839
lines changed

.github/workflows/build_wheels.yml

Lines changed: 101 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,129 @@
1-
name: Build
2-
3-
on: [push, pull_request]
1+
name: Build Wheels
2+
on:
3+
push:
4+
branches:
5+
- main # Build on pushes to main
6+
pull_request:
7+
branches:
8+
- main
9+
release:
10+
types: [published]
411

512
jobs:
613
build_wheels:
7-
name: Build wheels on ${{ matrix.os }}
8-
runs-on: ${{ matrix.os }}
14+
name: Build wheels on ${{ matrix.buildplat[0] }} (${{ matrix.buildplat[1] }})
15+
runs-on: ${{ matrix.buildplat[0] }}
916
strategy:
17+
fail-fast: false
1018
matrix:
11-
os: [windows-latest,ubuntu-latest,macos-12]
12-
include:
13-
- os: ubuntu-latest
14-
python-version: '3.12'
15-
toolchain: {compiler: gcc, version: 13}
16-
- os: macos-12
17-
python-version: '3.12'
18-
toolchain: {compiler: gcc, version: 13}
19-
- os: windows-latest
20-
python-version: '3.11'
21-
toolchain: {compiler: gcc, version: 13}
22-
19+
buildplat:
20+
- [ "ubuntu-latest", "auto", "", 'FC="gfortran" CC="gcc" CXX="g++"' ]
21+
- [ "windows-latest", "AMD64", "MINGW64", 'FC="gfortran" CC="gcc" CXX="g++"' ]
22+
- [ "macos-13", "x86_64", "", 'MACOSX_DEPLOYMENT_TARGET=13.0 FC="gfortran" CC="gcc" CXX="g++"' ]
23+
- [ "macos-14", "arm64", "", 'MACOSX_DEPLOYMENT_TARGET=14.0 FC="gfortran" CC="gcc" CXX="g++"' ]
24+
- [ "macos-15", "arm64", "", 'MACOSX_DEPLOYMENT_TARGET=15.0 FC="gfortran" CC="gcc" CXX="g++"' ]
25+
2326
steps:
2427
- name: Checkout code
2528
uses: actions/checkout@v4
2629

27-
- name: Install Fortran compiler for Unix
28-
if: runner.os != 'Windows'
30+
- name: Install Fortran compiler (Linux/macOS)
31+
if: runner.os == 'Linux' || runner.os == 'macOS'
2932
uses: awvwgk/setup-fortran@v1
3033
with:
31-
compiler: ${{ matrix.toolchain.compiler }}
32-
version: ${{ matrix.toolchain.version }}
34+
compiler: gcc
35+
version: 'latest'
3336

34-
- name: Install Fortran compiler on Windows
37+
- name: Set up MSYS2 for Fortran (Windows)
3538
if: runner.os == 'Windows'
36-
run: |
37-
Set-ExecutionPolicy Bypass -Scope Process -Force
38-
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
39-
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
40-
choco install gcc
41-
choco install make
42-
shell: pwsh
43-
44-
- name: Set up Python
45-
uses: actions/setup-python@v4
39+
uses: msys2/setup-msys2@v2
4640
with:
47-
python-version: ${{ matrix.python-version }}
41+
msystem: ${{ matrix.buildplat[2] }}
42+
update: true
43+
install: mingw-w64-x86_64-gcc-fortran
44+
path-type: inherit
4845

4946
- name: Build wheels
50-
uses: pypa/cibuildwheel@v2.16.5
47+
uses: pypa/cibuildwheel@v2.19.2
5148
env:
52-
PYTHONIOENCODING: utf-8
53-
CIBW_ARCHS_WINDOWS: x86 auto64
54-
CIBW_ARCHS_MACOS: x86_64
49+
CIBW_ARCHS: ${{ matrix.buildplat[1] }}
50+
CIBW_ENVIRONMENT: ${{ matrix.buildplat[3] }}
5551
with:
56-
package-dir: .
5752
output-dir: wheelhouse
5853
config-file: "./pyproject.toml"
5954

60-
- name: Install Wheel
61-
env:
62-
PYTHONIOENCODING: utf-8
55+
- name: Upload wheels
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: cibw-wheels-${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}
59+
path: ./wheelhouse/*.whl
60+
61+
publish-wheels-to-repo:
62+
name: Commit Wheels to Repository
63+
needs: build_wheels
64+
runs-on: ubuntu-latest
65+
permissions:
66+
contents: write
67+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
- name: Download all wheel artifacts
72+
uses: actions/download-artifact@v4
73+
with:
74+
path: ./dist
75+
pattern: cibw-wheels-*
76+
merge-multiple: true
77+
- name: Commit and push wheels
6378
run: |
64-
python -m venv venv
65-
if [ $RUNNER_OS = 'Windows' ]; then
66-
.\\venv\\Scripts\\activate
79+
git config --global user.name 'github-actions[bot]'
80+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
81+
git add ./dist/*.whl
82+
if git diff --staged --quiet; then
83+
echo "No new wheels to commit."
6784
else
68-
source venv/bin/activate
85+
git commit -m "ci: Add built wheels [skip ci]"
86+
git push
6987
fi
70-
for wheel in wheelhouse/*.whl; do
71-
if ! pip install "$wheel"; then
72-
echo "Failed to install $wheel, skipping..."
73-
fi
74-
done
75-
shell: bash
7688
77-
- name: Run tests
78-
env:
79-
PYTHONIOENCODING: utf-8
89+
publish-to-testpypi:
90+
name: Publish to TestPyPI
91+
needs: build_wheels
92+
runs-on: ubuntu-latest
93+
if: github.event_name == 'push'
94+
steps:
95+
- name: Download all wheel artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
path: ./dist
99+
pattern: cibw-wheels-*
100+
merge-multiple: true
101+
- name: Publish package to TestPyPI
102+
uses: pypa/gh-action-pypi-publish@release/v1
103+
with:
104+
password: ${{ secrets.TestPYPI_API_TOKEN }}
105+
repository-url: https://test.pypi.org/legacy/
106+
skip-existing: true
107+
108+
publish-to-pypi:
109+
name: Publish to PyPI
110+
needs: build_wheels
111+
runs-on: ubuntu-latest
112+
if: github.event_name == 'release' && github.event.action == 'published'
113+
114+
steps:
115+
- name: Download all wheel artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
path: ./dist
119+
120+
- name: Move and organize wheels
80121
run: |
81-
if [ $RUNNER_OS = 'Windows' ]; then
82-
.\\venv\\Scripts\\activate
83-
else
84-
source venv/bin/activate
85-
fi
86-
cd test
87-
for test in Test*.py; do
88-
python "$test"
89-
done
90-
shell: bash
122+
find ./dist -name "*.whl" -exec mv {} ./dist/ \;
123+
find ./dist -mindepth 1 -type d -exec rm -rf {} +
91124
92-
- uses: actions/upload-artifact@v4
125+
- name: Publish package to PyPI
126+
uses: pypa/gh-action-pypi-publish@release/v1
93127
with:
94-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
95-
path: ./wheelhouse/*.whl
128+
password: ${{ secrets.PYPI_API_TOKEN }}
129+
packages-dir: ./dist/

.gitignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11

2+
.DS_Store
3+
.obsidian
24

35
**/.DS_Store
6+
**/.so
7+
48

59
# Byte-compiled / optimized / DLL files
610
**/__pycache__/
711
*.py[cod]
812
*$py.class
913

1014
# C extensions
11-
**/*.so
15+
**/.so
16+
17+
#Custom folders
18+
archive/
19+
database/
20+
literature/
21+
notes/
22+
presentations/
23+
writing/
24+
ongoing/
25+
.vscode/
1226

1327
# Distribution / packaging
1428
.Python
1529
develop-eggs/
16-
dist/
30+
# dist/
1731
build/
32+
archive/
1833
downloads/
1934
eggs/
2035
.eggs/

CODE_OF_CONDUCT.md

100644100755
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Contributor Covenant Code of Conduct
22

3+
## Contributing
4+
5+
Contributing to Equilipy is easy: just open a
6+
[pull request](https://help.github.com/articles/using-pull-requests/).
7+
Make `main` the destination branch on the [Equilipy
8+
repository](https://github.com/ORNL/Equilipy) and allow edits from
9+
maintainers.
10+
11+
Your pull request must work with all current Equilipy tutorial examples
12+
and be reviewed by at least one Equilipy developer.
13+
14+
315
## Our Standards
416

517
We as contributors and maintainers pledge to making participation in our project and

README.md

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
![PyPI - Version](https://img.shields.io/pypi/v/equilipy)
2+
![PyPI - Downloads](https://img.shields.io/pypi/dm/equilipy)
3+
[![DOI](https://joss.theoj.org/papers/10.21105/joss.06875/status.svg)](https://doi.org/10.21105/joss.06875)
4+
15
# Equilipy
26
Equilipy is an open-source python package that offers multicomponent multiphase equilibrium calculations based on the CALPHAD (CALculation of PHAse Diagram) approach. With a set of Gibbs energy description (Thermochemical database) and input conditions (Composition, temperature, pressure), equilibrium phase configureation, amount, composition, and thermochemical properties can be obtained. Equilipy uses the Gibbs energy descriptions furnished by THERMOCHIMICA with the modified Gibbs energy minimization algorithm initially proposed by de Capitani, C. and Brown, T.H. (1987).
37

@@ -23,6 +27,7 @@ The following features are currently available.
2327
- Batch equilibrium calculations
2428
- Scheil-Gulliver solidification
2529
- Phase selection
30+
Hehehe
2631

2732
For details, check out the example directory and [Features and Examples](https://ornl.github.io/Equilipy/features.html)
2833

docs/.gitignore

100644100755
File mode changed.

docs/Gemfile

100644100755
File mode changed.

docs/Gemfile.lock

100644100755
File mode changed.

docs/LICENSE

100644100755
File mode changed.

docs/_config.yml

100644100755
File mode changed.

docs/database.md

100644100755
File mode changed.

0 commit comments

Comments
 (0)