Skip to content

Commit

Permalink
feat: install isort dependency as dev dep
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroimpulcetto committed May 6, 2024
1 parent 740ba1b commit 1aa16d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
You can get your QStash token from the [Upstash Console](https://console.upstash.com/qstash).

#### Publish a JSON message

```python
from upstash_qstash import Client

Expand All @@ -29,6 +30,7 @@ print(res["messageId"])
```

#### [Create a scheduled message](https://upstash.com/docs/qstash/features/schedules)

```python
from upstash_qstash import Client

Expand All @@ -45,6 +47,7 @@ print(res["scheduleId"])
```

#### [Receiving messages](https://upstash.com/docs/qstash/howto/receiving)

```python
from upstash_qstash import Receiver

Expand All @@ -70,10 +73,11 @@ is_valid = receiver.verify(
```

#### Additional configuration

```python
from upstash_qstash import Client

# Create a client with a custom retry configuration. This is
# Create a client with a custom retry configuration. This is
# for sending messages to QStash, not for sending messages to
# your endpoints.
# The default configuration is:
Expand Down Expand Up @@ -109,7 +113,7 @@ client.publish_json(
# https://upstash.com/docs/qstash/features/retry
"retries": 3,
# Schedule message to be sent 4 seconds from now
"delay": 4,
"delay": 4,
# When message is sent, send a request to this URL
# https://upstash.com/docs/qstash/features/callbacks
"callback": "https://my-api.com/callback",
Expand All @@ -129,9 +133,10 @@ client.publish_json(
Additional methods are available for managing topics, schedules, and messages. See the examples folder for more.

### Development

1. Clone the repository
2. Install [Poetry](https://python-poetry.org/docs/#installation)
3. Install dependencies with `poetry install`
4. Create a .env file with `cp .env.example .env` and fill in the `QSTASH_TOKEN`
5. Run tests with `poetry run pytest` and examples with `python3 examples/<example>.py`
6. Format with `poetry run black .`
6. Format with `poetry run black . && poetry run isort .`
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ python-dotenv = "^1.0.0"
pytest-asyncio = "^0.23.3"
mypy = "^1.8.0"
types-requests = "^2.31.0.20240106"
isort = "^5.13.2"

[tool.isort]
profile = "black"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 1aa16d0

Please sign in to comment.