Skip to content

Commit

Permalink
Merge pull request #122 from ww-tech/prim-test
Browse files Browse the repository at this point in the history
Primrose 2.0 work
  • Loading branch information
calwoo authored May 22, 2023
2 parents edd6ed5 + 92245ea commit f4e69d0
Show file tree
Hide file tree
Showing 15 changed files with 2,337 additions and 143 deletions.
93 changes: 50 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
- ubuntu-latest
- macos-latest
python:
- 3.6
- 3.7
- 3.8
pypi_build:
- complete
- only_plotting
Expand All @@ -30,17 +29,14 @@ jobs:
- basic
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- name: before_install
run: |
echo "PYPI_BUILD=${{ matrix.pypi_build }}" >> $GITHUB_ENV
echo "BOTO_CONFIG=/dev/null" >> $GITHUB_ENV
echo "BUILD_OS=${{ matrix.os }}" >> $GITHUB_ENV
pip install wheel
- name: install_linux
if: matrix.os == 'ubuntu-latest'
Expand All @@ -52,44 +48,54 @@ jobs:
bash scripts/mac_install.sh
- name: install R
if: matrix.pypi_build == 'complete' || matrix.pypi_build == 'only_r'
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1.0
r-version: 4.2.0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- name: python install
run: |
pip install -r requirements.txt
pip install .[test]
mkdir cache
if [ $PYPI_BUILD = 'complete' ]; then
echo "Installing postgres and plotting requirements"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip install psycopg2>=2.8.3
pip install psycopg2_binary>=2.8.2
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
pip install pygraphviz
if [ $BUILD_OS = 'macos-latest' ]; then
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
elif [ $BUILD_OS = 'ubuntu-latest' ]; then
export LDFLAGS="-L/usr/lib/aarch64-linux-gnu"
export CPPFLAGS="-I/usr/include"
fi
pip install .[plotting]
unset LDFLAGS
unset CPPFLAGS
pip install "rpy2>=2.9.1,<=3.2.7"
pip install .[postgres]
pip install .[R]
elif [ $PYPI_BUILD = 'only_postgres' ]; then
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
echo "Installing postgres requirements"
pip install psycopg2>=2.8.3
pip install psycopg2_binary>=2.8.2
unset LDFLAGS
unset CPPFLAGS
pip install .[postgres]
elif [ $PYPI_BUILD = 'only_plotting' ]; then
echo "Installing plotting requirements"
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
pip install pygraphviz
if [ $BUILD_OS = 'macos-latest' ]; then
export LDFLAGS="-L/usr/local/opt/graphviz/lib"
export CPPFLAGS="-I/usr/local/opt/graphviz/include"
elif [ $BUILD_OS = 'ubuntu-latest' ]; then
export LDFLAGS="-L/usr/lib/aarch64-linux-gnu"
export CPPFLAGS="-I/usr/include"
fi
pip install .[plotting]
unset LDFLAGS
unset CPPFLAGS
elif [ $PYPI_BUILD = 'only_r' ]; then
echo "Installing R requirements"
pip install "rpy2>=2.9.1,<=3.2.7"
pip install .[R]
fi
- name: tests
run: |
Expand All @@ -105,26 +111,27 @@ jobs:
else
python -m pytest -m "not optional"
fi
build-and-publish:
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
architecture: 'x64'
- name: Install pypa/build
run: >-
python -m
pip install
build
sphinx
--user
run: |
python -m \
pip install \
build \
sphinx \
myst_parser \
sphinx-rtd-theme \
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
Expand All @@ -135,13 +142,13 @@ jobs:
.
- name: publish to pypi
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: build docs
run: bash scripts/generate_docs.sh || exit 1
run: bash scripts/generate_docs.sh || exit 1
- name: publish github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_dir: ./docs
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ cache/
.vscode/
.idea/


# PDM specific
.pdm.toml
Loading

0 comments on commit f4e69d0

Please sign in to comment.