Skip to content
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/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files --hook-stage push
run: pre-commit run --all-files


tests:
Expand Down
29 changes: 17 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
rev: v0.11.11
hooks:
# Run the Ruff formatter.
- id: ruff-format
# Run the Ruff linter.
- id: ruff
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/adamchainz/blacken-docs
Expand All @@ -20,19 +20,19 @@ repos:
files: '(?:README\.md|\.ambient-package-update\/templates\/snippets\/.*\.tpl|docs\/.*\.(?:md|rst))'

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
rev: v3.20.0
hooks:
- id: pyupgrade
args: [ --py310-plus ]

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.24.0
rev: 1.25.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]

- repo: https://github.com/adamchainz/djade-pre-commit
rev: 1.3.2
rev: 1.4.0
hooks:
- id: djade
args: [--target-version, "4.2"]
Expand All @@ -45,10 +45,15 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args:
[
"--pattern",
'^^(?!(?:feature|hotfix|bugfix|refactor|maintenance)/[\w\d\-_#]+).*$',
]
stages: [ pre-commit ]
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

**0.3.4** (2025-05-29)
* Maintenance updates via ambient-package-update

**0.3.3** (2025-04-03)
* Clarified package tagline

Expand Down
77 changes: 77 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contribute

## Setup package for development

- Create a Python virtualenv and activate it
- Install "pip-tools" with `pip install -U pip-tools`
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
- Sync the dependencies with your virtualenv with `pip-sync`

## Add functionality

- Create a new branch for your feature
- Change the dependency in your requirements.txt to a local (editable) one that points to your local file system:
`-e /Users/workspace/django-queuebie` or via pip `pip install -e /Users/workspace/django-queuebie`
- Ensure the code passes the tests
- Create a pull request

## Run tests

- Run tests
````
pytest --ds settings tests
````

- Check coverage
````
coverage run -m pytest --ds settings tests
coverage report -m
````

## Git hooks (via pre-commit)

We use pre-push hooks to ensure that only linted code reaches our remote repository and pipelines aren't triggered in
vain.

