Skip to content
Snippets Groups Projects
Commit b9b3a339 authored by Colin Watson's avatar Colin Watson
Browse files

New upstream version 3.5.1

parent b4ae2ef3
No related branches found
No related tags found
No related merge requests found
......@@ -15,11 +15,6 @@ jobs:
with:
python-version: "3.11.0"
- run: pip install pre-commit
- uses: actions/cache@v3
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: key-0
- run: pre-commit run --all-files
env:
SKIP: rst
......@@ -29,45 +24,29 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8.18", "3.9.18", "3.10.13", "3.11.7", "3.12.1"]
django-version: [ "3.2", "4.2", "5.0"]
python-version: [ "3.9.18", "3.10.13", "3.11.7", "3.12.1" ]
django-version: [ "4.2", "5.0", "5.1" ]
exclude:
# Django v3 does not support Python >3.10
- django-version: 3.2
python-version: 3.11.7
- django-version: 3.2
python-version: 3.12.1
# Django v5 drops Python <3.10 support
- django-version: 5.0
python-version: 3.8.18
- django-version: 5.0
python-version: 3.9.18
- django-version: 5.1
python-version: 3.9.18
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/cache@v3
id: poetry-cache
with:
path: ~/.local
key: key-4
- uses: snok/install-poetry@v1
with:
virtualenvs-create: false
version: 1.2.2
- uses: actions/cache@v3
id: cache-venv
with:
path: .venv
key: ${{ hashFiles('**/poetry.lock') }}-5
- run: |
pip install virtualenv
virtualenv .venv
source .venv/bin/activate
pip install pip setuptools wheel -U
poetry install --no-interaction --no-root
if: steps.cache-venv.outputs.cache-hit != 'true'
- run: |
source .venv/bin/activate
pip install "Django==${{ matrix.django-version }}"
......
......@@ -51,23 +51,6 @@
Django GUID attaches a unique correlation ID/request ID to all your log outputs for every request.
In other words, all logs connected to a request now has a unique ID attached to it, making debugging simple.
Which version of Django GUID you should use depends on your Django version and whether you run ``ASGI`` or ``WSGI`` servers.
To determine which Django-GUID version you should use, please see the table below.
+---------------------+--------------------------+
| Django version | Django-GUID version |
+=====================+==========================+
| 3.1.1 or above | 3.x.x - ASGI and WSGI |
+---------------------+--------------------------+
| 3.0.0 - 3.1.0 | 2.x.x - Only WSGI |
+---------------------+--------------------------+
| 2.2.x | 2.x.x - Only WSGI |
+---------------------+--------------------------+
Django GUID >= 3.0.0 uses ``ContextVar`` to store and access the GUID. Previous versions stored the GUID to an object,
making it accessible by using the ID of the current thread. (Version 2 of Django GUID is supported until Django2.2 LTS is over.)
--------------
......
......@@ -2,7 +2,7 @@ import django
from django_guid.api import clear_guid, get_guid, set_guid # noqa F401
__version__ = '3.5.0'
__version__ = '3.5.1'
if django.VERSION < (3, 2):
default_app_config = 'django_guid.apps.DjangoGuidConfig'
......
......@@ -34,6 +34,11 @@ class SentryIntegration(Integration):
"""
import sentry_sdk
with sentry_sdk.configure_scope() as scope:
logger.debug('Setting Sentry transaction_id to %s', guid)
scope.set_tag('transaction_id', guid)
if sentry_sdk.VERSION >= '2.0.0':
with sentry_sdk.isolation_scope() as scope:
scope.set_tag('transaction_id', guid)
else:
with sentry_sdk.configure_scope() as scope:
scope.set_tag('transaction_id', guid)
logger.debug(f'Setting Sentry transaction_id to {guid}')
from logging import Filter
from typing import TYPE_CHECKING
from django_guid.middleware import guid
from django_guid.context import guid
if TYPE_CHECKING:
from logging import LogRecord
......
......@@ -4,7 +4,7 @@ from typing import Any, Optional
from django.core.signals import request_finished
from django.dispatch import receiver
from django_guid.middleware import guid
from django_guid.context import guid
logger = logging.getLogger('django_guid')
......
This diff is collapsed.
[tool.poetry]
name = "django-guid"
version = "3.5.0" # Remember to also change __init__.py version
version = "3.5.1" # Remember to also change __init__.py version
description = "Middleware that enables single request-response cycle tracing by injecting a unique ID into project logs"
authors = ["Jonas Krüger Svensson <jonas-ks@hotmail.com>"]
maintainers = ["Sondre Lillebø Gundersen <sondrelg@live.no>"]
......@@ -17,11 +17,9 @@ classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Framework :: Django :: 5.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
......@@ -48,7 +46,7 @@ packages = [{ include = 'django_guid' }]
[tool.poetry.dependencies]
python = "^3.8"
django = [
{ version = "^3.2 | ^4.0", python = ">=3.8,<3.10" },
{ version = "^4.0", python = ">=3.8,<3.10" },
{ version = "^4.0 | ^5.0", python = ">=3.10" }
]
......@@ -58,15 +56,15 @@ coverage = {extras = ["toml"], version = "^6.5.0"}
pre-commit = "^2.9"
sphinx = "^2.4.4"
sphinx_rtd_theme = "^0.4.3"
pytest = "^6.2.5"
pytest-django = "^4.1.0"
pytest = "^8.3.2"
pytest-django = "^4.9.0"
pytest-mock = "^3"
pytest-subtests = "^0.3"
djangorestframework = "^3.11.0"
sentry-sdk = "^0.14.3"
gunicorn = "^20.0.4"
uvicorn = "^0.12.1"
pytest-asyncio = "^0.20.2"
pytest-subtests = "^0.13"
djangorestframework = "^3.15.0"
sentry-sdk = ">=0.14.3,<2.9.0"
gunicorn = "^23.0.0"
uvicorn = "^0.30.6"
pytest-asyncio = "^0.24.0"
celery = "^5.0.2"
redis = "^3.5.3"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment