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

Configure Renovate #2184

Merged
merged 8 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 0 additions & 23 deletions .github/dependabot.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"dependencyDashboard": false,
"lockFileMaintenance": {
"enabled": true
},
"prHourlyLimit": 5
}
47 changes: 26 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
# TODO(https://github.com/astral-sh/setup-uv/issues/226): Remove this.
prune-cache: ${{ matrix.os != 'windows-latest' }}

- name: Test Installation
shell: bash
run: |
pip install -r dev-requirements/build.txt
uv pip install .
uv pip uninstall hikari

pip install .
pip uninstall -y hikari

pip install .[speedups]
pip uninstall -y hikari
uv pip install .[speedups]
uv pip uninstall hikari

- name: Run tests
shell: bash
run: |
pip install -r dev-requirements.txt
uv sync --frozen --only-group nox

nox -s pytest
nox -s pytest-all-features -- --cov-append
Expand All @@ -70,8 +70,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"

Expand Down Expand Up @@ -99,7 +99,8 @@ jobs:

- name: Combine coverage
run: |
pip install -r dev-requirements/coverage.txt
uv sync --frozen --only-group coverage

coverage combine
coverage xml
coverage report
Expand All @@ -118,15 +119,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.9

- name: Install nox
run: |
uv sync --frozen --only-group nox

- name: Check stubs
if: always()
run: |
pip install -r dev-requirements.txt
nox -s generate-stubs
if [ "$(git status --short)" ]; then
echo "Stubs were not updated accordingly to the changes. Please run 'nox -s generate-stubs' and commit the changes to fix this."
Expand Down Expand Up @@ -181,14 +185,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.9

- name: Test twemoji mapping
run: |
pip install -r dev-requirements.txt
uv sync --frozen --only-group nox

nox -s twemoji-test

docs:
Expand All @@ -198,15 +203,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
# NOTE: This should be kept up to date with .readthedocs.yaml
python-version: 3.11

- name: Build documentation
run: |
pip install -r dev-requirements.txt
uv sync --frozen --only-group nox
nox -s mkdocs

- name: Upload artifacts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/fragments-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
# needs a non-shallow clone.
fetch-depth: 0

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.9

- name: Check if changelog fragment was added
run: |
pip install -r dev-requirements/towncrier.txt
uv sync --frozen --only-group towncrier

if ! towncrier check --compare-with origin/${{ github.base_ref }}; then
exit 1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version to prepare the release for'
description: "The version to prepare the release for"
required: true

jobs:
Expand All @@ -31,8 +31,8 @@ jobs:
git config --global user.name "hikari-bot"
git config --global user.email "90276125+hikari-bot[bot]@users.noreply.github.com"

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.9

Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,15 @@ jobs:
git config --global user.name "hikari-bot"
git config --global user.email "90276125+hikari-bot[bot]@users.noreply.github.com"

- name: Setup python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.9

- name: Temporarily disable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@v1.1.2
with:
access_token: ${{ steps.generate_token.outputs.token }}
enforce_admins: false

- name: Release
env:
VERSION: ${{ github.event.release.tag_name }}
DEPLOY_WEBHOOK_URL: ${{ secrets.DEPLOY_WEBHOOK_URL }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
UV_PUBLISH_USERNAME: ${{ secrets.TWINE_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: bash scripts/ci/release.sh

- name: Re-enable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@v1.1.2
if: always()
with:
access_token: ${{ steps.generate_token.outputs.token }}
enforce_admins: true
3 changes: 1 addition & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ build:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv
- uv pip install -r dev-requirements.txt
- uv sync --frozen --only-group nox
- .venv/bin/nox -s mkdocs
30 changes: 19 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ repository.
Please also refer to the [EffVer Versioning specification](https://jacobtomlinson.dev/effver/) for more information.

More specifically:

- Major bump: Big changes to the public facing API.
- Minor bump: New features or changes that require some developer interaction to upgrade to, including
- Minor bump: New features or changes that require some developer interaction to upgrade to, including
removal/renaming of features.
- Micro bump: Bug fixes and new features that require no end developer interaction (deprecations can be included here).

Expand All @@ -35,9 +36,9 @@ match that of the versioning scheme. There are utilities under `hikari.internal.
To aid with the generation of `CHANGELOG.md` as well as the releases changelog we use `towncrier`.

You will need to install `towncrier` and `hikari` from source before making changelog additions.

```bash
pip install -r dev-requirements/towncrier.txt
pip install -e .
pip install --group towncrier -e .
```

For every pull request made to this project, there should be a short explanation of the change under `changes/`
Expand All @@ -63,11 +64,12 @@ Multiple fragment types can be created per pull request if it covers multiple ar
We would like to keep consistency in naming branches in the remote.

To push branches directly to the remote, you will have to name them like this:
- `feature/issue-number-small-info-on-branch`

- `feature/issue-number-small-info-on-branch`
- This should be used for branches that require more tasks to merge into before going as one MR into `master`.
- `bugfix/issue-number-small-info-on-branch`
- `bugfix/issue-number-small-info-on-branch`
- This should be used for bugfixes.
- `task/issue-number-small-info-on-branch`
- `task/issue-number-small-info-on-branch`
- This should be the default for any commit that doesn't fall in any of the cases above.

`issue-number` is optional (only use if issue exists) and can be left out. `small-info-on-branch` should be replaced
Expand All @@ -78,8 +80,13 @@ with a small description of the branch.
We have nox to help out with running pipelines locally and provides some helpful functionality.

You will need to install `nox` locally before running any pipelines.

> [!TIP]
> We use the `uv` package manager as a faster drop-in replacement for pip. While it's not required to use in order to
> contribute to hikari, it's highly recommended! If you use it, replace `pip` commands below with `uv pip`.

```bash
pip install -r dev-requirements.txt
pip install --group nox
```

Nox is similar to tox, but uses a pure Python configuration instead of an INI based configuration. Nox and tox are
Expand All @@ -97,13 +104,14 @@ You may run a single pipeline with `nox -s name` or multiple pipelines with `nox
We have several jobs to ensure that the code is at its best that in can be.

This includes:
- `test`

- `test`
- Run tests and installation of the package on different OS's and python versions.
- `linting`
- `linting`
- Linting (`flake8`), type checking (`mypy`), audit (`pip-audit`) and spelling (`codespell`).
- `twemoji`
- `twemoji`
- Force test all discord emojis.
- `pages`
- `pages`
- Generate webpage + documentation.

All jobs will need to succeed before anything gets merged.
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ In the repository, make a virtual environment (`python -m venv .venv`) and enter
Linux, or for Windows use one of `.venv\Scripts\activate.ps1`, `.venv\Scripts\activate.bat`,
`source .venv/Scripts/activate`).

The first thing you should run is `pip install -r dev-requirements.txt` to install nox.
The first thing you should run is `pip install --group nox` to install nox.
This handles running predefined tasks and pipelines.

Once this is complete, you can run `nox` without any arguments to ensure everything builds and is correct.
Expand Down
1 change: 0 additions & 1 deletion dev-requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/audit.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev-requirements/build.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/codespell.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/coverage.txt

This file was deleted.

21 changes: 0 additions & 21 deletions dev-requirements/flake8.txt

This file was deleted.

21 changes: 0 additions & 21 deletions dev-requirements/mkdocs.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/mypy.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/pyright.txt

This file was deleted.

11 changes: 0 additions & 11 deletions dev-requirements/pytest.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev-requirements/release.txt

This file was deleted.

Loading