Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Makefile to print errors during make coverage. #307

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 38 additions & 18 deletions .github/workflows/pip-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,64 @@ on:

jobs:
build_wheels:
name: Build wheel
runs-on: ubuntu-latest
name: Building wheel for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-14]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11]
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python
id: setup_python
uses: actions/setup-python@v5
with:
python-version: 3.9

- uses: ilammy/msvc-dev-cmd@v1
python-version: ${{ matrix.python-version }}

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.12.1
python -m pip install cibuildwheel==2.20.0

- name: Build wheel
- name: Build wheel on Linux
if: runner.os == 'Linux'
run: |
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
python -m cibuildwheel --output-dir wheelhouse
else
echo "$RUNNER_OS not supported"
exit 1
fi
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp3?-*'
CIBW_SKIP: '*-manylinux_i686'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
shell: bash

- uses: actions/upload-artifact@v3
- name: Build wheel on macOS
if: runner.os == 'macOS'
run: |
python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
name: Building source for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-14]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11]
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,7 +72,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Build sdist
run: python setup.py sdist
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include VERSION
include src/*.c
include src/*.h
include bin/vplanet
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

opt:
-gcc -o bin/vplanet src/*.c -lm -O3 -std=gnu17 -DGITVERSION=\"$(GITVERSION)\"
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
Expand Down Expand Up @@ -68,9 +68,12 @@ test:
-pytest --tb=short

coverage:
-mkdir -p gcov && cd gcov && gcc -coverage -o ../bin/vplanet ../src/*.c -lm
-python -m pytest --tb=short tests --junitxml=junit/test-results.xml
-lcov --capture --directory gcov --output-file .coverage && genhtml .coverage --output-directory gcov/html
rm -f gcov/*.gcda gcov/*.gcno .coverage
mkdir -p gcov
cd gcov && gcc -coverage -o ../bin/vplanet ../src/*.c -lm
python -m pytest --tb=short tests --junitxml=junit/test-results.xml
lcov --capture --directory gcov --output-file .coverage
genhtml .coverage --output-directory gcov/html

docs:
-make -C docs html && echo 'Documentation available at `docs/.build/html/index.html`.'
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

# Read current code version
VersionPath = os.path.join(os.path.abspath(os.path.dirname(__file__)), "VERSION")
print(VersionPath)
VERSION = open(VersionPath, "r").read().split("\n")[0].strip()


Expand Down Expand Up @@ -93,7 +92,9 @@ def run(self):
ext_modules=ext_modules,
cmdclass=cmdclass,
include_package_data=True,
data_files=[('', ['VERSION'])],
# package_data={'': ['VERSION']},
package_data={'': ['src/*.[ch]']},
data_files=[('', ['VERSION','bin/vplanet'])],
zip_safe=False,
entry_points={"console_scripts": ["vplanet=vplanet.wrapper:_entry_point"]},
)
Expand Down
Loading