Skip to content

Commit

Permalink
rebase: using starbase
Browse files Browse the repository at this point in the history
  • Loading branch information
syu-w committed Jul 24, 2023
1 parent 86e3c52 commit 219630f
Show file tree
Hide file tree
Showing 62 changed files with 1,136 additions and 607 deletions.
43 changes: 43 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Editor configuration options.
# See: https://spec.editorconfig.org/
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[.editorconfig]
max_line_length = off

[Makefile]
indent_style = tab

[{*.py,*.pyi}]
max_line_length = 88

[{*.bash,*.sh,*.zsh}]
indent_size = 2
tab_width = 2

[{*.har,*.json,*.json5}]
indent_size = 2
max_line_length = off

[{*.markdown,*.md,*.rst}]
max_line_length = off
ij_visual_guides = none

[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}]
max_line_length = off

[{*.ini, *.cfg}]
max_line_length = off

[{*.yaml,*.yml}]
indent_size = 2
max_line_length = off
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox`?

-----
2 changes: 0 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ categories:
- title: "Tooling"
label:
- "tooling"

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'

template: |
Special thanks to the contributors that made this release happen: $CONTRIBUTORS
Expand Down
101 changes: 101 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
// Configuration file for RenovateBot: https://docs.renovatebot.com/configuration-options
extends: ["config:base"],
labels: ["dependencies"], // For convenient searching in GitHub
pip_requirements: {
fileMatch: ["^tox.ini$", "(^|/)requirements([\\w-]*)\\.txt$"]
},
packageRules: [
{
// Automerge patches, pin changes and digest changes.
// Also groups these changes together.
groupName: "bugfixes",
excludePackagePrefixes: ["dev", "lint", "types"],
matchUpdateTypes: ["patch", "pin", "digest"],
prPriority: 3, // Patches should go first!
automerge: true
},
{
// Update all internal packages in one higher-priority PR
groupName: "internal packages",
matchPackagePrefixes: ["craft-", "snap-"],
matchLanguages: ["python"],
prPriority: 2
},
{
// GitHub Actions are higher priority to update than most dependencies.
groupName: "GitHub Actions",
matchManagers: ["github-actions"],
prPriority: 1,
automerge: true,
},
// Everything not in one of these rules gets priority 0 and falls here.
{
// Minor changes can be grouped and automerged for dev dependencies, but are also deprioritised.
groupName: "development dependencies (non-major)",
groupSlug: "dev-dependencies",
matchPackagePrefixes: [
"dev",
"lint",
"types"
],
excludePackagePatterns: ["ruff"],
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
prPriority: -1,
automerge: true
},
{
// Documentation related updates
groupName: "documentation dependencies",
groupSlug: "doc-dependencies",
matchPackageNames: ["Sphinx"],
matchPackagePatterns: ["^[Ss]phinx.*$", "^furo$"],
matchPackagePrefixes: ["docs"],
},
{
// Other major dependencies get deprioritised below minor dev dependencies.
matchUpdateTypes: ["major"],
prPriority: -2
},
{
// Major dev dependencies are stone last, but grouped.
groupName: "development dependencies (major versions)",
groupSlug: "dev-dependencies",
matchDepTypes: ["devDependencies"],
matchUpdateTypes: ["major"],
prPriority: -3
},
{
// Ruff is still unstable, so update it separately.
groupName: "ruff",
matchPackagePatterns: ["^(lint/)?ruff$"],
prPriority: -3
}
],
regexManagers: [
{
// tox.ini can get updates too if we specify for each package.
fileMatch: ["tox.ini"],
depTypeTemplate: "devDependencies",
matchStrings: [
"# renovate: datasource=(?<datasource>\\S+)\n\\s+(?<depName>.*?)(\\[[\\w]*\\])*[=><]=?(?<currentValue>.*?)\n"
]
},
{
// .pre-commit-config.yaml version updates
fileMatch: [".pre-commit-config.yaml"],
depTypeTemplate: "devDependencies",
matchStrings: [
"# renovate: datasource=(?<datasource>\\S+);\\s*depName=(?<depName>.*?)\n\s+rev: \"v?(?<currentValue>.*?)\""
]
}
],
timezone: "Etc/UTC",
automergeSchedule: ["every weekend"],
schedule: ["every weekend"],
prConcurrentLimit: 2, // No more than 2 open PRs at a time.
prCreation: "not-pending", // Wait until status checks have completed before raising the PR
prNotPendingHours: 4, // ...unless the status checks have been running for 4+ hours.
prHourlyLimit: 1, // No more than 1 PR per hour.
stabilityDays: 2 // Wait 2 days from release before updating.
}
2 changes: 1 addition & 1 deletion .github/workflows/cla-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [pull_request]

jobs:
cla-check:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v1
37 changes: 37 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation
on:
push:
branches:
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
pull_request:
paths:
- "docs/**"
- "pyproject.toml"
- ".github/workflows/docs.yaml"

jobs:
sphinx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Tox
run: pip install tox
- name: Lint documentation
run: tox run -e lint-docs
- name: Build documentation
run: tox run -e build-docs
- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build/
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main

Expand All @@ -10,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5.7.0
uses: release-drafter/release-drafter@v5.23.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release
on:
push:
tags:
# These tags should be protected, remember to enable the rule:
# https://github.com/canonical/starbase/settings/tag_protection
- "[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: write

jobs:
source-wheel:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch tag annotations
run: |
git fetch --force --tags --depth 1
git describe --dirty --long --match '[0-9]*.[0-9]*.[0-9]*' --exclude '*[^0-9.]*'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
check-latest: true
- name: Build packages
run: |
pip install build twine
python3 -m build
twine check dist/*
- name: Upload pypi packages artifact
uses: actions/upload-artifact@v3
with:
name: pypi-packages
path: dist/
pypi:
needs: ["source-wheel"]
runs-on: ubuntu-latest
steps:
- name: Get packages
uses: actions/download-artifact@v3
with:
name: pypi-packages
path: dist/
- name: Publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
github-release:
needs: ["source-wheel"]
runs-on: ubuntu-latest
steps:
- name: Get pypi artifacts
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
**
Loading

0 comments on commit 219630f

Please sign in to comment.