Skip to content

Commit a1fbf7f

Browse files
authored
Merge pull request #37 from DisnakeCommunity/docs
Finalise rewrite and prepare for release
2 parents f90c6fd + 8edd990 commit a1fbf7f

File tree

117 files changed

+11445
-4337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+11445
-4337
lines changed

Diff for: .env.example

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The bot token with which to run example files.
2+
# This is used as a convenient way of testing examples through
3+
# > poetry run example <example name>
4+
5+
EXAMPLE_TOKEN = ...

Diff for: .flake8

-16
This file was deleted.

Diff for: .github/ISSUE_TEMPLATE/bug_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ body:
4848
render: markdown
4949
label: System Information
5050
description: >
51-
Please provide us with the version of `disnake` and `disnake-ext-components` you are running.
52-
This can be done using `python -m pip show disnake` and `python -m pip show disnake-ext-components`
51+
Please provide us with the version of `disnake` and `disnake-compass` you are running.
52+
This can be done using `python -m pip show disnake` and `python -m pip show disnake-compass`
5353
5454
If you are unable to run these commands, show some basic information involving
5555
your system such as operating system and Python version.

Diff for: .github/ISSUE_TEMPLATE/feature_request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
multiple: false
1515
label: What is the feature request for?
1616
options:
17-
- disnake.ext.components
17+
- disnake_compass
1818
- The documentation
1919
validations:
2020
required: true

Diff for: .github/actions/bootstrap/action.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Bootstrap disnake-compass
2+
description: Configure the environment with the specified Python version.
3+
4+
inputs:
5+
python-version:
6+
required: true
7+
type: string
8+
9+
outputs:
10+
python-version:
11+
description: Version of the installed Python interpreter.
12+
value: ${{ steps.setup-python.outputs.python-version }}
13+
14+
runs:
15+
using: composite
16+
17+
steps:
18+
- name: Set up python
19+
id: setup-python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ inputs.python-version }}
23+
24+
- name: Install poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
30+
- name: Load cached venv
31+
id: cache-poetry-dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: .venv
35+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
36+
37+
- name: Install dependencies
38+
if: steps.cache-poetry-dependencies.outputs.cache-hit != 'true'
39+
run: |
40+
poetry env use ${{ steps.setup-python.outputs.python-version }}
41+
poetry install --no-interaction --no-root --without docs
42+
shell: bash
43+
44+
- name: Install disnake-compass
45+
run: poetry install --no-interaction --only-root
46+
shell: bash
47+
48+
- name: Activate venv
49+
run: source .venv/bin/activate
50+
shell: bash

Diff for: .github/workflows/lint.yml

-75
This file was deleted.

Diff for: .github/workflows/validate.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: validate
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pyright:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12", "3.13"]
14+
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Bootstrap disnake-compass
20+
uses: ./.github/actions/bootstrap
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Run pyright
25+
run: poetry run pyright .
26+
27+
ruff-lint:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Check out repository
32+
uses: actions/checkout@v4
33+
34+
- name: Bootstrap disnake-compass
35+
uses: ./.github/actions/bootstrap
36+
with:
37+
python-version: '3.10'
38+
39+
- name: Run ruff linter
40+
run: poetry run ruff check --fix --exit-non-zero-on-fix
41+
42+
ruff-format:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Check out repository
47+
uses: actions/checkout@v4
48+
49+
- name: Bootstrap disnake-compass
50+
uses: ./.github/actions/bootstrap
51+
with:
52+
python-version: '3.10'
53+
54+
- name: Run ruff formatter
55+
run: poetry run ruff format --check

Diff for: .gitignore

+72-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,76 @@
1-
__pycache__
2-
.vscode
3-
.mypy_cache
4-
*.egg-info/
5-
*env*/
6-
71
test.py
82
*.ipynb
93

10-
tests/_*.py
11-
coverage.*
4+
# Adapted from https://github.com/github/gitignore/blob/main/Python.gitignore
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# Unit test / coverage reports
35+
htmlcov/
36+
.tox/
37+
.nox/
1238
.coverage
39+
.coverage.*
40+
.cache
41+
nosetests.xml
42+
coverage.xml
43+
*.cover
44+
*.py,cover
45+
.hypothesis/
46+
.pytest_cache/
47+
cover/
48+
49+
# Sphinx documentation
50+
docs/build/
51+
52+
# PyBuilder
53+
.pybuilder/
54+
target/
55+
56+
# Jupyter Notebook
57+
.ipynb_checkpoints
58+
59+
# IPython
60+
profile_default/
61+
ipython_config.py
62+
63+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
64+
__pypackages__/
65+
66+
# Environments
67+
.env
68+
.venv
69+
env/
70+
venv/
71+
ENV/
72+
env.bak/
73+
venv.bak/
74+
75+
# Ruff stuff:
76+
.ruff_cache/

Diff for: .pre-commit-config.yaml

+29-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
1-
## Pre-commit setup, mostly yoinked from disnake
1+
## Pre-commit setup, mostly yoinked from disnake/mafic
22

3+
ci:
4+
autofix_commit_msg: |
5+
style: auto fixes from pre-commit hooks
36
repos:
47
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.2.0
8+
rev: v4.4.0
69
hooks:
10+
- id: check-ast
11+
name: Check if python files are valid syntax for the ast parser
712
- id: check-case-conflict
13+
name: Check for case conflict on file names for case insensitive systems.
14+
- id: check-merge-conflict
15+
name: Check for merge conflict syntax.
816
- id: check-toml
17+
name: Check TOML files for valid syntax.
918
- id: check-yaml
19+
name: Check YAML files for valid syntax.
20+
- id: debug-statements
21+
name: Check for debug statements.
1022
- id: end-of-file-fixer
23+
name: Check for only one newline character at EOL.
1124
- id: trailing-whitespace
25+
name: Check for trailing whitespace.
1226
args: [--markdown-linebreak-ext=md]
1327

14-
- repo: https://github.com/pycqa/isort
15-
rev: 5.10.1
28+
- repo: https://github.com/charliermarsh/ruff-pre-commit
29+
rev: v0.9.6
1630
hooks:
17-
- id: isort
18-
name: Running isort in all files.
31+
- id: ruff
32+
args: [--fix, --exit-non-zero-on-fix]
33+
name: Running ruff in all files.
34+
- id: ruff-format
1935

20-
- repo: https://github.com/psf/black
21-
rev: 22.3.0
36+
- repo: https://github.com/ariebovenberg/slotscheck
37+
rev: v0.19.1
2238
hooks:
23-
- id: black
24-
name: Running black in all files.
25-
26-
- repo: local
27-
hooks:
28-
- id: flake8
29-
name: flake8
30-
description: 'Lint all of our code'
31-
entry: flake8
32-
language: python
33-
types: [python]
34-
require_serial: true
39+
- id: slotscheck
40+
entry: env PYTHONPATH=src slotscheck
41+
language: system
42+
exclude: "^(?!src/)"
43+
args: ["--verbose", "--require-subclass"]

Diff for: .readthedocs.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
7+
8+
jobs:
9+
post_create_environment:
10+
- pip install poetry
11+
12+
post_install:
13+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
14+
15+
sphinx:
16+
configuration: docs/source/conf.py
17+
fail_on_warning: false
18+
builder: html

0 commit comments

Comments
 (0)