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

many: merge starbase/main #74

Merged
merged 90 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 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
071d217
Merge remote-tracking branch 'starbase/main' into merge-starbase
tigarmo May 22, 2023
8598415
lint: specify codespell-ignore-lines file
tigarmo May 22, 2023
a3bc408
lint: make yamllint ignore .git
tigarmo May 22, 2023
a88e23b
lint: minor fixes for ruff
tigarmo May 22, 2023
b23d3b3
docs: fix wrong code-blocks
tigarmo May 22, 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
2 changes: 1 addition & 1 deletion .github/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ categories:
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
Special thanks to the contributors that made this release happen: $CONTRIBUTORS

## Full list of changes

$CHANGES
54 changes: 41 additions & 13 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
{
// 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$"]
},
pip_setup: {
fileMatch: ["^pyproject.toml$", "(^|/)setup\\.py$"]
fileMatch: ["^tox.ini$", "(^|/)requirements([\\w-]*)\\.txt$"]
},
packageRules: [
{
// Automerge patches, pin changes and digest changes.
// Also groups these changes together.
groupName: "patch updates",
groupName: "bugfixes",
excludePackagePrefixes: ["dev", "lint", "types"],
matchUpdateTypes: ["patch", "pin", "digest"],
prPriority: 3, // Patches should go first!
automerge: true
Expand All @@ -28,28 +26,50 @@
// GitHub Actions are higher priority to update than most dependencies.
groupName: "GitHub Actions",
matchManagers: ["github-actions"],
prPriority: 1
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 (minor and patch)",
groupName: "development dependencies (non-major)",
groupSlug: "dev-dependencies",
matchDepTypes: ["devDependencies"],
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.
// 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: [
Expand All @@ -58,14 +78,22 @@
fileMatch: ["tox.ini"],
depTypeTemplate: "devDependencies",
matchStrings: [
"# renovate: datasource=(?<datasource>\S+)\n\s+(?<depName>.*?)(\[[\w]*\])*[=><]=?(?<currentValue>.*?)\n"
"# 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: "before 7 am",
automergeSchedule: "every weekend",
schedule: "every weekend",
prConcurrentLimit: 5, // No more than 5 open PRs at a time.
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.
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Documentation
on:
push:
branches:
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
pull_request:
paths:
- "docs/**"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
- main
lengau marked this conversation as resolved.
Show resolved Hide resolved

jobs:
update_release_draft:
Expand All @@ -17,6 +17,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v5.23.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
directory: ./results/
files: coverage*.xml
- name: Upload test results
if: always()
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.platform }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ dmypy.json

# Test results
/results/

# direnv
.envrc
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: fix-byte-order-marker
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
# renovate: datasource=pypi;depName=ruff
rev: "v0.0.267"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
# renovate: datasource=pypi;depName=black
rev: "23.3.0"
hooks:
- id: black
- repo: https://github.com/adrienverge/yamllint.git
# renovate: datasource=pypi;depName=yamllint
rev: "v1.31.0"
hooks:
- id: yamllint
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf
- epub

build:
os: ubuntu-22.04
tools:
python: "3"

python:
install:
- method: pip
path: .
extra_requirements:
- docs
1 change: 1 addition & 0 deletions .yamlignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git/
12 changes: 12 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
ignore-from-file: [.gitignore, .yamlignore]

extends: default

rules:
document-start: disable
float-values: enable
line-length: disable
octal-values: enable
truthy:
check-keys: false
24 changes: 24 additions & 0 deletions HACKING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We use a large number of tools for our project. Most of these are installed for
- tox_ version 4 or later. (3.8+ will automatically provision a v4 virtualenv)
- Pyright_ (it's recommended you install with ``snap install --classic pyright``)
- ShellCheck_ (also available via snap: ``snap install shellcheck``)
- pre-commit_

Once you have all of those installed, you can install the necessary virtual environments for this repository using tox.

Expand Down Expand Up @@ -44,10 +45,33 @@ If you'd like to run the tests with a newer version of Python, you can pass a sp

tox -e test-py310

While the use of pre-commit_ is optional, it is highly encouraged, as it runs automatic fixes for files when `git commit` is called, including code formatting with ``black`` and ``ruff``. The versions available in ``apt`` from Debian 11 (bullseye), Ubuntu 22.04 (jammy) and newer are sufficient, but you can also install the latest with ``pip install pre-commit``. Once you've installed it, run ``pre-commit install`` in this git repository to install the pre-commit hooks.

Tox environments and labels
###########################

We group tox environments with the following labels:

* ``format``: Runs all code formatters with auto-fixing
* ``type``: Runs all type checkers
* ``lint``: Runs all linters (including type checkers)
* ``unit-tests``: Runs unit tests in Python versions on supported LTS's + latest
* ``integration-tests``: Same as above but for integration tests
* ``tests``: The union of ``unit-tests`` and ``integration-tests``

For each of these, you can see which environments will be run with ``tox list``. For example:

tox list -m lint

You can also see all the environments by simply running ``tox list``

Running ``tox run -m format`` and ``tox run -m lint`` before committing code is recommended.

.. _Black: https://black.readthedocs.io
.. _`Canonical contributor licence agreement`: http://www.ubuntu.com/legal/contributors/
.. _deadsnakes: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
.. _`git submodules`: https://git-scm.com/book/en/v2/Git-Tools-Submodules#_cloning_submodules
.. _pre-commit: https://pre-commit.com/
.. _pyproject.toml: ./pyproject.toml
.. _Pyright: https://github.com/microsoft/pyright
.. _pytest: https://pytest.org
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TODO for craft-archives
TODO for craft-archives
2 changes: 2 additions & 0 deletions docs/reference/repo_properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ UCA repository using "cloud" property
-------------------------------------

.. code-block:: yaml

package-repositories:
- type: apt
cloud: antelope
Expand All @@ -152,6 +153,7 @@ UCA repository using "pocket" property
--------------------------------------

.. code-block:: yaml

package-repositories:
- type: apt
cloud: antelope
Expand Down
Loading