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

Bump piped from 90e9b19 to 470915f #980

Merged
merged 10 commits into from
Dec 1, 2024
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
2 changes: 1 addition & 1 deletion .github/actions/setup-py/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ runs:
python-version: ${{ inputs.python-version }}

- name: Install Nox
run: pipx install nox --python "${{ steps.install-py.outputs.python-path }}"
run: pipx install uv nox[uv] --python "${{ steps.install-py.outputs.python-path }}"
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/freeze-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches:
- master
paths: ["piped", "pyproject.toml", "requirements.in", "dev-requirements/*.in", "!dev-requirements/constraints.in"]
paths: ["piped", "pyproject.toml"]

jobs:
freeze-pr-dep-changes:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Check spelling
run: nox -s spell-check

- name: Lint with flake8
run: nox -s flake8
- name: Lint with Ruff
run: nox -s lint

- name: Check slotting
run: nox -s slot-check
29 changes: 0 additions & 29 deletions .github/workflows/verify-locks.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Renamed the `case_sensntive` argument to `case_sensitive` in `MessageCommand.find_command`.

### Deprecated
- The old `case_sensntive` argument alias in `MessageCommand.find_command`.

## [2.17.7] - 2024-11-24
### Fixed
- Moved away from using `typing.runtime_checkable` as this is unreliable in
Expand Down
3 changes: 0 additions & 3 deletions dev-requirements/constraints.in

This file was deleted.

478 changes: 0 additions & 478 deletions dev-requirements/constraints.txt

This file was deleted.

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

This file was deleted.

9 changes: 0 additions & 9 deletions dev-requirements/tests.in

This file was deleted.

583 changes: 0 additions & 583 deletions dev-requirements/tests.txt

This file was deleted.

4 changes: 0 additions & 4 deletions dev-requirements/type-checking.in

This file was deleted.

643 changes: 0 additions & 643 deletions dev-requirements/type-checking.txt

This file was deleted.

70 changes: 35 additions & 35 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gateway-based message and application command execution. To run Tanjun
you'll want to link it to a Hikari bot.

```py
--8<-- "./docs_src/usage.py:26:31"
--8<-- "./docs_src/usage.py:25:30"
```

Here a Tanjun client is linked to a gateway bot instance to enable both
Expand All @@ -26,7 +26,7 @@ commands and context menus on startup, and `mention_prefix=True` allows the
bot's message commands to be triggered by starting a command call with `@bot`.

```py
--8<-- "./docs_src/usage.py:35:37"
--8<-- "./docs_src/usage.py:34:36"
```

And here a Tanjun client is linked to a REST server bot instance to enable
Expand All @@ -44,7 +44,7 @@ provide a cross-compatible alternative for these (which also supports dependency
injection).

```py
--8<-- "./docs_src/usage.py:41:50"
--8<-- "./docs_src/usage.py:40:49"
```

## Managing bot functionality
Expand All @@ -54,7 +54,7 @@ group bot functionality, storing functionality such as event listeners,
commands, scheduled callbacks, and client callbacks.

```py
--8<-- "./docs_src/usage.py:54:61"
--8<-- "./docs_src/usage.py:53:60"
```

The `with_` methods on [Component][tanjun.components.Component] allow
Expand All @@ -63,7 +63,7 @@ through a decorator call; the relevant `add_` functions allow adding
functionality through chained calls.

```py
--8<-- "./docs_src/usage.py:65:68"
--8<-- "./docs_src/usage.py:64:67"
```

Alternatively, functionality which is represented by a dedicated object can be
Expand All @@ -83,20 +83,20 @@ add a component to a client, you can also declare "loaders" and "unloaders" for
a module to more ergonomically load this functionality into a client.

```py
--8<-- "./docs_src/usage.py:72:80"
--8<-- "./docs_src/usage.py:71:79"
```

You can either declare one or more custom loaders and unloaders as shown above

```py
--8<-- "./docs_src/usage.py:84:86"
--8<-- "./docs_src/usage.py:83:85"
```

or use [make_loader][tanjun.components.Component.make_loader] to generate a
loader and unloader for the component.

```py
--8<-- "./docs_src/usage.py:90:94"
--8<-- "./docs_src/usage.py:89:93"
```

