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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ on:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']

steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'
python-version: '3.14'

- name: Install dependencies
run: |
Expand All @@ -69,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'
python-version: '3.14'

- name: Install dependencies
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__pycache__
dist
databunkerpro.egg-info

# Tokens written by the stress-test scripts
user_tokens.txt
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ pip install -e ".[dev]"
pytest
```

### Local stress testing

The stress-test scripts live in `stress-test/`. Run them from that directory, and only against a local instance:

- `bulk_user_creator.py` creates 1,000,000 users (250 batches of 4,000, each with 119 profile fields) and appends 10 sample tokens per batch to `user_tokens.txt`.
- `bulk_user_fetcher.py` fetches every token in `user_tokens.txt` concurrently, in batches of 100.
- `random_user_fetcher.py` repeatedly fetches random users from `user_tokens.txt`.

They read `DATABUNKER_API_URL` (default `http://localhost`), `DATABUNKER_API_TOKEN` and `DATABUNKER_TENANT_NAME`. Never point them at a shared or production server.

## Security

This library is scanned on every push and pull request, with a weekly scheduled sweep to catch drift:
Expand Down
2 changes: 1 addition & 1 deletion databunkerpro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

from .api import DatabunkerproAPI

__version__ = "0.1.7"
__version__ = "0.1.8"
__all__ = ["DatabunkerproAPI"]
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
requires = ["setuptools>=84.1.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 88
target-version = ['py37', 'py38', 'py39', 'py310']
target-version = ['py310', 'py311', 'py312', 'py313', 'py314', 'py315']
include = '\.pyi?$'

[tool.isort]
Expand All @@ -16,7 +16,7 @@ use_parentheses = true
line_length = 88

[tool.mypy]
python_version = "3.9"
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
databunkerpro
requests>=2.32.4 # not directly required, pinned by Snyk to avoid a vulnerability
urllib3>=2.5.0 # not directly required, pinned by Snyk to avoid a vulnerability
requests>=2.34.2 # not directly required, pinned by Snyk to avoid a vulnerability
urllib3>=2.8.0 # not directly required, pinned by Snyk to avoid a vulnerability
27 changes: 15 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="databunkerpro",
version="0.1.7",
version="0.1.8",
author="Databunker team",
author_email="hello@databunker.org",
description="Python client library for DatabunkerPro API",
Expand All @@ -19,23 +19,26 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
],
python_requires=">=3.7",
python_requires=">=3.10",
install_requires=[
"requests>=2.32.4",
"requests>=2.34.2",
"urllib3>=2.8.0",
],
extras_require={
"dev": [
"pytest>=6.0",
"pytest-cov>=2.0",
"black>=21.0",
"isort>=5.0",
"mypy>=0.910",
"types-requests",
"pytest>=9.2.0",
"pytest-cov>=7.1.0",
"black>=26.10.1",
"isort>=9.0.2",
"mypy>=2.4.1",
"types-requests>=2.33.0.20261030",
],
},
)
1 change: 0 additions & 1 deletion bulk_user_creator.py → stress-test/bulk_user_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
api_url = os.getenv("DATABUNKER_API_URL", "http://localhost")
api_token = os.getenv("DATABUNKER_API_TOKEN", "dcc33285-4bfd-6e3b-eeb8-05e879afa943")
tenant_name = os.getenv("DATABUNKER_TENANT_NAME", "")
print(api_token)


def generate_random_user_data():
Expand Down
File renamed without changes.
File renamed without changes.
Loading