Skip to content

Commit

Permalink
Merge branch 'develop' into pip-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
katiebreivik authored Aug 20, 2024
2 parents a44211d + 16f6e63 commit 46b8ad6
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 44 deletions.
66 changes: 28 additions & 38 deletions .github/workflows/build_wheels_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD: pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
CIBW_BUILD_VERBOSITY: "1"
CIBW_TEST_COMMAND: python src/cosmic/tests/test_evolve.py

jobs:
build-wheels:
build-wheels-and-dist:
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9, "3.10"]

steps:
- uses: actions/checkout@v3
Expand All @@ -29,52 +31,40 @@ jobs:
name: Install Python
with:
python-version: "3.10"
- name: Setup Mac

- name: Install gfortran
if: runner.os == 'macOS'
run: |
python -m pip install numpy h5py versioneer
sudo ln -s /opt/homebrew/bin/gfortran-14 /usr/local/bin/gfortran
- name: Setup Linux
if: runner.os == 'Linux'
- name: Install numpy
run: |
python -m pip install numpy h5py versioneer
- name: Build wheels
python -m pip install --upgrade pip
python -m pip install numpy h5py versioneer
- name: Install dependencies
run: |
python -m pip install cibuildwheel setuptools wheel twine numpy build meson ninja
- name: Build source distribution (sdist)
run: |
python -m build --sdist --outdir dist
- name: Build wheels using cibuildwheel
run: |
sudo ln -s /opt/homebrew/bin/gfortran-11 /opt/homebrew/bin/gfortran || true
python -m pip install meson ninja build
meson setup build
meson compile -C build
python -m build --wheel --outdir wheelhouse
python -m build --outdir dist
unzip -l ./dist/*.whl
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build-source-dist:
name: Build source dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"

- name: Build dist
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine numpy build meson ninja
pip install .
python -m build
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
path: ./dist/*.tar.gz

- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl

publish:
needs: [build-wheels, build-source-dist]
needs: [build-wheels-and-dist]
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ${{ matrix.os }}
strategy:
Expand Down
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
project('cosmic',
'c',
'fortran',
version : '3.4.13',
default_options: ['warning_level=0', 'optimization=3'],)
version : '3.4.14',
default_options: ['warning_level=0', 'optimization=3'],
)

# Enable fortran and check arguments
# add_languages('fortran', native: false)
Expand All @@ -19,6 +20,7 @@ inc_np = include_directories(numpy_include_dir, f2py_include_dir)

get_hash = run_command('python', './src/cosmic/get_commit_hash.py', check: true).stdout().strip()


lib_source = [
'src/cosmic/src/hrdiag_remnant.f',
'src/cosmic/src/assign_remnant.f',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors = [
{ name="Scott Coughlin" },
{ name="Michael Zevin" },
{ name="Carl L. Rodriguez" },
{ name="Tom Wagg" },
]
readme = "README.md"
version = "3.4.14"
Expand All @@ -29,4 +30,3 @@ dependencies = ["numpy", "scipy", "astropy", "configparser",
build-backend = 'mesonpy'
requires = ['meson-python', 'numpy']


1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ flake8 < 5
pytest
pytest-cov
wheel
meson
2 changes: 1 addition & 1 deletion src/cosmic/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.4.13"
__version__ = "3.4.14"
4 changes: 2 additions & 2 deletions src/cosmic/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1426,9 +1426,9 @@ def error_check(BSEDict, filters=None, convergence=None, sampling=None):
)
flag = "gamma"
if flag in BSEDict.keys():
if (BSEDict[flag] < 0) and (BSEDict[flag] != -1) and (BSEDict[flag] != -2):
if (BSEDict[flag] < 0) and (BSEDict[flag] != -1) and (BSEDict[flag] != -2) and (BSEDict[flag] != -3):
raise ValueError(
"'{0:s}' needs to either be set to -2, -1, or a positive number (you set it to '{1:0.2f}')".format(
"'{0:s}' needs to either be set to -3, -2, -1, or a positive number (you set it to '{1:0.2f}')".format(
flag, BSEDict[flag]
)
)
Expand Down

0 comments on commit 46b8ad6

Please sign in to comment.