-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from IMMM-SFA/dev
new release
- Loading branch information
Showing
121 changed files
with
4,128 additions
and
2,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,66 @@ | ||
name: Build | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ main, dev ] | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
schedule: | ||
- cron: '0 8 * * 1' # Runs every monday at 12am Pacific time | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
strategy: | ||
matrix: | ||
python-version: [ '3.9', '3.10', '3.11', '3.12' ] | ||
os: [ ubuntu-latest ] | ||
fail-fast: false | ||
|
||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: '3.9' | ||
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Install pytest-mock | ||
run: | | ||
pip install pytest-mock | ||
- name: Test and generate coverage report | ||
run: | | ||
- name: Test and generate coverage report | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest --cov=./ --cov-report=xml | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v1 | ||
# with: | ||
# file: ./coverage.xml | ||
# fail_ci_if_error: true | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./coverage.xml # optional | ||
name: codecov-umbrella # optional | ||
token: ${{ secrets.CODECOV_TOKEN }} # required | ||
|
||
- name: Notify on failure | ||
if: failure() # This step will only run if any previous step fails | ||
run: | | ||
echo "Build or tests failed. Please check the logs." | ||
- name: Test and generate coverage report | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pip install pytest-mock # Ensure pytest-mock is installed before testing | ||
pytest --cov=./ --cov-report=xml # Run tests and generate a coverage report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# This GitHub Action will only push to PyPI if the branch is tagged and then merged to main. | ||
# Tag the branch with: | ||
# $ git push REMOTE-NAME TAG-NAME | ||
|
||
name: Publish Python to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/msdbook | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
name: >- | ||
Sign the Python distribution with Sigstore | ||
and upload them to GitHub Release | ||
needs: | ||
- publish-to-pypi | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' | ||
publish-to-testpypi: | ||
name: Publish to TestPyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/msdbook | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# pre-commit hooks require a user to have installed `pre-commit`: | ||
# $ brew install pre-commit | ||
# Then install the hooks within the repo: | ||
# $ cd /PATH/TO/REPO | ||
# $ pre-commit install | ||
|
||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.5.5 | ||
hooks: | ||
- id: ruff | ||
args: [ --fix, --exit-non-zero-on-fix] | ||
exclude: .rst | ||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
args: [--line-length=100] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
FROM jupyter/minimal-notebook:2022-05-03 | ||
FROM ghcr.io/msd-live/jupyter/python-notebook:latest | ||
|
||
USER root | ||
|
||
RUN git clone https://github.com/IMMM-SFA/msd_uncertainty_ebook.git msd_uncertainty_ebook | ||
RUN git clone --depth=1 --branch=main https://github.com/IMMM-SFA/msd_uncertainty_ebook.git msd_uncertainty_ebook | ||
RUN cd msd_uncertainty_ebook && pip install . | ||
|
||
# Now create a symlinked data folder inside the msdbook package that links to /home/demo/data folder | ||
RUN mkdir -p /bucket/data | ||
RUN rm -rf /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
RUN ln -s /bucket/data /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
|
||
|
||
# Install msdbook data | ||
RUN mkdir -p /opt/conda/lib/python3.11/site-packages/msdbook/data | ||
RUN python -c 'from msdbook.install_supplement import install_package_data; install_package_data()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
FROM jupyter/minimal-notebook:2022-05-03 | ||
FROM ghcr.io/msd-live/jupyter/python-notebook:latest | ||
|
||
USER root | ||
|
||
RUN git clone --depth=1 --branch=dev https://github.com/IMMM-SFA/msd_uncertainty_ebook.git msd_uncertainty_ebook | ||
RUN cd msd_uncertainty_ebook && pip install . | ||
|
||
# Now create a symlinked data folder inside the msdbook package that links to /home/demo/data folder | ||
RUN mkdir -p /bucket/data | ||
RUN rm -rf /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
RUN ln -s /bucket/data /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
|
||
|
||
# Install msdbook data | ||
RUN mkdir -p /opt/conda/lib/python3.11/site-packages/msdbook/data | ||
RUN python -c 'from msdbook.install_supplement import install_package_data; install_package_data()' |
Oops, something went wrong.