Skip to content

Commit aa56d17

Browse files
authored
Custom user agent config (#76)
1 parent 4f4d1b6 commit aa56d17

File tree

7 files changed

+612
-600
lines changed

7 files changed

+612
-600
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ repos:
4545
- id: no-commit-to-branch
4646
args: [--branch, dev, --branch, int, --branch, main]
4747
- repo: https://github.com/astral-sh/ruff-pre-commit
48-
rev: v0.14.1
48+
rev: v0.14.3
4949
hooks:
5050
- id: ruff
5151
args: [--fix, --exit-non-zero-on-fix]

.pyproject_generation/pyproject_custom.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ghga_datasteward_kit"
3-
version = "5.0.2"
3+
version = "5.1.0"
44
description = "GHGA Data Steward Kit - A utils package for GHGA data stewards."
55
dependencies = [
66
"crypt4gh >=1.6, <2",

lock/requirements-dev.txt

Lines changed: 323 additions & 321 deletions
Large diffs are not rendered by default.

lock/requirements.txt

Lines changed: 279 additions & 275 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
"Intended Audience :: Developers",
2222
]
2323
name = "ghga_datasteward_kit"
24-
version = "5.0.2"
24+
version = "5.1.0"
2525
description = "GHGA Data Steward Kit - A utils package for GHGA data stewards."
2626
dependencies = [
2727
"crypt4gh >=1.6, <2",

src/ghga_datasteward_kit/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515

1616
"""A utils package for GHGA data stewards."""
1717

18-
__version__ = "1.1.0"
18+
from importlib.metadata import version
19+
20+
__version__ = version(__package__)

src/ghga_datasteward_kit/s3_upload/http_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
wait_exponential_jitter,
2727
)
2828

29+
from ghga_datasteward_kit import __version__
2930
from ghga_datasteward_kit.s3_upload.config import LegacyConfig
3031

32+
USER_AGENT = f"GHGADatastewardKit/{__version__}"
33+
3134

3235
class RequestConfigurator:
3336
"""Helper for user configurable httpx request parameters."""
@@ -48,6 +51,7 @@ def configure(cls, config: LegacyConfig):
4851
async def httpx_client():
4952
"""Yields a context manager httpx client and closes it afterward"""
5053
async with httpx.AsyncClient(
54+
headers=httpx.Headers({"User-Agent": USER_AGENT}),
5155
timeout=RequestConfigurator.timeout,
5256
limits=httpx.Limits(
5357
max_connections=RequestConfigurator.max_connections,

0 commit comments

Comments
 (0)