To enable the configured pre-push hooks, you need to [install](https://pre-commit.com/) pre-commit and run once:

pre-commit install -t pre-push -t pre-commit --install-hooks

This will permanently install the git hooks for both, frontend and backend, in your local
[`.git/hooks`](./.git/hooks) folder.
The hooks are configured in the [`.pre-commit-config.yaml`](templates/.pre-commit-config.yaml.tpl).

You can check whether hooks work as intended using the [run](https://pre-commit.com/#pre-commit-run) command:

pre-commit run [hook-id] [options]

Example: run single hook

pre-commit run ruff --all-files

Example: run all hooks of pre-push stage

pre-commit run --all-files

## Update documentation

- To build the documentation, run: `sphinx-build docs/ docs/_build/html/`.
- Open `docs/_build/html/index.html` to see the documentation.


### Translation files

If you have added custom text, make sure to wrap it in `_()` where `_` is
gettext_lazy (`from django.utils.translation import gettext_lazy as _`).

How to create translation file:

* Navigate to `django-queuebie`
* `python manage.py makemessages -l de`
* Have a look at the new/changed files within `queuebie/locale`

How to compile translation files:

* Navigate to `django-queuebie`
* `python manage.py compilemessages`
* Have a look at the new/changed files within `queuebie/locale`
80 changes: 0 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,85 +88,6 @@ handle_message(



## Contribute

### Setup package for development

- Create a Python virtualenv and activate it
- Install "pip-tools" with `pip install -U pip-tools`
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
- Sync the dependencies with your virtualenv with `pip-sync`

### Add functionality

- Create a new branch for your feature
- Change the dependency in your requirements.txt to a local (editable) one that points to your local file system:
`-e /Users/workspace/django-queuebie` or via pip `pip install -e /Users/workspace/django-queuebie`
- Ensure the code passes the tests
- Create a pull request

### Run tests

- Run tests
````
pytest --ds settings tests
````

- Check coverage
````
coverage run -m pytest --ds settings tests
coverage report -m
````

### Git hooks (via pre-commit)

We use pre-push hooks to ensure that only linted code reaches our remote repository and pipelines aren't triggered in
vain.

To enable the configured pre-push hooks, you need to [install](https://pre-commit.com/) pre-commit and run once:

pre-commit install -t pre-push -t pre-commit --install-hooks

This will permanently install the git hooks for both, frontend and backend, in your local
[`.git/hooks`](./.git/hooks) folder.
The hooks are configured in the [`.pre-commit-config.yaml`](templates/.pre-commit-config.yaml.tpl).

You can check whether hooks work as intended using the [run](https://pre-commit.com/#pre-commit-run) command:

pre-commit run [hook-id] [options]

Example: run single hook

pre-commit run ruff --all-files

Example: run all hooks of pre-push stage

pre-commit run --all-files --hook-stage push

### Update documentation

- To build the documentation, run: `sphinx-build docs/ docs/_build/html/`.
- Open `docs/_build/html/index.html` to see the documentation.


### Translation files

If you have added custom text, make sure to wrap it in `_()` where `_` is
gettext_lazy (`from django.utils.translation import gettext_lazy as _`).

How to create translation file:

* Navigate to `django-queuebie`
* `python manage.py makemessages -l de`
* Have a look at the new/changed files within `queuebie/locale`

How to compile translation files:

* Navigate to `django-queuebie`
* `python manage.py compilemessages`
* Have a look at the new/changed files within `queuebie/locale`


### Publish to ReadTheDocs.io

- Fetch the latest changes in GitHub mirror and push them
Expand Down Expand Up @@ -203,4 +124,3 @@ configuration and setup files. It works similar to well-known updaters like `pyu

To run an update, refer to the [documentation page](https://pypi.org/project/ambient-package-update/)
of the "ambient-package-update".

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The maintainers of this package take security bugs seriously. We appreciate your
disclose your findings, and will make every effort to acknowledge your contributions.

To report a security issue, please use the GitHub Security
Advisory ["Report a Vulnerability"](https://github.com/ambient-innovation/django-queuebie/security/advisories/new)
Advisory ["Report a Vulnerability"](https://github.com/ambient-innovation/django-queuebie/security/advisories/new)
tab.

The maintainers will send a response indicating the next steps in handling your report. After the initial reply to
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ dev = [
'pytest-django~=4.9',
'pytest-mock~=3.14',
'coverage~=7.6',
'pre-commit~=4.0',
'ruff~=0.6',
'pre-commit~=4.2',
'ruff~=0.11',
'sphinx~=7.1',
'sphinx-rtd-theme~=2.0',
'm2r2==0.3.3.post2',
'mistune<2.0.0',
'flit~=3.9',
'keyring~=25.4',
'flit~=3.12',
'keyring~=25.6',
'ambient-package-update',
]

Expand Down Expand Up @@ -90,7 +90,8 @@ lint.select = [
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
"TRY", # Clean try/except
"ERA", # Commented out code
"INP" # Ban PEP-420 implicit namespace packages
"INP", # Ban PEP-420 implicit namespace packages
"C90", # McCabe code complexity
]
lint.ignore = [
"TD002", # Missing author in TODO
Expand Down Expand Up @@ -124,7 +125,8 @@ lint.fixable = [
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
"TRY", # Clean try/except
"ERA", # Commented out code
"INP" # Ban PEP-420 implicit namespace packages
"INP", # Ban PEP-420 implicit namespace packages
"C90", # McCabe code complexity
]
lint.unfixable = []

Expand Down
2 changes: 1 addition & 1 deletion queuebie/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A simple and synchronous message queue for commands and events for Django"""

__version__ = "0.3.3"
__version__ = "0.3.4"

from queuebie.registry import MessageRegistry

Expand Down
2 changes: 1 addition & 1 deletion queuebie/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def decorator(decoratee):

return decorator

def autodiscover(self) -> None:
def autodiscover(self) -> None: # noqa: C901
"""
Detects message registries which have been registered via the "register_*" decorator.
"""
Expand Down