Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e77d8a5
fix(heading): keep table_info in set_primary_key so a later rename qu…
mayuriphad Oct 18, 2026
207028c
fix: include the store location in ObjectRef.full_path
TheeCoderAhmed Oct 29, 2026
247125c
fix: use two-digit hour in dependabot schedule time
dimitri-yatsenko Nov 4, 2026
4cc2dda
ci: add Dependabot coverage for Python dependencies
dimitri-yatsenko Nov 5, 2026
a827d2f
fix: declare minimum versions for all core dependencies
dimitri-yatsenko Nov 5, 2026
550bd8f
ci: Dependabot leaves the deepdiff<9 cap on Python 3.15 alone
dimitri-yatsenko Nov 6, 2026
adca1cf
ci: pin actions to commit SHAs and run workflows with read-only tokens
dimitri-yatsenko Nov 6, 2026
a98fd31
fix: raise pandas and pymysql minimums, add a deepdiff minimum
dimitri-yatsenko Nov 6, 2026
c9e65d9
fix: use two-digit hour in dependabot schedule time
dimitri-yatsenko Nov 4, 2026
b2b4b5a
ci: run pre-commit directly so every lint action is pinned by SHA
dimitri-yatsenko Nov 6, 2026
5b256ae
ci: declare workflow permissions after the name, clear of the triggers
dimitri-yatsenko Nov 6, 2026
cc4ca9e
ci: test the declared minimum versions; raise deepdiff and pymysql mi…
dimitri-yatsenko Nov 6, 2026
a69650b
fix: keep deepdiff>=6.6.0; its advisories do not affect DeepHash
dimitri-yatsenko Nov 6, 2026
45bfc7c
fix: a restricted right operand of a left join no longer drops unmatc…
dimitri-yatsenko Nov 6, 2026
2a4c576
fix: dj.Top is honored when a limited expression is used in another q…
dimitri-yatsenko Nov 6, 2026
ab4a030
fix(config): skip config files other users could place in shared dire…
dimitri-yatsenko Nov 9, 2026
d2ae31c
Parse foreign key references instead of evaluating them; cap blob dec…
dimitri-yatsenko Nov 9, 2026
b99f291
Keep attachment and store paths inside their roots
dimitri-yatsenko Nov 9, 2026
64eec34
Render values in mapping restrictions as quoted literals
dimitri-yatsenko Nov 9, 2026
0758f67
fix(connection): require TLS when use_tls is set; honor use_tls certi…
dimitri-yatsenko Nov 9, 2026
ea98038
Accept PostgreSQL JSON return types; reject non-finite numbers
dimitri-yatsenko Nov 9, 2026
ef113af
Accept in-store absolute file paths; confine ObjectRef paths and names
dimitri-yatsenko Nov 9, 2026
631b8c3
fix(config): check the opened file and allow group directories under …
dimitri-yatsenko Nov 9, 2026
7a812f8
fix(connection): apply use_tls on every path; one connection by defau…
dimitri-yatsenko Nov 9, 2026
ff4d25b
Keep describe() output total; accept parenthesized and instantiated r…
dimitri-yatsenko Nov 9, 2026
f5ec087
test: check full_path matches the backend URL for trailing-slash loca…
TheeCoderAhmed Nov 10, 2026
1cf9993
Merge pull request #1651 from datajoint/fix/dependabot-time
dimitri-yatsenko Nov 10, 2026
310ff48
Merge pull request #1652 from datajoint/ci/dependabot-pip
dimitri-yatsenko Nov 10, 2026
32ed562
Merge pull request #1653 from datajoint/fix/dependency-lower-bounds
dimitri-yatsenko Nov 10, 2026
87a0beb
Merge pull request #1654 from datajoint/ci/pin-actions-least-privilege
dimitri-yatsenko Nov 10, 2026
4bc2391
Merge pull request #1655 from datajoint/fix/aggr-restricted-group
dimitri-yatsenko Nov 10, 2026
fa62909
Merge pull request #1657 from datajoint/fix/top-in-joins
dimitri-yatsenko Nov 10, 2026
dd147d6
Merge pull request #1643 from mayuriphad/fix/u-proj-rename-quoting
dimitri-yatsenko Nov 10, 2026
7fd96de
Merge pull request #1648 from TheeCoderAhmed/fix/objectref-full-path-…
dimitri-yatsenko Nov 10, 2026
9029716
fix(config): skip the directory warning for sticky shared secrets dir…
dimitri-yatsenko Nov 12, 2026
1c3a6df
Use database.use_tls in dj.Instance and dj.Connection when use_tls is…
dimitri-yatsenko Nov 12, 2026
4845bbd
Keep restriction literals closed under other string-escaping settings
dimitri-yatsenko Nov 12, 2026
896d1e7
Check every key of a folder object before ObjectRef.download writes it
dimitri-yatsenko Nov 12, 2026
8247e9a
fix(proj): raise for a rename or replicate of a missing attribute
mayuriphad Nov 14, 2026
99fdda2
Check where a file-store path resolves when the location adds no prefix
dimitri-yatsenko Nov 17, 2026
f7f19e0
Merge commit from fork
dimitri-yatsenko Nov 18, 2026
6587a9a
Merge commit from fork
dimitri-yatsenko Nov 18, 2026
62be8ca
Merge commit from fork
dimitri-yatsenko Nov 18, 2026
f7a913d
Merge commit from fork
dimitri-yatsenko Nov 18, 2026
f629938
Merge commit from fork
dimitri-yatsenko Nov 18, 2026
152b2bb
Normalize both sides of the file-store location check
dimitri-yatsenko Nov 18, 2026
2fd0557
fix(lint): ignore codespell regex fragment and PyMySQL internals in mypy
dimitri-yatsenko Nov 18, 2026
eefe74b
Merge pull request #1681 from mayuriphad/fix/1677-proj-missing-source
dimitri-yatsenko Nov 19, 2026
eb4b3f5
Merge pull request #1686 from datajoint/fix/file-store-root
dimitri-yatsenko Nov 20, 2026
207068d
Merge pull request #1696 from datajoint/fix/lint-codespell-mypy
dimitri-yatsenko Nov 20, 2026
b59e034
Merge master into next
dimitri-yatsenko Nov 20, 2026
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
26 changes: 24 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,30 @@ updates:
schedule:
interval: "monthly"
day: "wednesday"
time: "9:00"
time: "09:00"
timezone: "America/Chicago"
groups:
all-actions:
patterns: [ "*" ]
patterns: [ "*" ]
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
time: "09:00"
timezone: "America/Chicago"
# datajoint is a library: its dependencies declare minimum versions only.
# Leave a requirement alone when it already admits the new release, so
# users are not pushed onto the newest version of each dependency.
versioning-strategy: "increase-if-necessary"
# deepdiff<9 on Python 3.15 is deliberate (see pyproject.toml); do not
# propose raising it to admit a new major version.
ignore:
- dependency-name: "deepdiff"
update-types: [ "version-update:semver-major" ]
# Version updates stay one PR per package: each one raises an upper bound
# and gets its own test run and review. Security updates are grouped.
groups:
python-security:
applies-to: security-updates
patterns: [ "*" ]
81 changes: 81 additions & 0 deletions .github/scripts/minimum_requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Print pins for the minimum version of each runtime dependency.

