Skip to content

Commit

Permalink
Merge pull request #234 from bluesky/233-nbsphinx-build
Browse files Browse the repository at this point in the history
switch to micromamba, resolve documentation build problem
  • Loading branch information
prjemian authored Jun 22, 2022
2 parents de21ead + 0566bf3 commit 208652f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 111 deletions.
49 changes: 0 additions & 49 deletions .github/edit_test_environment.py

This file was deleted.

34 changes: 7 additions & 27 deletions .github/workflows/conda_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on: [push, pull_request]
jobs:

build:
env:
ENV_NAME: hklpy-test-${{ matrix.python-version }}
PACKAGE: hklpy

runs-on: ubuntu-latest
strategy:
Expand All @@ -17,37 +14,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: customize environment requirements for conda & pip
shell: bash -l {0}
run: |
python ./.github/edit_test_environment.py ${ENV_NAME}
echo "# ------ new conda environment"
cat conda_env.yml
echo "# ------ new pip requirements"
cat pip_req.txt
- name: Setup Miniconda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
- name: Create Python ${{ matrix.python-version }} environment
uses: mamba-org/provision-with-micromamba@main
with:
activate-environment: test-hklpy
auto-update-conda: true
channel-priority: true
channels: defaults,conda-forge
environment-file: conda_env.yml
mamba-version: "*"
use-only-tar-bz2: true # required for caching
environment-file: environment.yml
environment-name: hklpy-test-${{ matrix.python-version }}

- name: show conda environments
- name: conda environments
shell: bash -l {0}
run: |
conda env list
micromamba env list
python --version
- name: install pip requirements separately
shell: bash -l {0}
run: |
pip install -r pip_req.txt
- name: Install the hklpy package
shell: bash -l {0}
run: |
Expand All @@ -60,6 +39,7 @@ jobs:
ls -lAFgh
conda list -r
conda list
micromamba list
- name: Test with coverage and pytest
shell: bash -l {0}
Expand Down
51 changes: 16 additions & 35 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: Publish Documentation

# comment for normal
# (For development use)
# on: push

# comment here and uncomment above to publish docs for _any_ branch
# (For production use)
on:
# comment here for production use
# push

# comment here for development use
push:
branches:
- main

jobs:
build:
env:
ENV_NAME: test
# will define PACKAGE in steps, obtained from GITHUB_REPOSITORY

if: github.repository_owner == 'bluesky'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]

steps:
- name: get correct package name from repository
Expand All @@ -36,44 +31,30 @@ jobs:
- uses: actions/checkout@v2

- name: set environment name in YAML file
shell: bash -l {0}
run: |
sed -i.bak "s/name: ${PACKAGE}/name: ${ENV_NAME}/g" environment.yml
head envir*
- name: Setup Miniconda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
- name: Install Python ${{ matrix.python-version }} Conda environment with micromamba from env-dev.yml
uses: mamba-org/provision-with-micromamba@main
with:
auto-update-conda: true
channel-priority: true
channels: nsls2forge,conda-forge,defaults
environment-file: environment.yml
mamba-version: "*"
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true # required for caching
environment-file: env-dev.yml
environment-name: test

- name: Install publishing requirements
- name: Install the package locally
shell: bash -l {0}
run: |
conda install jupyter nbconvert sphinx nbsphinx sphinxcontrib-napoleon make flake8 black pandoc -c defaults -c conda-forge
pip install sphinx-rtd-theme
pip install -e .
- name: Install the package locally
- name: Diagnostics
shell: bash -l {0}
run: |
pip install -e .
conda info
conda list
env | sort | grep -i CONDA
- name: Build Docs
shell: bash -l {0}
run: |
# conda info
# conda list jupyter
# conda list nbconvert
env | sort | grep -i CONDA
# make html
make
# comment here for development use
- name: Deploy documentation to blueskyproject.io.
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upload_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
Expand Down

0 comments on commit 208652f

Please sign in to comment.