Skip to content

Commit

Permalink
Merge branch 'main' into docs-for-extrapolate-eh
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray authored Jul 24, 2024
2 parents 6e0a1d0 + 2086395 commit 10d4046
Show file tree
Hide file tree
Showing 30 changed files with 335 additions and 192 deletions.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: monthly
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: monthly
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
versioning-strategy: lockfile-only
allow:
- dependency-type: "all"
Empty file added .github/labels.yml
Empty file.
77 changes: 77 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# See https://github.com/marketplace/actions/release-drafter for configuration
categories:
- title: ":boom: Breaking Changes"
labels:
- "API breaking"
- title: ":rocket: Features"
labels:
- "type: feature: ui"
- "type: feature: physical"
- title: ":fire: Removals and Deprecations"
labels:
- "type: maint: removal"
- title: ":beetle: Fixes"
labels:
- "type: bug"
- title: ":racehorse: Performance"
labels:
- "type: performance: memory"
- "type: performance: cpu"
- "type: accuracy"
- title: ":rotating_light: Testing"
labels:
- "type: testing"
- title: ":construction_worker: Continuous Integration"
labels:
- "type: ci"
- title: ":books: Documentation"
labels:
- "type: maint: documentation"
- title: ":hammer: Refactoring"
labels:
- "type: maint: refactoring"
- title: ":lipstick: Style"
labels:
- "type: maint: style"
- title: ":package: Dependencies"
labels:
- "type: maint: dependencies"
- "type: maint: build"

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

autolabeler:
- label: 'type: maint: documentation'
files:
- '*.md'
- '*.rst'
- 'docs/**/*'
branch:
- '/.*docs{0,1}.*/'
- label: 'type: bug'
branch:
- '/fix.*/'
title:
- '/fix/i'
- label: "type: maint: removal"
title:
- "/remove .*/i"
- label: "type: ci"
files:
- '.github/*'
- '.pre-commit-config.yaml'
- '.coveragrc'
branch:
- '/pre-commit-ci-update-config/'
- label: "type: maint: style"
files:
- '/pre-commit-ci-update-config/'
- label: "type: maint: refactoring"
title:
- "/.* refactor.*/i"

template: |
## Changes
$CHANGES
14 changes: 14 additions & 0 deletions .github/workflows/auto-merge-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: auto-merge

on:
pull_request:

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.AUTO_MERGE }}
27 changes: 27 additions & 0 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check Distribution Build

on: push

jobs:
check-build:
name: Twine Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Build Tools
run: pip install build twine

- name: Build a binary wheel
run: |
python -m build .
- name: Check Distribution
run: |
twine check dist/*
19 changes: 19 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Labeler

on: push

jobs:
labeler:
runs-on: ubuntu-latest
permissions:
issues: write
content: read

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Run Labeler
uses: crazy-max/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 0 additions & 27 deletions .github/workflows/merge-me.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/merge-to-dev.yaml

This file was deleted.

52 changes: 20 additions & 32 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
name: Deploy to PyPI
name: Publish Python distributions to PyPI

on: push
on:
release:
types: [published]

jobs:
build-n-publish:
name: Deploy
runs-on: ubuntu-22.04
name: Make Release on PyPI and Github
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git describe --tags
git describe --tags $(git rev-list --tags --max-count=1)
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pep517
run: |
python -m pip install pep517 --user
python -m pip install setuptools_scm
python setup.py --version
- name: Create setuptools_scm env variable
if: startsWith(github.ref, 'refs/tags/') != true
shell: bash
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Build Tools
run: pip install build

- name: Build a binary wheel
run: |
wget https://gist.github.com/plaplant/0902f09e59166bac742bbd554f3cd2f9/raw/make_dev_version.sh -O ../make_dev_version.sh
version=$(bash ../make_dev_version.sh)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$version" >> $GITHUB_ENV
- name: Build a binary wheel and a source tarball
run: python -m pep517.build --binary --source --out-dir dist .
# deploy to actual PyPI only when a tag is pushed (which should happen only
# automatically on master)
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
python -m build .
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
21 changes: 21 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update Draft Release

on: push

jobs:
draft-release:
name: Update Draft Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Publish the release notes
uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 0 additions & 17 deletions .github/workflows/tag-release.yaml

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ name: Tests
# Also, only test on pull requests into master/dev.
on:
push:
tags-ignore:
- 'v*'
pull_request:
branches:
- 'master'
- 'dev'
- 'main'

jobs:
tests:
Expand All @@ -26,12 +23,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: fortran-lang/setup-fortran@v1
Expand All @@ -44,7 +41,7 @@ jobs:
- name: Run Tests
run: |
python -m pytest --cov=hmf --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && success() && !contains(github.event.pull_request.labels.*.name, 'auto-pr')
with:
file: ./coverage.xml # optional
Expand Down
Loading

0 comments on commit 10d4046

Please sign in to comment.