Reads [project].dependencies from pyproject.toml and prints one `name==minimum`
line per dependency that applies to the given Python version. CI installs the
package with these as constraints, so the test suite runs against the oldest
versions that pyproject.toml admits. Optional extras are not pinned.

Every applicable dependency must declare a minimum (>=, ==, or ~=). A
dependency without one is an error: GitHub's dependency graph omits it, and
its oldest release is untested.

Usage: python minimum_requirements.py [pyproject.toml] [--python 3.10]
"""

import argparse
import re
import sys

from packaging.requirements import Requirement
from packaging.specifiers import SpecifierSet
from packaging.utils import canonicalize_name
from packaging.version import Version

try:
import tomllib
except ModuleNotFoundError: # Python 3.10
import tomli as tomllib


def python_version(value: str) -> str:
if not re.fullmatch(r"3\.\d+", value):
raise argparse.ArgumentTypeError(f"expected a version like 3.10, got {value!r}")
return value


def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("pyproject", nargs="?", default="pyproject.toml")
parser.add_argument("--python", type=python_version, default="3.10", help="Python version to evaluate markers for")
args = parser.parse_args()

with open(args.pyproject, "rb") as f:
dependencies = tomllib.load(f)["project"]["dependencies"]

# A dependency may span several lines, e.g. a minimum plus an upper bound
# under a marker. Combine the applicable lines per package.
environment = {"python_version": args.python, "python_full_version": f"{args.python}.0"}
specifiers: dict[str, SpecifierSet] = {}
for line in dependencies:
req = Requirement(line)
if req.marker is not None and not req.marker.evaluate(environment):
continue
name = canonicalize_name(req.name)
specifiers[name] = specifiers.get(name, SpecifierSet()) & req.specifier

pins, errors = {}, []
for name, specifier in sorted(specifiers.items()):
bounds = [s.version for s in specifier if s.operator in (">=", "==", "~=")]
if not bounds:
errors.append(f"{name} declares no minimum version")
continue
if any("*" in bound for bound in bounds):
errors.append(f"{name}: wildcard versions are not supported ({specifier})")
continue
minimum = max(bounds, key=Version)
if minimum not in specifier:
errors.append(f"{name}: minimum {minimum} is excluded by {specifier}")
continue
pins[name] = minimum

if errors:
for error in errors:
print(f"error: {error}", file=sys.stderr)
return 1
for name, version in pins.items():
print(f"{name}=={version}")
return 0


if __name__ == "__main__":
sys.exit(main())
2 changes: 1 addition & 1 deletion .github/workflows/close_inactive_issues_prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
operations-per-run: 500 # API rate limit
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Lint
permissions:
contents: read
on:
push:
branches:
Expand All @@ -14,16 +16,19 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# enforce the same check as pre-commit
# but only run important checks
- uses: pre-commit/action@v3.0.1
with:
extra_args: codespell --all-files
- uses: pre-commit/action@v3.0.1
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
extra_args: ruff --all-files
- uses: pre-commit/action@v3.0.1
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
# enforce the same check as pre-commit
# but only run important checks.
# These steps are what pre-commit/action does, written out so that every
# action is pinned by SHA (pre-commit/action calls actions/cache by tag).
- run: python -m pip install pre-commit==4.7.0
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
extra_args: ruff-format --all-files
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always codespell --all-files
- run: pre-commit run --show-diff-on-failure --color=always ruff --all-files
- run: pre-commit run --show-diff-on-failure --color=always ruff-format --all-files
58 changes: 52 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Test

permissions:
contents: read

on:
push:
branches:
Expand All @@ -11,6 +14,7 @@ on:
- "tests/**"
- "pyproject.toml"
- "pixi.lock"
- ".github/scripts/minimum_requirements.py"
- ".github/workflows/test.yaml"
pull_request:
branches:
Expand All @@ -22,6 +26,7 @@ on:
- "tests/**"
- "pyproject.toml"
- "pixi.lock"
- ".github/scripts/minimum_requirements.py"
- ".github/workflows/test.yaml"

jobs:
Expand All @@ -40,10 +45,12 @@ jobs:
mysql-image: ["datajoint/mysql:8.0", "mysql:8.4"]
name: test (${{ matrix.environment }}, mysql=${{ matrix.mysql-image }})
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.9.3
uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
with:
cache: true
locked: false
Expand All @@ -58,10 +65,12 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.9.3
uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
with:
cache: true
locked: false
Expand All @@ -84,12 +93,13 @@ jobs:
python-version: ["3.10", "3.14", "3.15"]
name: unit-tests-windows (py${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0 # hatch-vcs derives the version from git history/tags
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -104,3 +114,39 @@ jobs:

- name: Run unit tests
run: pytest tests/unit -v

# Minimum versions: run the full suite on the oldest supported Python with
# every runtime dependency ([project].dependencies; extras are not pinned) at
# the minimum pyproject.toml declares, so those minimums stay true.
# minimum_requirements.py also fails the job when a runtime dependency
# declares no minimum. Uses pip, not pixi, because pixi resolves the newest
# versions from the lock file.
test-min-versions:
runs-on: ubuntu-latest
timeout-minutes: 45
name: test (minimum dependency versions, py3.10)
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0 # hatch-vcs derives the version from git history/tags
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"

- name: Install graphviz
run: sudo apt-get update && sudo apt-get install -y graphviz

- name: Pin runtime dependencies at their minimums
run: |
python -m pip install tomli==2.5.0 packaging==26.3
python .github/scripts/minimum_requirements.py --python 3.10 > "$RUNNER_TEMP/minimum.txt"
cat "$RUNNER_TEMP/minimum.txt"

- name: Install package with test extras
run: python -m pip install -e ".[test]" -c "$RUNNER_TEMP/minimum.txt"

- name: Run tests
run: python -m pytest tests/
22 changes: 11 additions & 11 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 22 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,31 @@ build-backend = "hatchling.build"
name = "datajoint"
dynamic = ["version"]
dependencies = [
"numpy",
"pymysql>=0.7.2",
"deepdiff",
"numpy>=1.22.4",
# pymysql 1.0 adds the ssl_disabled connection option; 1.1.1 fixes
# CVE-2024-36039.
"pymysql>=1.1.1",
# deepdiff 6.4 adds DeepHash(ignore_iterable_order=...); 6.6 supports numpy 2.
# CVE-2025-58367 and CVE-2026-33155 (fixed in 8.6.2) affect Delta and
# pickle_load; datajoint uses only DeepHash.
"deepdiff>=6.6.0",
# deepdiff 9 requires cachebox<6, which ships no Python 3.15 wheels and cannot
# be built for 3.15 (PyO3 0.27). Drop once deepdiff accepts cachebox 6.
"deepdiff<9; python_version >= '3.15'",
"pyparsing",
"pandas",
"tqdm",
"networkx",
"pydot",
# pyparsing 3.1.0 drops the quotes from quoted defaults (= ""), which
# declares the attribute without a default.
"pyparsing>=3.1.1",
# pandas 2.2.2 is the first release built against numpy 2; older pandas
# fails on import when numpy 2 is installed.
"pandas>=2.2.2",
# CVE-2024-34062
"tqdm>=4.66.3",
"networkx>=3.0",
# pydot 2.x emits DOT that graphviz rejects for datajoint diagrams.
"pydot>=3.0.0",
"fsspec>=2023.1.0",
"pydantic-settings>=2.0.0",
"packaging",
"packaging>=22.0",
]

requires-python = ">=3.10,<3.16"
Expand Down Expand Up @@ -240,7 +251,8 @@ skip = ".git,*.pdf,*.svg,*.csv,*.ipynb,*.drawio"
# Rever -- nobody knows
# numer -- numerator variable
# astroid -- Python library name (not "asteroid")
ignore-words-list = "rever,numer,astroid"
# acter -- regex fragment char(?:acter)?
ignore-words-list = "rever,numer,astroid,acter"

[tool.pytest.ini_options]
markers = [
Expand Down
16 changes: 12 additions & 4 deletions src/datajoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def conn(
reset : bool, optional
If True, reset existing connection. Default False.
use_tls : bool or dict, optional
TLS encryption option.
TLS encryption option: True (required), False (no TLS), None (from
config; TLS if the server supports it by default), or dict (TLS
required; ``ca``, ``cert``, ``key``; with ``ca``, the server
certificate is verified). If the singleton connection exists, it is
reconnected with these unless it already satisfies them.

Returns
-------
Expand All @@ -152,10 +156,12 @@ def conn(
_check_thread_safe()

# If reset requested, always recreate
# If credentials provided and no singleton exists, create one
# If credentials provided and singleton exists, return existing singleton
# If credentials or use_tls provided and no singleton exists, create one
# If credentials provided and singleton exists, return existing singleton,
# reconnected with use_tls unless it already satisfies use_tls
if reset or (
instance_module._singleton_connection is None and (host is not None or user is not None or password is not None)
instance_module._singleton_connection is None
and (host is not None or user is not None or password is not None or use_tls is not None)
):
# Use provided values or fall back to config
host = host if host is not None else _global_config.database.host
Expand All @@ -177,6 +183,8 @@ def conn(
)

instance_module._singleton_connection = Connection(host, user, password, port, use_tls, config_override=_global_config)
elif instance_module._singleton_connection is not None:
instance_module._singleton_connection._ensure_tls(use_tls)

return _get_singleton_connection()

Expand Down
Loading
Loading