Modules with loaders can then be loaded into a client by calling
Expand All @@ -120,7 +120,7 @@ All command callbacks must be asynchronous and can use dependency injection.
### Slash commands

```py
--8<-- "./docs_src/usage.py:98:100"
--8<-- "./docs_src/usage.py:97:99"
```

Slash commands represent the commands you see when you start typing with "/" in
Expand Down Expand Up @@ -150,7 +150,7 @@ converters found in [tanjun.conversion][]) similarly to message command
arguments.

```py
--8<-- "./docs_src/usage.py:104:112"
--8<-- "./docs_src/usage.py:103:111"
```

Slash commands can be stored in groups where the above example will be shown in
Expand All @@ -162,7 +162,7 @@ see [slash_command_group][tanjun.commands.slash.slash_command_group].
### Message commands

```py
--8<-- "./docs_src/usage.py:116:125"
--8<-- "./docs_src/usage.py:115:124"
```

Message commands are triggered based on chat messages where the client's
Expand All @@ -178,7 +178,7 @@ either [Client.from_gateway_bot][tanjun.clients.Client.from_gateway_bot] or
Mention prefixes work even if the `MESSAGE_CONTENT` intent is not declared.

```py
--8<-- "./docs_src/usage.py:129:141"
--8<-- "./docs_src/usage.py:128:140"
```

Message command groups are a collection of message commands under a shared name
Expand Down Expand Up @@ -213,7 +213,7 @@ more configuration see [tanjun.parsing][] and for the standard converters see
### Context menus

```py
--8<-- "./docs_src/usage.py:145:151"
--8<-- "./docs_src/usage.py:144:150"
```

Context menus represent the application commands shown when you click on a user
Expand All @@ -227,7 +227,7 @@ Previously you've seen how to manually declare command options per command
type, now it's time to go higher.

```py
--8<-- "./docs_src/usage.py:164:178"
--8<-- "./docs_src/usage.py:163:177"
```

[tanjun.annotations][] provides a simple way to declare the arguments for both
Expand All @@ -253,7 +253,7 @@ When using `follow_wrapped` the relevant decorator will be applied to all the
compatible `as_{}_command` decorator calls below it in the chain.

```py
--8<-- "./docs_src/usage.py:185:189"
--8<-- "./docs_src/usage.py:184:188"
```

While the previous command examples have typed `ctx` as a context type that's
Expand All @@ -265,7 +265,7 @@ types.
## Responding to commands

```py
--8<-- "./docs_src/usage.py:193:206"
--8<-- "./docs_src/usage.py:192:205"
```

[Context.respond][tanjun.abc.Context.respond] is used to respond to a command
Expand All @@ -276,7 +276,7 @@ when `ensure_result=True` is passed.
### Ephemeral responses

```py
--8<-- "./docs_src/usage.py:210:221"
--8<-- "./docs_src/usage.py:209:220"
```

Ephemeral responses are a slash command and context menu exclusive feature which
Expand Down Expand Up @@ -325,7 +325,7 @@ dynamically return choice suggestions to a user as they type a string option.
Autocomplete callbacks must be asynchronous and support dependency injection.

```py
--8<-- "./docs_src/usage.py:225:238"
--8<-- "./docs_src/usage.py:224:237"
```

To set the results for an autocomplete interaction call
Expand All @@ -344,13 +344,13 @@ callbacks, checks, hook callbacks, event listeners, schedule callbacks) through
[Alluka][alluka].

```py
--8<-- "./docs_src/usage.py:248:250"
--8<-- "./docs_src/usage.py:247:249"
```

Here we set the dependencies for the types `Foo` and `Bar`.

```py
--8<-- "./docs_src/usage.py:254:257"
--8<-- "./docs_src/usage.py:253:256"
```

And here we declare a command callback as taking the client set values for
Expand Down Expand Up @@ -412,7 +412,7 @@ Checks are functions that run before command execution to decide whether a
command or group of commands matches a context and should be called with it.

```py
--8<-- "./docs_src/usage.py:261:266"
--8<-- "./docs_src/usage.py:260:265"
```

There's a collection of standard checks in [tanjun.checks][] which work
Expand All @@ -421,7 +421,7 @@ will care about for the standard checks is the `error_message` argument
which lets you adjust the response messages these send when they fail.

