From e52eb6add637e766a41bcbdf5a918815178277a5 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Fri, 26 May 2023 09:30:10 -0700 Subject: [PATCH] Test that devstats website builds with package --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++ .github/workflows/circleci.yml | 15 +++++++++ devstats/publish.py | 2 +- devstats/template.md | 1 - 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .github/workflows/circleci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c9fb52b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +# See: https://circleci.com/docs/2.0/language-python/ + +version: 2.1 +jobs: + documentation: + docker: + - image: cimg/python:3.11 + + steps: + - checkout + + - run: + name: Update apt-get + command: | + sudo apt-get update + + - restore_cache: + keys: + - pip-cache-v1 + + - run: + name: Clone website + command: git clone git@github.com:scientific-python/devstats.scientific-python.org.git + + - run: + name: Install Python dependencies + command: | + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip wheel setuptools + pip install -r devstats.scientific-python.org/requirements.txt + pip list + + - save_cache: + key: pip-cache-v1 + paths: + - ~/.cache/pip + + - run: + name: Install + command: | + source venv/bin/activate + pip install -e . + pip list + + - run: + name: Build docs + command: | + # NOTE: bad interaction w/ blas multithreading on circleci + export OMP_NUM_THREADS=1 + source venv/bin/activate + cd devstats.scientific-python.org + make html + + - store_artifacts: + path: _build/html diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml new file mode 100644 index 0000000..65d1192 --- /dev/null +++ b/.github/workflows/circleci.yml @@ -0,0 +1,15 @@ +name: circleci + +on: [status] +jobs: + documentation: + runs-on: ubuntu-latest + name: Run CircleCI documentation artifact redirector + steps: + - name: GitHub Action step + uses: larsoner/circleci-artifacts-redirector-action@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + api-token: ${{ secrets.DEVSTATS_CIRCLECI_TOKEN }} + artifact-path: 0/_build/html/index.html + circleci-jobs: documentation diff --git a/devstats/publish.py b/devstats/publish.py index a723f66..1c28266 100644 --- a/devstats/publish.py +++ b/devstats/publish.py @@ -9,7 +9,7 @@ def publisher(project): basedir = os.path.dirname(__file__) with open(os.path.join(basedir, "template.md")) as fh: template = fh.read() - + issues = glob(os.path.join(basedir, "reports/issues/*.md")) for issue in issues: with open(issue) as fh: diff --git a/devstats/template.md b/devstats/template.md index 2e78548..0268570 100644 --- a/devstats/template.md +++ b/devstats/template.md @@ -73,7 +73,6 @@ glue("{{ project }}_query_date", str(query_date.astype("M8[D]"))) {{ first_responders }} - ## Pull Requests ```{code-cell} ipython3