Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates: linting, build environment, documentation formatting #171

Merged
merged 15 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Bug Reporting

---

name: Bug report
about: Create a report to help us improve
labels: bug

---

**Describe the bug**
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Feature Requests

---

name: Feature request
about: Suggest an idea for this project
labels: enhancement

---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/major-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Major release
about: Create a new major release
title: New major release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/minor-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Minor release
about: Create a new minor release
title: New minor release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/patch-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Patch release
about: Create a new patch release
title: New patch release
assignees: 'sesheta'
assignees: "sesheta"
labels: bot
---

Expand Down
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/POLISH_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Polish Notebook(s)

---

name: Polish Notebook(s)
about: Finalize notebooks prior to publishing or promoting

---

## Related Issues and Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/SIMPLE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Related Issues and Dependencies
# Related Issues and Dependencies


Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: "🧪 Test builds (matrix)"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]

jobs:
pre-release:
# Don't run if pull request is NOT merged
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"
continue-on-error: true
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: "Populate environment variables"
id: setenv
run: |
echo "Action triggered by user: ${GITHUB_TRIGGERING_ACTOR}"
set -x
datetime=$(date +'%Y%m%d%H%M')
export datetime
echo "datetime=${datetime}" >> "$GITHUB_OUTPUT"
vernum="${{ matrix.python-version }}.${datetime}"
echo "vernum=${vernum}" >> "$GITHUB_OUTPUT"

- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions

- name: "Tag for test release"
# Delete all local tags, then create a synthetic tag for testing
# Use the date/time to avoid conflicts uploading to Test PyPI
run: |
scripts/dev-versioning.sh "${{ steps.setenv.outputs.vernum }}"
git tag | xargs -L 1 | xargs git tag --delete
git tag "v${{ steps.setenv.outputs.vernum }}"
git checkout "tags/v${{ steps.setenv.outputs.vernum }}"
grep version pyproject.toml

- name: "Build with TOX"
run: |
tox -e build
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Install dependencies
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: "⛔️ Update dependencies"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"

jobs:
update-dependencies:
name: "Update Python modules"
runs-on: ubuntu-latest
permissions:
# IMPORTANT: mandatory to raise the PR
id-token: write
pull-requests: write
repository-projects: write
contents: write

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3
with:
version: 2.10.0

- name: Update dependencies
uses: pdm-project/update-deps-action@main
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: "Chore: Update dependencies and pdm.lock"
pr-title: "Update Python module dependencies"
update-strategy: eager
# Whether to install PDM plugins before update
install-plugins: "false"
50 changes: 50 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: "🗒️ Build documentation"

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [closed]

jobs:
build_and_deploy:
# Don't run if pull request is NOT merged
if: github.event.pull_request.merged == true
name: "Rebuild documentation"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pdm export -o requirements.txt
if [ -f docs/requirements.txt ]; then
pip install -r docs/requirements.txt; fi

- name: "Build documentation: (tox/sphinx)"
run: |
tox -e docs

- name: "Publish documentation"
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
keep_files: true
5 changes: 3 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
Expand All @@ -23,7 +23,8 @@ jobs:

- name: Output Run ID
run: |
value=$(cat VERSION)
value=$(grep 'version =' pyproject.toml | \
awk '{print $3}' | sed 's:"::g')
echo "$value-dev${{ github.run_id }}" > VERSION
echo ${{ github.run_id }}

Expand Down
Loading
Loading