Skip to content

Update dev requirements #412

Update dev requirements

Update dev requirements #412

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: mpi4py/setup-mpi@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install production dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install .
- name: Unit testing
run: |
pytest .
- name: Test McStasScript
run: |
git clone https://github.com/PaNOSC-ViNYL/McStasScript.git
cd McStasScript
pip install -e .
cd mcstasscript/tests
pytest .
cd
- name: Test SimEx-Lite
run: |
# Install pysingfel backend from the simex branch
pip install git+https://github.com/JunCEEE/pysingfel.git@simex
# Install and test SimEx-Lite
git clone --recursive https://github.com/PaNOSC-ViNYL/SimEx-Lite.git
cd SimEx-Lite
pip install -e .
git clone https://github.com/PaNOSC-ViNYL/SimEx-Lite-testFiles testFiles
pytest tests
- name: Install development dependencies
run: |
pip install -r requirements/dev.txt
- name: Code formatting
run: |
black --check libpyvinyl/
build_sdist_and_wheel:
name: Build source distribution and pure python wheel
runs-on: ubuntu-20.04
needs: test
if: github.ref == 'refs/heads/CICD'
steps:
- name: bumpversion
run: |
bumpversion build
- uses: actions/checkout@v2
- id: build
uses: OpenAstronomy/build-python-dist@v1
with:
pure_python_wheel: true
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: sdist-wheel
path: dist/
deploy:
name: Deploy sdist and wheel on PYPI
runs-on: ubuntu-20.04
needs: build_sdist_and_wheel
if: github.ref == 'refs/heads/master' # and startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/p/libpyvinyl
permissions:
id-token: write
steps:
- name: Get artifact
uses: actions/download-artifact@v4
with:
name: sdist-wheel
path: dist/
- name: Upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1
test_deploy:
name: Deploy sdist and wheel on TEST.PYPI
runs-on: ubuntu-20.04
needs: build_sdist_and_wheel
if: github.ref == 'refs/heads/CICD'
environment:
name: testpypi
url: https://test.pypi.org/p/libpyvinyl
permissions:
id-token: write
steps:
- name: Get artifact
uses: actions/download-artifact@v4
with:
name: sdist-wheel
path: dist/
- name: Upload to test.pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/