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

Merge starbase/main #145

Merged
merged 104 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
b36b88c
Initial commit
lengau Jan 20, 2023
23aa1a7
base: Initial specification for the base repository (#2)
lengau Jan 25, 2023
552c132
tools: Update tox and setuptools to fix breakages (#4)
lengau Jan 25, 2023
9a0cae5
tools: Split unit and integration tests
lengau Jan 25, 2023
f676cdc
tools: Make renovate cleaner. (#5)
lengau Jan 25, 2023
70a1551
Better comment
lengau Jan 25, 2023
229ee11
tools: Configure mypy (#6)
lengau Jan 26, 2023
63fc646
tools: Split unit and integration tests (#7)
lengau Jan 26, 2023
605bec2
docs: Basic sphinx docs
lengau Jan 26, 2023
28bb9d8
tests: coverage has per-env files
lengau Jan 26, 2023
4d76e9f
Merge remote-tracking branch 'origin/integration-test' into integrati…
lengau Jan 26, 2023
a59bb4d
tools: Make typing use an editable install
lengau Jan 26, 2023
b715342
Merge pull request #14 from lengau/pyright
lengau Jan 26, 2023
7e30bab
Merge pull request #13 from lengau/integration-test
lengau Jan 26, 2023
77b955b
Configure sphinx-lint
lengau Jan 26, 2023
08a1e8d
Merge pull request #12 from lengau/sphinx
lengau Jan 26, 2023
f2f804d
chore(tools): Make pyproject.toml exclude rather than include
lengau Jan 26, 2023
283c21e
Merge pull request #15 from lengau/auto-find
lengau Jan 26, 2023
067df32
chore(deps): update release-drafter/release-drafter action to v5.22.0
renovate[bot] Jan 28, 2023
f3e23e3
chore(deps): update dependency pytest to v7.2.1
renovate[bot] Jan 28, 2023
bcadedb
chore(deps): update dependency tox to v4.4.2
renovate[bot] Jan 28, 2023
84cc930
Merge pull request #19 from canonical/renovate/tox-4.x
lengau Jan 28, 2023
97ca903
Merge pull request #17 from canonical/renovate/github-actions
lengau Jan 28, 2023
1a08aca
chore(deps): update dependency tox-ignore-env-name-mismatch to v0.2.0…
renovate[bot] Jan 28, 2023
cc3957c
Merge pull request #16 from canonical/renovate/patch-updates
lengau Jan 28, 2023
eb5a438
Merge pull request #18 from canonical/renovate/pytest-7.x
lengau Jan 30, 2023
0f3d7d0
lint: specify a single ruff version (#21)
lengau Feb 1, 2023
5a0d09f
tools: add yamllint (#11)
lengau Feb 1, 2023
9c1ea2a
readme: update name (#23)
sergiusens Feb 1, 2023
f3d35a6
chore(lint): update ruff and config (#22)
lengau Feb 1, 2023
cd2832b
tools: add sphinx-lint to regular linting
tigarmo Feb 3, 2023
130845c
docs: use Ubuntu font
tigarmo Feb 3, 2023
ec396df
docs: treat warnings as errors in build
tigarmo Feb 3, 2023
34e0222
tools: add sphinx-autobuild
tigarmo Feb 3, 2023
dbd1b1d
tools: rename sphinx-build and rundocs
tigarmo Feb 3, 2023
8abb221
chore(deps): update dependency setuptools to v67 (#26)
renovate[bot] Feb 5, 2023
4b3781b
chore(deps): update patch updates (#25)
renovate[bot] Feb 5, 2023
679c20f
tools: Add editorconfig (#9)
lengau Feb 6, 2023
2aaed7e
tools: improve coverage support in the tox test environments (#32)
lengau Feb 13, 2023
f4774ed
tools: fix the PR template name (#31)
lengau Feb 13, 2023
3ea924f
chore(deps): update dependency setuptools to v67.2.0 (#30)
renovate[bot] Feb 13, 2023
2c6d0ba
chore(deps): update patch updates (#29)
renovate[bot] Feb 14, 2023
a0e2622
lint(shellcheck): replace `find` with `git ls-files` (#33)
mr-cal Feb 17, 2023
2390266
lint: freeze the linter versions (#27)
lengau Feb 17, 2023
ee3c053
lint: skip more commonly ignored files and directories with codespell…
mr-cal Feb 17, 2023
d9c79f0
chore(deps): update dependency mypy to v1 (#39)
renovate[bot] Feb 19, 2023
867bb8f
chore(deps): update dependency ruff to v0.0.247 (#37)
renovate[bot] Feb 19, 2023
821339b
chore(deps): update dependency black to v23 (#38)
renovate[bot] Feb 19, 2023
6b9719a
chore(deps): update dependency setuptools to v67.3.2 (#36)
renovate[bot] Feb 19, 2023
cf1d018
deps: group major dev dependency versions (#28)
lengau Feb 19, 2023
c99b12b
chore(deps): update patch updates (#40)
renovate[bot] Feb 28, 2023
ffa1dec
chore(deps): update dependency coverage to v7.2.1 (#42)
renovate[bot] Feb 28, 2023
6c1a196
chore(deps): update dependency setuptools to v67.4.0 (#43)
renovate[bot] Feb 28, 2023
c0ccfda
chore(deps): update release-drafter/release-drafter action to v5.23.0…
renovate[bot] Feb 28, 2023
7f8ff19
docs: Tox environments and labels (#44)
lengau Mar 1, 2023
e1a7c75
ci: don't upload test results when cancelling the workflow #46
lengau Mar 9, 2023
4cd5f91
chore(deps): update patch updates (#45)
renovate[bot] Mar 19, 2023
a4a079a
chore(deps): update dependency setuptools to v67.6.0 (#48)
renovate[bot] Mar 20, 2023
2206424
chore(deps): update dependency mypy to v1.1.1 (#47)
renovate[bot] Mar 28, 2023
fe58f83
chore(deps): update dependency black to v23.3.0 (#49)
renovate[bot] May 10, 2023
3f6896c
chore(deps): update dependency mypy to v1.2.0 (#50)
renovate[bot] May 10, 2023
263a302
chore(deps): update dependency furo to v2023 (#52)
renovate[bot] May 10, 2023
9de5c85
chore(deps): update dependency yamllint to v1.31.0 (#51)
renovate[bot] May 10, 2023
4adb069
tox: move deps from tox.ini into pyproject.toml (#53)
lengau May 10, 2023
eaa6714
deps: fix renovate automerge schedule
lengau May 10, 2023
c6464d4
tools: further improve renovate
lengau May 10, 2023
39c3a7f
chore(deps): update dependency setuptools to v67.7.2 (#57)
renovate[bot] May 18, 2023
22ec1ca
chore(deps): update dependency types/mypy to v1.3.0 (#58)
renovate[bot] May 18, 2023
8d2bbf7
chore(deps): update dependency dev/pytest to v7.3.1 (#59)
renovate[bot] May 18, 2023
eae3d8a
chore(deps): update dependency docs/sphinx-design to v0.4.1 (#60)
renovate[bot] May 18, 2023
dba8423
chore(deps): update dependency lint/yamllint to v1.31.0 (#61)
renovate[bot] May 18, 2023
8cc8d44
chore(deps): update dependency sphinx-copybutton to v0.5.2 (#63)
renovate[bot] May 18, 2023
ff2ac00
chore(deps): update dependency coverage to v7.2.5 (#64)
renovate[bot] May 18, 2023
1949d4c
chore(deps): update bugfixes (#62)
renovate[bot] May 18, 2023
cc4c430
ci: add documentation build (#65)
lengau May 19, 2023
189835b
tools: fix ruff linting command in tox (#66)
lengau May 19, 2023
ffe9887
chore(deps): update dependency ruff to v0.0.269 (#69)
renovate[bot] May 19, 2023
3fd96e9
chore(deps): update bugfixes (#70)
renovate[bot] May 19, 2023
f4f5541
docs: update sphinx to 6
lengau May 19, 2023
06c70ba
meta: dynamic version info (#67)
lengau May 19, 2023
78f1252
tools: improve renovate config (#72)
lengau May 19, 2023
7a22e93
tools: add pre-commit (#68)
lengau May 19, 2023
01be79d
.gitignore: ignore direnv's .envrc file (#75)
mr-cal May 19, 2023
d6c7315
chore(deps): update dependency docs/furo to v2023.5.20 (#76)
renovate[bot] May 22, 2023
4477363
chore(deps): update dependency lint/yamllint to v1.32.0 (#77)
renovate[bot] May 22, 2023
82c2f3f
ci: fix release-drafter config (#78)
lengau May 22, 2023
e64e1e0
ci: fix name of release-drafter config file (#79)
tigarmo May 24, 2023
d38e78c
meta: dynamic versioning (#80)
lengau May 25, 2023
ba60c11
chore(deps): update development dependencies (non-major) (#83)
renovate[bot] Jun 6, 2023
b5cda0d
lint: stricter ruff rules (#55)
lengau Jun 6, 2023
13c852f
Merge remote-tracking branch 'starbase/main' into merge-starbase
tigarmo Jun 6, 2023
4e6a7c3
build: consolidate into pyproject.toml
tigarmo Jun 7, 2023
6648905
lint: configure black
tigarmo Jun 7, 2023
e124a5b
meta: dynamic versioning
tigarmo Jun 7, 2023
fd8d358
lint: fixes for mypy
tigarmo Jun 7, 2023
151effb
lint: disable ruff
tigarmo Jun 7, 2023
5d5c9c5
lint: disable pyright
tigarmo Jun 7, 2023
21263aa
lint: configure and fix for sphinx-lint
tigarmo Jun 7, 2023
2c6b60c
tools: reduce mandatory coverage
tigarmo Jun 7, 2023
802f043
docs: consolidate craft-cli and starbase docs
tigarmo Jun 7, 2023
b7f7e16
many: cleanups from the starbase merge
tigarmo Jun 7, 2023
aacea7f
ci: add macos and windows
tigarmo Jun 7, 2023
a7464b2
tools: sync versions in pre-commit
tigarmo Jun 13, 2023
710760e
lint: re-add pylint
tigarmo Jun 15, 2023
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
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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- [ ] 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/
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

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

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5.23.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114 changes: 59 additions & 55 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,75 +1,79 @@
name: Tests

name: Tests, linting, etc.
on:
pull_request:
push:
branches:
- main
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
pull_request:

jobs:
linters:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install python packages and dependencies
run: |
pip install -U -e .[dev]
- name: Run black
run: |
make test-black
- name: Run codespell
run: |
make test-codespell
- name: Run flake8
run: |
make test-flake8
- name: Run isort
run: |
make test-isort
- name: Run mypy
run: |
make test-mypy
- name: Run pydocstyle
python-version: '3.10'
- name: Configure environment
run: |
make test-pydocstyle
- name: Run pylint
run: |
make test-pylint
- name: Run pyright
run: |
sudo snap install --classic node
sudo snap install --classic pyright
make test-pyright

echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --classic pyright
sudo snap install --no-wait shellcheck
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox>=4' tox-gh
echo "::endgroup::"
echo "::group::Create virtual environments for linting processes."
tox run -m lint --notest
echo "::endgroup::"
echo "::group::Wait for snap to complete"
snap watch --last=install
echo "::endgroup::"
- name: Run Linters
run: tox run -m lint
tests:
strategy:
matrix:
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12-dev"]

runs-on: ${{ matrix.os }}
platform: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
- name: Set up Python versions on ${{ matrix.platform }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install generic dependencies and craft-cli
python-version: |
3.8
3.9
3.10
3.11
3.12-dev
- name: Configure environment
run: |
pip install -U -e .[dev]
- name: Run unit tests
run: |
make test-units
- name: Run integration tests
run: |
make test-integrations
echo "::group::pip install"
python -m pip install 'tox>=4' tox-gh
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run -m tests --notest
- name: Test with tox
run: tox run-parallel --parallel all --parallel-no-spinner --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -m tests -- --no-header --quiet -rN
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
directory: ./results/
files: coverage*.xml
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.platform }}
path: results/
Loading