diff --git a/._travis_.yml b/._travis_.yml deleted file mode 100644 index 83c16691..00000000 --- a/._travis_.yml +++ /dev/null @@ -1,85 +0,0 @@ -os: linux -dist: xenial -language: python - -services: - - redis - -env: - global: - - BUILD_DOCS=false - - SUBMIT_CODECOV=false - - FLAKE_8=false - -cache: - directories: - - $HOME/.cache/pip - - $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853 - -jobs: - fast_finish: true - include: - - python: 3.7 - - python: 3.8 - - - python: 3.8 # This build will only run 'flake8' - name: "Check style" - env: FLAKE_8=true - - - python: 3.8 # This build will only deploy docs. - name: "Build/deploy docs" - env: - - BUILD_DOCS=true - - SUBMIT_CODECOV=true - # Doctr deploy key for bluesky/bluesky-queueserver - - secure: "hnbMpEgR/qH9h2nIDFBw2j5MrxnvkuT0fXrxeDH0l9EB6p1A45wkHC+kl2GzUHck7LLU8n47tjiJK9PssVZPQOYmMsK3lpLTqPfZEQ1DvUeNis2MVs3fjtjoUqRF0DAhuXI/+sG2qCNGm0+CHVlp1BPaRQxVzBQoPIcYy0oAqGzjx+kL7g3ucrsKqF6nkkuQ71Zj4PhxsPNAI3/7V2REOOPeEiXVfib8JxDsWYXjn/2/2IiGS0JR8yLkjRFmhEKGQxKJfNwpbLYL2WQd3FkvtaZIsUJ40x0Fuk1lbISdZ7UFfBxhbrzRiG8DLDwtUwvDsw0ZSf7qh7qM7WQzxs7lz2pGTtdJBC1+UZJ1xwzCaF8YCJWHVurkk9hp5QLnOGGLq1vopqjn+M7Qnv178HFApZ74H11hnbX3Gv4oRlUP4AmSdYmWDyb83zvIWsl+vcLwzatZBJ/m1msacSidfswdxSWATeCX5rzO7KQ8A++QTu8Sjb7Xe8607V1Z6PNJzM9sAzWGsCTWydx/5TDAocs0S0gJDhwZm+bduwOR/OloPyvDGT1zVS1V4FSF1rlUhr8iiMhtbSqDADt5i8nbXIC1VBsY6bgvRJJjR88Gi7AVmyc19bI+4JKFZRPFpzvqRfb4mO5ry9BVM+pTm5r+Zn2na3tfgL5ZkYECceFi8YIfrss=" - # As of 2020-10-08, Python 3.9 distribution is not available in TravisCI's repos yet. - # - python: 3.9 - - allow_failures: - - name: "Build/deploy docs" - -before_install: - - | - if [ "${FLAKE_8}" == "true" ]; then - pip install flake8 - flake8 . - res=$? - echo "The project code was verified with 'flake8'. Exit code ($res)." - exit $res - fi - -install: - # Install this package and the packages listed in requirements.txt. - - pip install . - # Install extra requirements for running tests and building docs. - - pip install -r requirements-dev.txt - - pip install scikit-image - - pip list - -before_script: - - | - if [ "${BUILD_DOCS}" == "true" ]; then - make -C docs/ html - res=$? - echo "Docs build finished with the exit code ($res)." - - if [ $res -gt 0 ]; then - echo "Not attempting to run doctr." - else - if [ "${TRAVIS_REPO_SLUG}" == "bluesky/bluesky-queueserver" ]; then - pip install doctr - doctr deploy --built-docs docs/build/html . --branch-whitelist main - res=$? - echo "Docs deployment with 'doctr' finished with the exit code ($res)." - fi - fi - exit $res - fi - -script: - - coverage run -m pytest -vv # Run the tests and check for test coverage. - - coverage report -m # Generate test coverage report. - -after_success: - # - if [ $SUBMIT_CODECOV == 'true' ]; then codecov; fi; diff --git a/.github/workflows/deploy_docs.sh b/.github/workflows/deploy_docs.sh deleted file mode 100755 index 64cdbe84..00000000 --- a/.github/workflows/deploy_docs.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -# Set env variable 'BUILD_DIR' to point to the directory that contains documentation -# e.g BUILD_DIR="docs/build/html" -# GITHUB_TOKEN should be also set (e.g. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}) - -echo "=====================================================================" -echo "SCRIPT: PUBLISHING DOCUMENTATION TO GITHUB PAGES" -set -eu - -REPO_URI="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" -REMOTE_NAME="origin" -TARGET_BRANCH="gh-pages" - -# Get the repository name: if repository is 'bluesky/some-repo', the name is 'some-repo' -REPO_NAME=$(echo $GITHUB_REPOSITORY | awk -F '/' '{print $2}') -echo "=====================================================================" -echo "GitHub repository: ${GITHUB_REPOSITORY}" -echo "Repository name: ${REPO_NAME}" - -CACHE_DIR="/tmp/repo_cache" -echo "=====================================================================" -echo "Creating temporary directory: ${CACHE_DIR}" -mkdir $CACHE_DIR -cd $CACHE_DIR - -echo "=====================================================================" -echo "Cloning GitHub repository: ${GITHUB_REPOSITORY}" -git clone "https://github.com/${GITHUB_REPOSITORY}.git" -cd $REPO_NAME - -echo "=====================================================================" -echo "Checking out the target branch: ${TARGET_BRANCH}" -git checkout $TARGET_BRANCH - -echo "=====================================================================" -echo "Setting up Git user name and email ... (${GITHUB_ACTOR})" -git config user.name "$GITHUB_ACTOR" -git config user.email "${GITHUB_ACTOR}@bots.github.com" - -# Remove all files and directories except hidden directories. -# -f - exits with 0 if there is not files to delete -echo "=====================================================================" -echo "Removing the all files ('${TARGET_BRANCH}' branch) ..." -rm -rf !\(.*\) - -echo "=====================================================================" -echo "Copying files from build directory: ${BUILD_DIR}" -# Copy everything including hidden files -cp -r "${GITHUB_WORKSPACE}/${BUILD_DIR}"/. . -ls -al - -echo "=====================================================================" -echo "Difference:" -git diff - -echo "=====================================================================" -echo "Adding changes ..." -git add . - -echo "=====================================================================" -echo "Committing changes ..." -git diff-index --quiet HEAD || git commit -am "Deployed Docs" -echo "Changes were committed." - -echo "=====================================================================" -echo "Pushing changes to the repository ..." -git remote set-url "$REMOTE_NAME" "$REPO_URI" # includes access token -# Allow 'push' to fail in case of collision with another build -git push "$REMOTE_NAME" "$TARGET_BRANCH" -echo "Documents were published to '${TARGET_BRANCH}' branch." diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 986a9c97..28d8657d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,12 @@ jobs: - name: Install dependencies run: | sudo apt install redis - python -m pip install --upgrade pip + + # These packages are installed in the base environment but may be older + # versions. Explicitly upgrade them because they often create + # installation problems if out of date. + python -m pip install --upgrade pip setuptools numpy + pip install . pip install -r requirements-dev.txt pip list diff --git a/.github/workflows/docs_publish.yml b/.github/workflows/docs_publish.yml index 23ffa756..985d9fb7 100644 --- a/.github/workflows/docs_publish.yml +++ b/.github/workflows/docs_publish.yml @@ -7,8 +7,7 @@ on: jobs: build: - - if: github.repository == 'bluesky/bluesky-queueserver' + if: github.repository_owner == 'bluesky' runs-on: ubuntu-latest strategy: matrix: @@ -23,16 +22,27 @@ jobs: - name: Install dependencies run: | sudo apt install redis - python -m pip install --upgrade pip + + # These packages are installed in the base environment but may be older + # versions. Explicitly upgrade them because they often create + # installation problems if out of date. + python -m pip install --upgrade pip setuptools numpy + pip install . pip install -r requirements-dev.txt pip list - name: Build Docs run: | make -C docs/ html - - name: Deploy Docs - env: - BUILD_DIR: "docs/build/html" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ./.github/workflows/deploy_docs.sh + - 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 + uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 + with: + deploy_key: ${{ secrets.ACTIONS_DOCUMENTATION_DEPLOY_KEY }} + publish_branch: main + publish_dir: ./docs/build/html + external_repository: bluesky/bluesky.github.io + destination_dir: bluesky-queueserver + keep_files: true # Keep old files. + force_orphan: false # Keep git history. diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index cd921b95..8b8dfa99 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -10,7 +10,11 @@ jobs: - uses: actions/setup-python@v2 - name: Install Dependencies run: | - python -m pip install --upgrade pip + # These packages are installed in the base environment but may be older + # versions. Explicitly upgrade them because they often create + # installation problems if out of date. + python -m pip install --upgrade pip setuptools numpy + pip install flake8 - name: Run flake8 run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e03766c9..640206c7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -19,11 +19,14 @@ jobs: - name: Install dependencies run: | sudo apt install redis - python -m pip install --upgrade pip + + # These packages are installed in the base environment but may be older + # versions. Explicitly upgrade them because they often create + # installation problems if out of date. + python -m pip install --upgrade pip setuptools numpy + pip install . pip install -r requirements-dev.txt - pip install scikit-image - pip install pytest pip list - name: Test with pytest run: | diff --git a/README.rst b/README.rst index 907a8456..7d5c8d96 100644 --- a/README.rst +++ b/README.rst @@ -2,9 +2,6 @@ bluesky-queueserver =================== -.. image:: https://img.shields.io/travis/bluesky/bluesky-queueserver.svg - :target: https://travis-ci.org/bluesky/bluesky-queueserver - .. image:: https://img.shields.io/pypi/v/bluesky-queueserver.svg :target: https://pypi.python.org/pypi/bluesky-queueserver diff --git a/requirements-dev.txt b/requirements-dev.txt index 7e9b5971..c41d640c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,6 +11,7 @@ sphinx ipython matplotlib numpydoc +scikit-image sphinx-copybutton sphinx_rtd_theme # Extra dependencies for development