```py
--8<-- "./docs_src/usage.py:279:296"
--8<-- "./docs_src/usage.py:278:296"
```

Checks (both custom and standard) can be added to clients, components, and
Expand All @@ -432,7 +432,7 @@ chain. Checks on a client, component, or command group will be used for every
child command.

```py
--8<-- "./docs_src/usage.py:300:304"
--8<-- "./docs_src/usage.py:300:305"
```

Custom checks can be made by making a function with either the signature
Expand All @@ -454,28 +454,28 @@ There are several different kinds of hooks which all support dependency
injection and may be synchronous or asynchronous:

```py
--8<-- "./docs_src/usage.py:308:311"
--8<-- "./docs_src/usage.py:309:312"
```

Pre-execution hooks are called before the execution of a command but after
command matching has finished and all the relevant checks have passed.

```py
--8<-- "./docs_src/usage.py:315:316"
--8<-- "./docs_src/usage.py:316:317"
```

Post-execution hooks are called after a command has finished executing,
regardless of whether it passed or failed.

```py
--8<-- "./docs_src/usage.py:320:321"
--8<-- "./docs_src/usage.py:321:322"
```

Success hooks are called after a command has finished executing successfully
(without raising any errors).

```py
--8<-- "./docs_src/usage.py:325:326"
--8<-- "./docs_src/usage.py:326:327"
```

Error hooks are called when command's execution is ended early by an error raise
Expand All @@ -490,7 +490,7 @@ error and [None][] acts as no vote. In the case of a tie the error will be
re-raised.

```py
--8<-- "./docs_src/usage.py:330:331"
--8<-- "./docs_src/usage.py:331:332"
```

Parser error hooks are called when the argument parsing of a message command
Expand All @@ -502,7 +502,7 @@ Concurrency limiters allow you to limit how many calls can be made to a group
of commands concurrently.

```py
--8<-- "./docs_src/usage.py:335:341"
--8<-- "./docs_src/usage.py:336:342"
```

Here [InMemoryConcurrencyLimiter][tanjun.dependencies.InMemoryConcurrencyLimiter]
Expand All @@ -517,7 +517,7 @@ being used to set this limiter for a client (note that clients can only have 1
linked limiter).

```py
--8<-- "./docs_src/usage.py:345:348"
--8<-- "./docs_src/usage.py:346:349"
```

And here we use [with_concurrency_limit][tanjun.dependencies.with_concurrency_limit]
Expand All @@ -531,7 +531,7 @@ more information on the resources concurrency can be limited by see
Cooldowns limit how often a group of commands can be called.

```py
--8<-- "./docs_src/usage.py:352:358"
--8<-- "./docs_src/usage.py:353:359"
```

Here [InMemoryCooldownManager][tanjun.dependencies.InMemoryCooldownManager]
Expand All @@ -546,7 +546,7 @@ being used to set this cooldown manager for a client (note that clients can
only have 1 linked cooldown manager).

```py
--8<-- "./docs_src/usage.py:362:365"
--8<-- "./docs_src/usage.py:363:366"
```

And here we use [with_cooldown][tanjun.dependencies.with_cooldown]
Expand All @@ -566,7 +566,7 @@ of a field. Localisation on Discord is limited to the locales Discord supports
### Localising command declarations

```py
--8<-- "./docs_src/usage.py:369:370"
--8<-- "./docs_src/usage.py:370:371"
```

For fields which support localisation you've previously seen a single string
Expand All @@ -582,7 +582,7 @@ setting/overriding the locale-specific variants used for localised fields such
as error message responses and application fields globally.

```py
--8<-- "./docs_src/usage.py:374:386"
--8<-- "./docs_src/usage.py:375:387"
```

Specific fields may be overridden by their ID as shown above. There is no
Expand All @@ -608,7 +608,7 @@ It's highly recommended that 3rd party libraries match this format if possible.
### Localising command responses

```py
--8<-- "./docs_src/usage.py:390:409"
--8<-- "./docs_src/usage.py:391:410"
```

[tanjun.abc.AppCommandContext.interaction][] (base class for both
Expand Down
Loading
Loading