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

Reactivating macOS workflow #147

Merged
merged 18 commits into from
Aug 4, 2022
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
13 changes: 2 additions & 11 deletions .ci/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ set -e -x
# build based on python version from args
PYTHON_VERSION="$1"
case $PYTHON_VERSION in
2.7)
PYBIN="/opt/python/cp27-cp27m/bin"
;;
3.5)
PYBIN="/opt/python/cp35-cp35m/bin"
;;
3.6)
PYBIN="/opt/python/cp36-cp36m/bin"
;;
3.7)
PYBIN="/opt/python/cp37-cp37m/bin"
;;
Expand All @@ -31,8 +22,8 @@ esac

# build, don't install
cd io
"${PYBIN}/pip" install -r requirements_build.txt
"${PYBIN}/python" setup.py bdist_wheel
"${PYBIN}/pip" install build
"${PYBIN}/python" -m build --wheel
auditwheel repair dist/ansys_mapdl_reader*.whl
rm -f dist/*
mv wheelhouse/*manylinux* dist/
111 changes: 39 additions & 72 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,31 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check_style:
stylecheck:
name: Style Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9
- name: Style
run: |
pip install -r requirements_style.txt --disable-pip-version-check
make
python-version: '3.10'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

doc_build:
name: Build Documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
Expand All @@ -55,23 +58,20 @@ jobs:

- name: Install ansys-mapdl-reader
run: |
pip install -r requirements_build.txt --disable-pip-version-check
python setup.py bdist_wheel
pip install dist/ansys*.whl --disable-pip-version-check
pip install -e .
cd tests/
xvfb-run python -c "from ansys.mapdl import reader as pymapdl_reader; print(pymapdl_reader.Report())"

- name: Build Documentation
run: |
sudo apt install pandoc -qy
sudo apt-get install zip pandoc -qy
pip install -r requirements_docs.txt --disable-pip-version-check
xvfb-run make -C doc html
sudo apt install zip
cd doc/build/html/
zip ../../../${{ env.PACKAGE_NAME }}-HTML.zip ./*

- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}-Documentation
path: |
Expand All @@ -97,15 +97,15 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Linux pip cache
uses: actions/cache@v2
uses: actions/cache@v3
if: ${{ runner.os == 'Linux' }}
with:
path: ~/.cache/pip
Expand All @@ -114,7 +114,7 @@ jobs:
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Window pip cache
uses: actions/cache@v2
uses: actions/cache@v3
if: ${{ runner.os == 'Windows' }}
with:
path: ~\AppData\Local\pip\Cache
Expand All @@ -136,10 +136,6 @@ jobs:
quay.io/pypa/manylinux2014_x86_64 \
/io/.ci/build_wheels.sh ${{ matrix.python-version }}

- name: Install VTK on Python 3.10
if: matrix.python-version == '3.10'
run: pip install --find-links https://wheels.pyvista.org/ vtk

- name: Build wheel on Windows
if: ${{ runner.os == 'Windows' }}
run: |
Expand Down Expand Up @@ -167,7 +163,7 @@ jobs:

- name: Get PyVista tools
if: ${{ runner.os == 'Windows' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: pyvista/gl-ci-helpers
path: pyvista-tools
Expand Down Expand Up @@ -204,59 +200,30 @@ jobs:
name: 'Upload coverage to Codecov'

- name: Upload wheel
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}-${{ runner.os }}-${{ matrix.python-version }}
path: dist/
retention-days: 7

# mac_build:
# runs-on: macos-latest
# name: Mac OS Unit Testing
# strategy:
# matrix:
# python-version: ['3.8']

# steps:
# - uses: actions/checkout@v2

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v1
# with:
# python-version: ${{ matrix.python-version }}

# - name: Build wheels
# uses: joerick/[email protected]
# env:
# CIBW_BEFORE_BUILD: pip install -r requirements_build.txt
# CIBW_BUILD: cp38-macosx_x86_64

# - name: Build wheels
# if: startsWith(github.event.ref, 'refs/tags')
# uses: joerick/[email protected]
# env:
# CIBW_BEFORE_BUILD: pip install -r requirements_build.txt
# CIBW_SKIP: pp* cp38-macosx_x86_64

# - name: Show files
# run: ls -lh wheelhouse
# shell: bash

# - name: Upload wheels
# uses: actions/upload-artifact@v2
# with:
# path: wheelhouse/*.whl

# - name: Install wheel
# run: |
# pip install wheelhouse/*38*

# - name: Test
# run: |
# pip install -r requirements_test.txt
# cd tests
# pytest -v
mac_build:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
name: Build wheels on MacOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]

- name: List generated wheels
run: |
ls ./wheelhouse/*

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

pymapdl_tests:
name: PyMAPDL Unit Testing
Expand Down Expand Up @@ -293,7 +260,7 @@ jobs:
sudo apt install libgl1-mesa-glx xvfb

- name: Linux pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: Python-${{ runner.os }}-3.8-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_*.txt') }}
Expand Down Expand Up @@ -340,7 +307,7 @@ jobs:

Release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [check_style, doc_build, build, pymapdl_tests] # , mac_build
needs: [stylecheck, doc_build, build, pymapdl_tests, mac_build]
runs-on: ubuntu-latest
steps:
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os
import warnings

from ansys_sphinx_theme import pyansys_logo_black
import pyvista
from sphinx_gallery.sorting import FileNameSortKey
from ansys_sphinx_theme import pyansys_logo_black

from ansys.mapdl import reader as pymapdl_reader

Expand Down
34 changes: 29 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=41.0.0",
"wheel>=0.33.0",
"numpy<=1.22.1",
"cython==0.29.24",
]
"cython>=0.29",
"oldest-supported-numpy",
"setuptools>=45.0",
"wheel>=0.37.0",
]

[tool.pytest.ini_options]
junit_family= "legacy"
filterwarnings = [
"ignore::FutureWarning",
"ignore::PendingDeprecationWarning",
"ignore::DeprecationWarning",
# bogus numpy ABI warning (see numpy/#432)
"ignore:.*numpy.dtype size changed.*:RuntimeWarning",
"ignore:.*numpy.ufunc size changed.*:RuntimeWarning",
"ignore:.*Distutils was imported before Setuptools*",
]

[tool.cibuildwheel]
archs = ["auto64"] # 64-bit only
skip = "pp* *musllinux*" # disable PyPy and musl-based wheels
test-requires = "ansys-mapdl-core>=0.60.4 matplotlib pytest scipy"
test-command = "pytest {project}/tests"

[tool.cibuildwheel.macos]
# https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon
archs = ["x86_64"] # , "universal2"
test-skip = ["*_arm64", "*_universal2:arm64"]
6 changes: 0 additions & 6 deletions requirements_build.txt

This file was deleted.

7 changes: 2 additions & 5 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
scipy
pytest
ansys-mapdl-core>=0.60.4
matplotlib
pytest
pytest-cov
vtk<9.1.0;python_version<"3.10"
pyvista>=0.24.0
ansys-mapdl-core>=0.60.4
scipy
Loading