Skip to content

Commit

Permalink
Merge pull request #11 from ingvaldlorentzen/pyamqp
Browse files Browse the repository at this point in the history
`pyampq` support for `azure-servicebus` => 7.10.0
  • Loading branch information
ingvaldlorentzen authored May 22, 2023
2 parents 43a34b8 + a5ace49 commit 1aa4488
Show file tree
Hide file tree
Showing 11 changed files with 1,112 additions and 849 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ ignore=
D401
# Type annotation for `self`
TYP101
TYP102 # for cls
# for cls
TYP102
# Missing docstring in __init__
D107
# Missing docstring in public package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11
- name: Install poetry
uses: snok/install-poetry@v1.1.2
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: snok/install-poetry@v1.1.2
- uses: snok/install-poetry@v1
- name: Publish to pypi
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: 3.11
- run: python -m pip install pre-commit
- run: pre-commit run --all-files
test:
Expand All @@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
django-version: [ "3.1.1", "3.2", "4.0" ] # Django 3.1.1 and later support only
python-version: [ "3.8", "3.9", "3.10", "3.11"]
django-version: [ "3.2", "4.0", "4.2" ] # Django 3.2 and later support only
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -32,7 +32,7 @@ jobs:
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: 1.1.11
version: latest
- name: Load cached venv
uses: actions/cache@v2
id: cache-venv
Expand Down
51 changes: 29 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
exclude: README.md
exclude: |
(?x)^(
.*README.md|
.*migrations/.*|
.*static/.*|
)$
repos:
- repo: https://github.com/ambv/black
rev: '21.10b0'
rev: 23.3.0
hooks:
- id: black
args: ['--quiet']
args:
- --quiet
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: end-of-file-fixer
Expand All @@ -16,32 +22,33 @@ repos:
- id: check-merge-conflict
- id: detect-private-key
- id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [
'flake8-bugbear==21.9.2', # Looks for likely bugs and design problems
'flake8-comprehensions==3.7.0', # Looks for unnecessary generator functions that can be converted to list comprehensions
'flake8-deprecated==1.3', # Looks for method deprecations
'flake8-use-fstring==1.3', # Enforces use of f-strings over .format and %s
'flake8-print==4.0.0', # Checks for print statements
'flake8-docstrings==1.6.0', # Verifies that all functions/methods have docstrings
'flake8-type-annotations==0.1.0', # Looks for misconfigured type annotations
'flake8-annotations==2.7.0', # Enforces type annotation
]
args: ['--enable-extensions=G']
additional_dependencies:
- flake8-annotations==3.0.0 # Enforces type annotation
- flake8-bugbear==23.1.20 # Looks for likely bugs and design problems
- flake8-comprehensions==3.10.1 # Looks for unnecessary generator functions that can be converted to list comprehensions
- flake8-deprecated==2.0.1 # Looks for method deprecations
- flake8-docstrings==1.7.0 # Verifies that all functions/methods have docstrings
- flake8-print==5.0.0 # Checks for print statements
- flake8-use-fstring==1.4 # Enforces use of f-strings over .format and %s
args:
- --enable-extensions=G
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v3.4.0
hooks:
- id: pyupgrade
args: ['--py36-plus']
args:
- --py38-plus
- repo: https://github.com/pycqa/isort
rev: 5.9.3
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910'
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies: ['types-requests']
additional_dependencies:
- types-requests
4 changes: 2 additions & 2 deletions demoproj/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def example_celery_task(*, message: dict, topic_name: str, subscription_name: st
"""
Celery Example Task
"""
print('Do Something') # noqa: T001
print('Do Something') # noqa: T201


def example_rq_task(*, message: dict, topic_name: str, subscription_name: str, subject: str) -> None:
"""
RQ Example Task
"""
print('Do Something') # noqa: T001
print('Do Something') # noqa: T201
2 changes: 1 addition & 1 deletion metroid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
from metroid.celery import MetroidTask # noqa F401
from metroid.publish import publish_event # noqa F401

__version__ = '1.2.4'
__version__ = '1.3.0'
default_app_config = 'metroid.apps.MetroidConfig'
4 changes: 2 additions & 2 deletions metroid/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Callable, List, Optional, Union
from typing import Callable, List, Optional

from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
Expand Down Expand Up @@ -75,7 +75,7 @@ def worker_type(self) -> str:
"""
return self.settings.get('worker_type', 'celery')

def get_x_metro_key(self, *, topic_name: str) -> Union[str, None]:
def get_x_metro_key(self, *, topic_name: str) -> str:
"""
Fetches the x-metro-key based on topic
"""
Expand Down
2 changes: 1 addition & 1 deletion metroid/republish.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def retry_failed_published_events() -> None:
"""
Trys to publish all previously failed messages again.
It make a wrapper around this function based on your needs. If you implement posting to Metro at the end
It makes a wrapper around this function based on your needs. If you implement posting to Metro at the end
of your API logic you might want to still return a 200 to the API user, even if a post to Metro should fail.
:return: None - Metro gives empty response on valid posts
Expand Down
Loading

0 comments on commit 1aa4488

Please sign in to comment.