Skip to content

Commit

Permalink
Replace poetry by hatch (#3)
Browse files Browse the repository at this point in the history
* replaced poetry by hatch as project manager

* replaced taskipy by hatch as maintenance tasks manager

* Enhanced the helper script that renames project content

* added config file for dependabot

* Modified tags for release notes

* Modified github actions

* Extended text on README.md

* added api reference to docs

* review after implementing it on xcompact3d_toolbox

* refactor wizard script

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fschuch and pre-commit-ci[bot] committed Jun 7, 2024
1 parent 17a5721 commit 68c2a61
Show file tree
Hide file tree
Showing 27 changed files with 669 additions and 3,172 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
30 changes: 17 additions & 13 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
changelog:
categories:
- title: Breaking Changes
- title: Security
labels:
- major
- breaking-change
- title: Features
- security
- title: Removed
labels:
- minor
- feature
- title: Fixes
- removed
- title: Deprecated
labels:
- patch
- bug
- title: Docs
- deprecated
- title: Added
labels:
- documentation
- title: Upgrades
- added
- title: Changed
labels:
- dependencies
- changed
- title: Fixed
labels:
- fixed
- title: Documentation
labels:
- docs
- title: Internals
labels:
- chore
- refactor
- dependencies
- title: Other Changes
labels:
- "*"
2 changes: 2 additions & 0 deletions .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ jobs:
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
folder-path: "docs/"
file-path: "README.md"
108 changes: 108 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
push:
tags:
- "v*.*.*"
branches:
- "main"
- "release/**"
pull_request:
paths:
- .github/workflows/ci.yaml
- pyproject.toml
- tests/**
- wizard_template/**
schedule:
- cron: "0 0 * * 1" # midnight every Monday

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
qa:
# Static code analysis and linting powered by pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- uses: pre-commit/[email protected]

test:
needs: qa
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

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

- name: Install Hatch
run: python -m pip install hatch

- name: Run tests
run: |
hatch run +py=${{ matrix.python-version }} test:extended --cov-report=xml:coverage.${{ matrix.os }}.${{ matrix.python-version }}.xml
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage.*.xml

build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install Hatch
run: python -m pip install hatch
- name: Build package
run: hatch build
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: built-sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.whl
name: built-bdist

release:
needs: build
# upload to PyPI on every tag and ensure it does not run on forks
if: github.event_name == 'push' && github.ref_type == 'tag' && github.repository == 'fschuch/wizard_template'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/wizard_template
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: built-sdist
path: dist
- uses: actions/download-artifact@v4
with:
name: built-bdist
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
59 changes: 59 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Docs

# See:
# https://jupyterbook.org/en/stable/publish/gh-pages.html
on:
push:
tags:
- "v*.*.*"
branches:
- main
- release/**
pull_request:
paths:
- .github/workflows/docs.yaml
- docs/**
- wizard_template/**
- pyproject.toml

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Install Hatch
run: python -m pip install hatch

- name: Build the book
run: hatch run docs:build

- uses: actions/upload-artifact@v4
with:
path: build/
name: documentation

deploy:
needs: build
if: github.event_name == 'push' && github.ref_type == 'tag' && github.repository == 'fschuch/wizard_template'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: build/
name: documentation

# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/_build/html
50 changes: 0 additions & 50 deletions .github/workflows/publish-docs.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/publish-package.yaml

This file was deleted.

Loading

0 comments on commit 68c2a61

Please sign in to comment.