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 6 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
}
45 changes: 24 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,24 @@ 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 }}

- 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 pip install --group nox

nox -s pytest
nox -s pytest-all-features -- --cov-append
Expand All @@ -70,8 +68,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 +97,8 @@ jobs:

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

coverage combine
coverage xml
coverage report
Expand All @@ -118,15 +117,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 pip install --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 +183,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 pip install --group nox

nox -s twemoji-test

docs:
Expand All @@ -198,15 +201,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 pip install --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 pip install --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
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ To aid with the generation of `CHANGELOG.md` as well as the releases changelog w

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 Down Expand Up @@ -79,7 +78,7 @@ We have nox to help out with running pipelines locally and provides some helpful

You will need to install `nox` locally before running any pipelines.
```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 Down
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.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion pipelines/audit.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@nox.session()
def audit(session: nox.Session) -> None:
"""Perform dependency scanning."""
session.install(*nox.dev_requirements("audit"))
session.install(*nox.dev_groups("audit"))
session.run(
"pip-audit",
"-r",
Expand Down
2 changes: 1 addition & 1 deletion pipelines/codespell.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@nox.session()
def codespell(session: nox.Session) -> None:
"""Run codespell to check for spelling mistakes."""
session.install(*nox.dev_requirements("codespell"))
session.install(*nox.dev_groups("codespell"))
session.run(
"codespell",
"--builtin",
Expand Down
2 changes: 1 addition & 1 deletion pipelines/flake8.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def flake8_html(session: nox.Session) -> None:


def _flake8(session: nox.Session, extra_args: typing.Sequence[str] = ()) -> None:
session.install("-r", "requirements.txt", *nox.dev_requirements("flake8"))
session.install(".", *nox.dev_groups("flake8"))
session.run(
"flake8",
"--statistics",
Expand Down
4 changes: 2 additions & 2 deletions pipelines/format.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@nox.session()
def reformat_code(session: nox.Session) -> None:
"""Remove trailing whitespace in source and then run ruff code formatter."""
session.install(*nox.dev_requirements("ruff"))
session.install(*nox.dev_groups("ruff"))

remove_trailing_whitespaces(session)

Expand All @@ -52,7 +52,7 @@ def reformat_code(session: nox.Session) -> None:
@nox.session()
def check_reformat_code(session: nox.Session) -> None:
"""TEMPORARY: Check if code is properly formatted."""
session.install(*nox.dev_requirements("ruff"))
session.install(*nox.dev_groups("ruff"))

# At the time of writing, sorting imports is not done when running formatting
# and needs to be done with ruff check
Expand Down
Loading
Loading