datajoint 2.3.1__tar.gz → 2.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. {datajoint-2.3.1 → datajoint-2.3.2}/.github/workflows/post_draft_release_published.yaml +9 -53
  2. {datajoint-2.3.1 → datajoint-2.3.2}/.gitignore +3 -0
  3. {datajoint-2.3.1 → datajoint-2.3.2}/PKG-INFO +1 -1
  4. {datajoint-2.3.1 → datajoint-2.3.2}/RELEASE_MEMO.md +27 -23
  5. {datajoint-2.3.1 → datajoint-2.3.2}/pyproject.toml +9 -2
  6. datajoint-2.3.2/src/datajoint/_version.py +24 -0
  7. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/autopopulate.py +10 -3
  8. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/filepath.py +9 -5
  9. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/hash.py +6 -4
  10. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/npy.py +4 -2
  11. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/object.py +4 -2
  12. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/dependencies.py +44 -40
  13. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/diagram.py +161 -220
  14. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/gc.py +21 -5
  15. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/jobs.py +7 -2
  16. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/logging.py +18 -13
  17. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/settings.py +3 -3
  18. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/table.py +3 -17
  19. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/user_tables.py +1 -9
  20. datajoint-2.3.2/src/datajoint/version.py +16 -0
  21. {datajoint-2.3.1 → datajoint-2.3.2}/tests/conftest.py +1 -0
  22. datajoint-2.3.2/tests/integration/test_dependencies.py +109 -0
  23. datajoint-2.3.2/tests/integration/test_foreign_keys.py +91 -0
  24. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_gc.py +186 -0
  25. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_jobs.py +24 -0
  26. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_object.py +49 -0
  27. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_trace.py +1 -1
  28. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_uuid.py +12 -0
  29. datajoint-2.3.2/tests/unit/test_logging.py +70 -0
  30. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_settings.py +26 -0
  31. datajoint-2.3.1/src/datajoint/version.py +0 -4
  32. datajoint-2.3.1/tests/integration/test_dependencies.py +0 -52
  33. datajoint-2.3.1/tests/integration/test_foreign_keys.py +0 -53
  34. {datajoint-2.3.1 → datajoint-2.3.2}/.coveragerc +0 -0
  35. {datajoint-2.3.1 → datajoint-2.3.2}/.dockerignore +0 -0
  36. {datajoint-2.3.1 → datajoint-2.3.2}/.gitattributes +0 -0
  37. {datajoint-2.3.1 → datajoint-2.3.2}/.github/DISCUSSION_TEMPLATE/rfc.yml +0 -0
  38. {datajoint-2.3.1 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  39. {datajoint-2.3.1 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  40. {datajoint-2.3.1 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/improvement_request.md +0 -0
  41. {datajoint-2.3.1 → datajoint-2.3.2}/.github/dependabot.yml +0 -0
  42. {datajoint-2.3.1 → datajoint-2.3.2}/.github/release_drafter.yaml +0 -0
  43. {datajoint-2.3.1 → datajoint-2.3.2}/.github/workflows/close_inactive_issues_prs.yaml +0 -0
  44. {datajoint-2.3.1 → datajoint-2.3.2}/.github/workflows/draft_release.yaml +0 -0
  45. {datajoint-2.3.1 → datajoint-2.3.2}/.github/workflows/lint.yaml +0 -0
  46. {datajoint-2.3.1 → datajoint-2.3.2}/.github/workflows/test.yaml +0 -0
  47. {datajoint-2.3.1 → datajoint-2.3.2}/.pre-commit-config.yaml +0 -0
  48. {datajoint-2.3.1 → datajoint-2.3.2}/CHANGELOG-archive.md +0 -0
  49. {datajoint-2.3.1 → datajoint-2.3.2}/CONTRIBUTING.md +0 -0
  50. {datajoint-2.3.1 → datajoint-2.3.2}/Dockerfile +0 -0
  51. {datajoint-2.3.1 → datajoint-2.3.2}/LICENSE +0 -0
  52. {datajoint-2.3.1 → datajoint-2.3.2}/README.md +0 -0
  53. {datajoint-2.3.1 → datajoint-2.3.2}/activate.sh +0 -0
  54. {datajoint-2.3.1 → datajoint-2.3.2}/docker-compose.yaml +0 -0
  55. {datajoint-2.3.1 → datajoint-2.3.2}/images/pipeline.png +0 -0
  56. {datajoint-2.3.1 → datajoint-2.3.2}/images/pipeline.svg +0 -0
  57. {datajoint-2.3.1 → datajoint-2.3.2}/pixi.lock +0 -0
  58. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/__init__.py +0 -0
  59. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/adapters/__init__.py +0 -0
  60. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/adapters/base.py +0 -0
  61. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/adapters/mysql.py +0 -0
  62. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/adapters/postgres.py +0 -0
  63. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/blob.py +0 -0
  64. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/__init__.py +0 -0
  65. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/attach.py +0 -0
  66. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/blob.py +0 -0
  67. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/builtin_codecs/schema.py +0 -0
  68. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/cli.py +0 -0
  69. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/codecs.py +0 -0
  70. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/condition.py +0 -0
  71. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/connection.py +0 -0
  72. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/declare.py +0 -0
  73. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/deploy.py +0 -0
  74. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/errors.py +0 -0
  75. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/expression.py +0 -0
  76. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/hash_registry.py +0 -0
  77. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/heading.py +0 -0
  78. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/instance.py +0 -0
  79. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/lineage.py +0 -0
  80. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/migrate.py +0 -0
  81. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/objectref.py +0 -0
  82. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/preview.py +0 -0
  83. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/schemas.py +0 -0
  84. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/spark.py +0 -0
  85. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/staged_insert.py +0 -0
  86. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/storage.py +0 -0
  87. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/storage_adapter.py +0 -0
  88. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/types.py +0 -0
  89. {datajoint-2.3.1 → datajoint-2.3.2}/src/datajoint/utils.py +0 -0
  90. {datajoint-2.3.1 → datajoint-2.3.2}/tests/__init__.py +0 -0
  91. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/__init__.py +0 -0
  92. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Course.csv +0 -0
  93. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/CurrentTerm.csv +0 -0
  94. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Department.csv +0 -0
  95. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Enroll.csv +0 -0
  96. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Grade.csv +0 -0
  97. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Section.csv +0 -0
  98. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Student.csv +0 -0
  99. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/StudentMajor.csv +0 -0
  100. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/data/Term.csv +0 -0
  101. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_aggr_regressions.py +0 -0
  102. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_alter.py +0 -0
  103. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_attach.py +0 -0
  104. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_autopopulate.py +0 -0
  105. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_blob.py +0 -0
  106. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_blob_matlab.py +0 -0
  107. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_cascade_delete.py +0 -0
  108. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_cascade_integrity.py +0 -0
  109. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_cascading_delete.py +0 -0
  110. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_cli.py +0 -0
  111. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_codec_chaining.py +0 -0
  112. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_codecs.py +0 -0
  113. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_connection.py +0 -0
  114. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_declare.py +0 -0
  115. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_erd.py +0 -0
  116. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_fetch.py +0 -0
  117. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_fetch_same.py +0 -0
  118. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_groupby.py +0 -0
  119. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_hash_storage.py +0 -0
  120. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_hidden_job_metadata.py +0 -0
  121. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_insert.py +0 -0
  122. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_json.py +0 -0
  123. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_multi_backend.py +0 -0
  124. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_nan.py +0 -0
  125. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_npy_codec.py +0 -0
  126. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_privileges.py +0 -0
  127. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_reconnection.py +0 -0
  128. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_relation.py +0 -0
  129. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_relation_u.py +0 -0
  130. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_relational_operand.py +0 -0
  131. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_schema.py +0 -0
  132. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_schema_keywords.py +0 -0
  133. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_semantic_matching.py +0 -0
  134. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_skip_duplicates.py +0 -0
  135. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_tls.py +0 -0
  136. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_type_aliases.py +0 -0
  137. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_university.py +0 -0
  138. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_update1.py +0 -0
  139. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_utils.py +0 -0
  140. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_uuid.py +0 -0
  141. {datajoint-2.3.1 → datajoint-2.3.2}/tests/integration/test_virtual_module.py +0 -0
  142. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema.py +0 -0
  143. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_advanced.py +0 -0
  144. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_aggr_regress.py +0 -0
  145. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_alter.py +0 -0
  146. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_codecs.py +0 -0
  147. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_external.py +0 -0
  148. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_object.py +0 -0
  149. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_privileges.py +0 -0
  150. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_simple.py +0 -0
  151. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_type_aliases.py +0 -0
  152. {datajoint-2.3.1 → datajoint-2.3.2}/tests/schema_university.py +0 -0
  153. {datajoint-2.3.1 → datajoint-2.3.2}/tests/test_package.py +0 -0
  154. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/__init__.py +0 -0
  155. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_adapters.py +0 -0
  156. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_codecs.py +0 -0
  157. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_condition.py +0 -0
  158. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_connection_warning.py +0 -0
  159. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_declare_hidden_attribute.py +0 -0
  160. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_deploy.py +0 -0
  161. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_fetch_compat.py +0 -0
  162. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_lazy_imports.py +0 -0
  163. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_pk_rules.py +0 -0
  164. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_spark.py +0 -0
  165. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_storage_adapter.py +0 -0
  166. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_storage_urls.py +0 -0
  167. {datajoint-2.3.1 → datajoint-2.3.2}/tests/unit/test_thread_safe.py +0 -0
@@ -12,9 +12,8 @@ run-name: Post ${{ github.event.release.name }}
12
12
  jobs:
13
13
  pypi-release:
14
14
  permissions:
15
- # write permission is required to update version.py
15
+ # write permission is required to upload build artifacts as release assets
16
16
  contents: write
17
- pull-requests: write
18
17
  # Use the oldest supported version to build, just in case there are issues
19
18
  # for our case, this doesn't matter that much, since the build is for 3.x
20
19
  strategy:
@@ -33,32 +32,10 @@ jobs:
33
32
  uses: actions/checkout@v4
34
33
  with:
35
34
  token: ${{ secrets.GITHUB_TOKEN }}
36
- # new release needs the updated version.py
37
- - name: Update version.py
38
- run: |
39
- VERSION=$(echo "${{ github.event.release.name }}" | grep -oP '\d+\.\d+\.\d+')
40
- sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" src/datajoint/version.py
41
- cat src/datajoint/version.py
42
- # Commit the changes
43
- BRANCH_NAME="update-version-$VERSION"
44
- git switch -c $BRANCH_NAME
45
- git config --global user.name "github-actions"
46
- git config --global user.email "github-actions@github.com"
47
- git add src/datajoint/version.py
48
- git commit -m "Update version.py to $VERSION"
49
- echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
50
- - name: Update README.md badge
51
- run: |
52
- # commits since the last release
53
- NEW_HREF="https://github.com/datajoint/datajoint-python/compare/${{ github.event.release.tag_name }}...master"
54
- NEW_SRC="https://img.shields.io/github/commits-since/datajoint/datajoint-python/${{ github.event.release.tag_name }}?color=red"
55
- # Update href in the <a> tag
56
- sed -i 's|\(<a id="commit-since-release-link"[^>]*href="\)[^"]*\(".*\)|\1'"$NEW_HREF"'\2|' README.md
57
- # Update src in the <img> tag
58
- sed -i 's|\(<img id="commit-since-release-img"[^>]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md
59
- git add README.md
60
- # Only commit if there are changes (handles re-runs gracefully)
61
- git diff --cached --quiet README.md || git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
35
+ # Full history + tags so hatch-vcs can derive the version from the
36
+ # release tag. The checked-out ref is the tag itself, so the build
37
+ # reports exactly X.Y.Z — no version.py bump or follow-up PR needed.
38
+ fetch-depth: 0
62
39
  - name: Set up Python ${{matrix.py_ver}}
63
40
  uses: actions/setup-python@v5
64
41
  with:
@@ -73,34 +50,24 @@ jobs:
73
50
  python -m build .
74
51
  echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV
75
52
  echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV
76
- echo "NEW_VERSION=${{github.event.release.resolved_version}}" >> $GITHUB_ENV
77
53
  - name: Publish package
78
54
  id: publish
79
55
  env:
80
56
  RELEASE_NAME: ${{ github.event.release.name }}
81
57
  run: |
82
- export HOST_UID=$(id -u)
58
+ python -m pip install --upgrade twine
83
59
  if [[ "$RELEASE_NAME" =~ ^Test ]]; then
84
- LATEST_PYPI=$(curl -s https://test.pypi.org/pypi/datajoint/json | jq -r '.info.version')
85
60
  echo "TEST_PYPI=true" >> $GITHUB_ENV
86
61
  export TWINE_REPOSITORY="testpypi"
87
62
  export TWINE_USERNAME=${TWINE_TEST_USERNAME}
88
63
  export TWINE_PASSWORD=${TWINE_TEST_PASSWORD}
89
64
  else
90
- LATEST_PYPI=$(curl -s https://pypi.org/pypi/datajoint/json | jq -r '.info.version')
91
65
  echo "TEST_PYPI=false" >> $GITHUB_ENV
92
66
  export TWINE_REPOSITORY="pypi"
93
67
  fi
94
- # Check if the new version is different from the latest on PyPI, avoid re-uploading error
95
- if [ "$NEW_VERSION" != "$LATEST_PYPI" ]; then
96
- docker compose run --build --quiet-pull \
97
- -e TWINE_USERNAME=${TWINE_USERNAME} \
98
- -e TWINE_PASSWORD=${TWINE_PASSWORD} \
99
- -e TWINE_REPOSITORY=${TWINE_REPOSITORY} \
100
- app sh -c "pip install twine && python -m twine upload dist/*"
101
- else
102
- echo "::warning::Latest version $LATEST_PYPI on $TWINE_REPOSITORY is the new version $NEW_VERSION"
103
- fi
68
+ # Upload the artifacts built in the previous step. --skip-existing
69
+ # keeps re-runs idempotent (no error if the version already exists).
70
+ python -m twine upload --skip-existing dist/*
104
71
  # Upload package as release assets
105
72
  - name: Upload pip wheel asset to release
106
73
  uses: actions/upload-release-asset@v1
@@ -120,17 +87,6 @@ jobs:
120
87
  asset_path: ${{env.DJ_SDIST_PATH}}
121
88
  asset_name: pip-datajoint-${{ github.event.release.tag_name }}.tar.gz
122
89
  asset_content_type: application/gzip
123
- - name: Create Pull Request
124
- env:
125
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126
- run: |
127
- git push origin ${{ env.BRANCH_NAME }}
128
- gh pr create \
129
- --title "[github-actions]Update version.py to ${{ github.event.release.name }}" \
130
- --body "This PR updates \`version.py\` to match the latest release: ${{ github.event.release.name }}" \
131
- --base master \
132
- --head ${{ env.BRANCH_NAME }} \
133
- --reviewer dimitri-yatsenko,drewyangdev,ttngu207
134
90
  - name: Post release notification to Slack
135
91
  if: ${{ env.TEST_PYPI == 'false' }}
136
92
  uses: slackapi/slack-github-action@v2.0.0
@@ -28,6 +28,9 @@ share/python-wheels/
28
28
  *.egg
29
29
  MANIFEST
30
30
 
31
+ # Version file generated at build time by hatch-vcs (see pyproject.toml)
32
+ src/datajoint/_version.py
33
+
31
34
  # PyInstaller
32
35
  # Usually these files are written by a python script from a template
33
36
  # before PyInstaller builds the exe, so as to inject date/other infos into it.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datajoint
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data.
5
5
  Project-URL: Homepage, https://docs.datajoint.com/
6
6
  Project-URL: Documentation, https://docs.datajoint.com/
@@ -4,13 +4,7 @@
4
4
 
5
5
  | Branch | Purpose | Version |
6
6
  |--------|---------|---------|
7
- | `master` | Main development | 2.1.x |
8
- | `maint/2.0` | Maintenance releases | 2.0.x |
9
-
10
- For 2.0.x bugfixes:
11
- 1. Commit to `maint/2.0`
12
- 2. Tag and release as v2.0.x
13
- 3. Cherry-pick to master if applicable
7
+ | `master` | Main development | 2.3.x |
14
8
 
15
9
  ---
16
10
 
@@ -68,10 +62,11 @@ The release drafter uses PR labels to categorize changes:
68
62
 
69
63
  | Label | Category |
70
64
  |-------|----------|
71
- | `breaking` | BREAKING CHANGES |
72
- | `enhancement` | Added |
73
- | `bug` | Fixed |
74
- | `documentation` | (usually excluded) |
65
+ | `breaking` | 💥 Breaking Changes |
66
+ | `feature` | 🚀 Features |
67
+ | `enhancement` | ⚡️ Enhancements |
68
+ | `bug` | 🐛 Bug Fixes |
69
+ | `documentation` | 📝 Documentation |
75
70
 
76
71
  Ensure PRs have appropriate labels before merging.
77
72
 
@@ -87,20 +82,23 @@ Ensure PRs have appropriate labels before merging.
87
82
  - Set release name to `Release X.Y.Z`
88
83
  - Set tag to `vX.Y.Z`
89
84
  - Review and edit release notes
90
- 4. **Publish the release**
85
+ 4. **Publish the release** — this creates the `vX.Y.Z` tag.
91
86
  5. Automation will:
92
- - Update `version.py` to `X.Y.Z`
93
- - Build and publish to PyPI
94
- - Create PR to merge version update back to master
87
+ - Build from the tag and publish to PyPI
88
+ - Attach the wheel/sdist as release assets
95
89
 
96
90
  ### Version Note
97
91
 
98
- The release drafter computes version from the previous tag. You may need to **manually edit** the release name for major version changes.
92
+ The release drafter computes the version from the previous tag. You may need to
93
+ **manually edit** the release name/tag for major version changes.
99
94
 
100
- The regex in `post_draft_release_published.yaml` extracts version from the release name:
101
- ```bash
102
- VERSION=$(echo "${{ github.event.release.name }}" | grep -oP '\d+\.\d+\.\d+')
103
- ```
95
+ The package version is **derived from the git tag** at build time by
96
+ [hatch-vcs](https://github.com/ofek/hatch-vcs) (see `[tool.hatch.version]` in
97
+ `pyproject.toml`) — the tag is the single source of truth. There is **no
98
+ `version.py` value to bump** and **no follow-up version PR**: publishing the
99
+ `vX.Y.Z` tag is what sets the version everywhere (`pip install`, `pip show`, and
100
+ `datajoint.__version__`). Do not hand-edit `src/datajoint/version.py`; it only
101
+ re-exports the build-generated `_version.py`.
104
102
 
105
103
  ---
106
104
 
@@ -155,11 +153,16 @@ If the bot doesn't create a PR, manually update the feedstock:
155
153
  run:
156
154
  - python >={{ python_min }}
157
155
  - numpy
156
+ - pymysql >=0.7.2
157
+ - deepdiff
158
+ - pyparsing
158
159
  - pandas
159
- - pymysql >=1.0
160
- - minio
160
+ - tqdm
161
+ - networkx
162
+ - pydot
163
+ - fsspec >=2023.1.0
164
+ - pydantic-settings >=2.0.0
161
165
  - packaging
162
- # ... etc
163
166
  ```
164
167
 
165
168
  5. **Submit PR** to the feedstock
@@ -215,6 +218,7 @@ After build completes:
215
218
 
216
219
  - @datajointbot
217
220
  - @dimitri-yatsenko
221
+ - @MilagrosMarin
218
222
  - @ttngu207
219
223
 
220
224
  ## Links
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
2
+ requires = ["hatchling", "hatch-vcs"]
3
3
  build-backend = "hatchling.build"
4
4
 
5
5
  [project]
@@ -219,7 +219,14 @@ module = [
219
219
  ignore_errors = true
220
220
 
221
221
  [tool.hatch.version]
222
- path = "src/datajoint/version.py"
222
+ # Version is derived from the git tag at build time (hatch-vcs), so the tag is
223
+ # the single source of truth: `pip install git+...@vX.Y.Z` reports X.Y.Z. The
224
+ # resolved version is written to the generated (git-ignored) src/datajoint/_version.py
225
+ # by the build hook below; src/datajoint/version.py reads it back at runtime.
226
+ source = "vcs"
227
+
228
+ [tool.hatch.build.hooks.vcs]
229
+ version-file = "src/datajoint/_version.py"
223
230
 
224
231
  [tool.hatch.build.targets.wheel]
225
232
  packages = ["src/datajoint"]
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '2.3.2'
22
+ __version_tuple__ = version_tuple = (2, 3, 2)
23
+
24
+ __commit_id__ = commit_id = None
@@ -89,6 +89,11 @@ class AutoPopulate:
89
89
  Query yielding keys to be populated. Default is join of FK parents.
90
90
  jobs : Job
91
91
  Job table (``~~table_name``) for distributed processing.
92
+ upstream : Diagram
93
+ Pre-restricted ancestor view for the current ``make(self, key)`` call
94
+ (property). Available only inside ``make()``; built lazily on first
95
+ access and memoized for the call. See the property docstring for
96
+ details.
92
97
 
93
98
  Notes
94
99
  -----
@@ -736,9 +741,11 @@ class AutoPopulate:
736
741
  return True
737
742
  finally:
738
743
  self.__class__._allow_insert = False
739
- # Clear the per-make() upstream view so subsequent attribute
740
- # access raises a clear error rather than silently using a
741
- # stale trace from the previous make() call.
744
+ # Clear the per-make() upstream state: `_upstream = None` invalidates
745
+ # the memoized Diagram; `_upstream_key = None` restores the "outside
746
+ # make()" state so subsequent `self.upstream` access raises a clear
747
+ # error via the property guard rather than silently returning a stale
748
+ # trace from the previous call.
742
749
  self._upstream = None
743
750
  self._upstream_key = None
744
751
 
@@ -22,8 +22,10 @@ class FilepathCodec(Codec):
22
22
 
23
23
  This codec gives users maximum freedom in organizing their files while
24
24
  reusing DataJoint's store configuration. Files can be placed anywhere
25
- in the store EXCEPT the reserved ``_hash/`` and ``_schema/`` sections
26
- which are managed by DataJoint.
25
+ in the store EXCEPT the reserved sections managed by DataJoint (the
26
+ hash-addressed and schema-addressed sections — from each store's
27
+ ``hash_prefix`` and ``schema_prefix`` settings, defaults ``_hash`` and
28
+ ``_schema``).
27
29
 
28
30
  This is useful when:
29
31
  - Files are managed externally (e.g., by acquisition software)
@@ -54,7 +56,8 @@ class FilepathCodec(Codec):
54
56
  JSON metadata: ``{path, store, size, timestamp}``
55
57
 
56
58
  Reserved Sections:
57
- Paths cannot start with ``_hash/`` or ``_schema/`` - these are managed by DataJoint.
59
+ Paths cannot start with the store's reserved ``hash_prefix`` or
60
+ ``schema_prefix`` sections (defaults ``_hash/`` and ``_schema/``).
58
61
 
59
62
  Warning:
60
63
  The file must exist in the store at the specified path.
@@ -78,7 +81,8 @@ class FilepathCodec(Codec):
78
81
  Parameters
79
82
  ----------
80
83
  value : str
81
- Relative path within the store. Cannot use reserved sections (_hash/, _schema/).
84
+ Relative path within the store. Cannot use the store's reserved
85
+ hash/schema sections.
82
86
  key : dict, optional
83
87
  Primary key values (unused).
84
88
  store_name : str, optional
@@ -92,7 +96,7 @@ class FilepathCodec(Codec):
92
96
  Raises
93
97
  ------
94
98
  ValueError
95
- If path uses reserved sections (_hash/ or _schema/).
99
+ If path uses the store's reserved hash/schema sections.
96
100
  FileNotFoundError
97
101
  If file does not exist in the store.
98
102
  """
@@ -1,5 +1,5 @@
1
1
  """
2
- Hash-addressed storage codec with SHA256 deduplication.
2
+ Hash-addressed storage codec with MD5-based deduplication.
3
3
  """
4
4
 
5
5
  from __future__ import annotations
@@ -12,11 +12,13 @@ from ..errors import DataJointError
12
12
 
13
13
  class HashCodec(Codec):
14
14
  """
15
- Hash-addressed storage with SHA256 deduplication.
15
+ Hash-addressed storage with content-addressed deduplication.
16
16
 
17
17
  The ``<hash@>`` codec stores raw bytes using hash-addressed storage.
18
- Data is identified by its SHA256 hash and stored in a hierarchical directory:
19
- ``_hash/{hash[:2]}/{hash[2:4]}/{hash}``
18
+ Data is identified by a 26-character Base32-encoded MD5 digest of the
19
+ content, and stored at ``{hash_prefix}/{schema}/{hash}`` (``hash_prefix``
20
+ defaults to ``_hash``). Stores with subfolding configured insert
21
+ additional path segments: ``{hash_prefix}/{schema}/{fold1}/{fold2}/{hash}``.
20
22
 
21
23
  The database column stores JSON metadata: ``{hash, store, size}``.
22
24
  Duplicate content is automatically deduplicated across all tables.
@@ -226,7 +226,9 @@ class NpyCodec(SchemaCodec):
226
226
  Schema-addressed storage for numpy arrays as .npy files.
227
227
 
228
228
  The ``<npy@>`` codec stores numpy arrays as standard ``.npy`` files
229
- using schema-addressed paths: ``{schema}/{table}/{pk}/{attribute}.npy``.
229
+ using schema-addressed paths: ``{schema_prefix}/{schema}/{table}/{pk}/{attribute}_{token}.npy``
230
+ (``schema_prefix`` defaults to ``_schema``; ``{token}`` is a random
231
+ per-write suffix).
230
232
  Arrays are fetched lazily via ``NpyRef``, which provides metadata access
231
233
  without I/O and transparent numpy integration via ``__array__``.
232
234
 
@@ -269,7 +271,7 @@ class NpyCodec(SchemaCodec):
269
271
 
270
272
  Storage Details:
271
273
  - File format: NumPy .npy (version 1.0 or 2.0)
272
- - Path: ``{schema}/{table}/{pk}/{attribute}.npy``
274
+ - Path: ``{schema_prefix}/{schema}/{table}/{pk}/{attribute}_{token}.npy``
273
275
  - Database column: JSON with ``{path, store, dtype, shape}``
274
276
 
275
277
  Deletion: Requires garbage collection via ``dj.gc.GarbageCollector``.
@@ -15,7 +15,9 @@ class ObjectCodec(SchemaCodec):
15
15
  Schema-addressed storage for files and folders.
16
16
 
17
17
  The ``<object@>`` codec provides managed file/folder storage using
18
- schema-addressed paths: ``{schema}/{table}/{pk}/{field}/``. This creates
18
+ schema-addressed paths: ``{schema_prefix}/{schema}/{table}/{pk}/{field}_{token}/``
19
+ (``schema_prefix`` defaults to ``_schema``; ``{token}`` is a random
20
+ per-write suffix). This creates
19
21
  a browsable organization in object storage that mirrors the database schema.
20
22
 
21
23
  Unlike hash-addressed storage (``<hash@>``), each row has its own unique path
@@ -51,7 +53,7 @@ class ObjectCodec(SchemaCodec):
51
53
  Storage Structure:
52
54
  Objects are stored at::
53
55
 
54
- {store_root}/{schema}/{table}/{pk}/{field}/
56
+ {store_root}/{schema_prefix}/{schema}/{table}/{pk}/{field}_{token}/
55
57
 
56
58
  Deletion: Requires garbage collection via ``dj.gc.GarbageCollector``.
57
59
 
@@ -8,7 +8,6 @@ proper ordering of operations like delete and drop.
8
8
 
9
9
  from __future__ import annotations
10
10
 
11
- import itertools
12
11
  import re
13
12
  from collections import defaultdict
14
13
 
@@ -41,13 +40,13 @@ def extract_master(part_table: str) -> str | None:
41
40
  return None
42
41
 
43
42
 
44
- def topo_sort(graph: nx.DiGraph) -> list[str]:
43
+ def topo_sort(graph: nx.MultiDiGraph) -> list[str]:
45
44
  """
46
45
  Topological sort keeping part tables with their masters.
47
46
 
48
47
  Parameters
49
48
  ----------
50
- graph : nx.DiGraph
49
+ graph : nx.MultiDiGraph
51
50
  Dependency graph.
52
51
 
53
52
  Returns
@@ -56,21 +55,7 @@ def topo_sort(graph: nx.DiGraph) -> list[str]:
56
55
  Table names in topological order with parts following masters.
57
56
  """
58
57
 
59
- graph = nx.DiGraph(graph) # make a copy
60
-
61
- # collapse alias nodes
62
- alias_nodes = [node for node in graph if node.isdigit()]
63
- for node in alias_nodes:
64
- try:
65
- direct_edge = (
66
- next(x for x in graph.in_edges(node))[0],
67
- next(x for x in graph.out_edges(node))[1],
68
- )
69
- except StopIteration:
70
- pass # a disconnected alias node
71
- else:
72
- graph.add_edge(*direct_edge)
73
- graph.remove_nodes_from(alias_nodes)
58
+ graph = nx.MultiDiGraph(graph) # make a mutable copy
74
59
 
75
60
  # Add parts' dependencies to their masters' dependencies
76
61
  # to ensure correct topological ordering of the masters.
@@ -102,12 +87,16 @@ def topo_sort(graph: nx.DiGraph) -> list[str]:
102
87
  return sorted_nodes
103
88
 
104
89
 
105
- class Dependencies(nx.DiGraph):
90
+ class Dependencies(nx.MultiDiGraph):
106
91
  """
107
92
  Graph of foreign key dependencies between loaded tables.
108
93
 
109
- Extends NetworkX DiGraph to track foreign key relationships and
110
- support operations like cascade delete and topological ordering.
94
+ Extends NetworkX MultiDiGraph to track foreign key relationships and
95
+ support operations like cascade delete and topological ordering. A
96
+ ``MultiDiGraph`` is used so that multiple foreign keys between the same
97
+ pair of tables (including renamed/aliased ones) are represented as
98
+ distinct parallel edges keyed by ``(parent, child, key)`` — no synthetic
99
+ intermediate "alias" nodes are needed.
111
100
 
112
101
  Parameters
113
102
  ----------
@@ -130,7 +119,6 @@ class Dependencies(nx.DiGraph):
130
119
 
131
120
  def __init__(self, connection=None) -> None:
132
121
  self._conn = connection
133
- self._node_alias_count = itertools.count()
134
122
  self._loaded = False
135
123
  self._loaded_schemas = set() # schema names currently represented in the graph
136
124
  super().__init__(self)
@@ -139,7 +127,6 @@ class Dependencies(nx.DiGraph):
139
127
  """Clear the graph and reset loaded state."""
140
128
  self._loaded = False
141
129
  self._loaded_schemas = set()
142
- self._node_alias_count = itertools.count() # reset alias IDs for consistency
143
130
  super().clear()
144
131
 
145
132
  def load(self, force: bool = True, schema_names: set[str] | None = None) -> None:
@@ -208,7 +195,14 @@ class Dependencies(nx.DiGraph):
208
195
  d["referenced_table"] = key["referenced_table"]
209
196
  d["attr_map"][key["column_name"]] = key["referenced_column_name"]
210
197
 
211
- # add edges to the graph
198
+ # Add one edge per foreign key, keyed by the FK's child-side attribute
199
+ # names as a tuple (in declaration order). This key uniquely identifies
200
+ # a parallel edge between a pair of tables — every FK to a given parent
201
+ # references its primary key, so parallel FKs differ only in their
202
+ # referencing columns — and is derived purely from the schema (no
203
+ # DB-internal constraint names). A stable, meaningful key makes graph
204
+ # merges (e.g. ``Diagram + Diagram``) idempotent instead of duplicating
205
+ # shared edges, so no synthetic alias node is needed.
212
206
  for fk in fks.values():
213
207
  props = dict(
214
208
  primary=set(fk["attr_map"]) <= set(pks[fk["referencing_table"]]),
@@ -216,14 +210,12 @@ class Dependencies(nx.DiGraph):
216
210
  aliased=any(k != v for k, v in fk["attr_map"].items()),
217
211
  multi=set(fk["attr_map"]) != set(pks[fk["referencing_table"]]),
218
212
  )
219
- if not props["aliased"]:
220
- self.add_edge(fk["referenced_table"], fk["referencing_table"], **props)
221
- else:
222
- # for aliased dependencies, add an extra node in the format '1', '2', etc
223
- alias_node = "%d" % next(self._node_alias_count)
224
- self.add_node(alias_node)
225
- self.add_edge(fk["referenced_table"], alias_node, **props)
226
- self.add_edge(alias_node, fk["referencing_table"], **props)
213
+ self.add_edge(
214
+ fk["referenced_table"],
215
+ fk["referencing_table"],
216
+ key=tuple(fk["attr_map"]),
217
+ **props,
218
+ )
227
219
 
228
220
  if not nx.is_directed_acyclic_graph(self):
229
221
  raise DataJointError("DataJoint can only work with acyclic dependencies")
@@ -312,7 +304,7 @@ class Dependencies(nx.DiGraph):
312
304
  """
313
305
  return topo_sort(self)
314
306
 
315
- def parents(self, table_name: str, primary: bool | None = None) -> dict:
307
+ def parents(self, table_name: str, primary: bool | None = None) -> list[tuple[str, dict]]:
316
308
  r"""
317
309
  Get tables referenced by this table's foreign keys.
318
310
 
@@ -327,13 +319,19 @@ class Dependencies(nx.DiGraph):
327
319
 
328
320
  Returns
329
321
  -------
330
- dict
331
- Mapping of parent table name to edge properties.
322
+ list[tuple[str, dict]]
323
+ One ``(parent_table_name, edge_properties)`` pair per foreign key.
324
+ A parent may appear more than once when this table has multiple
325
+ (e.g. renamed) foreign keys to it — each is a distinct parallel edge.
332
326
  """
333
327
  self.load(force=False)
334
- return {p[0]: p[2] for p in self.in_edges(table_name, data=True) if primary is None or p[2]["primary"] == primary}
328
+ return [
329
+ (u, props)
330
+ for u, _, props in self.in_edges(table_name, data=True)
331
+ if primary is None or props["primary"] == primary
332
+ ]
335
333
 
336
- def children(self, table_name: str, primary: bool | None = None) -> dict:
334
+ def children(self, table_name: str, primary: bool | None = None) -> list[tuple[str, dict]]:
337
335
  r"""
338
336
  Get tables that reference this table through foreign keys.
339
337
 
@@ -348,11 +346,17 @@ class Dependencies(nx.DiGraph):
348
346
 
349
347
  Returns
350
348
  -------
351
- dict
352
- Mapping of child table name to edge properties.
349
+ list[tuple[str, dict]]
350
+ One ``(child_table_name, edge_properties)`` pair per foreign key.
351
+ A child may appear more than once when it has multiple (e.g. renamed)
352
+ foreign keys to this table — each is a distinct parallel edge.
353
353
  """
354
354
  self.load(force=False)
355
- return {p[1]: p[2] for p in self.out_edges(table_name, data=True) if primary is None or p[2]["primary"] == primary}
355
+ return [
356
+ (v, props)
357
+ for _, v, props in self.out_edges(table_name, data=True)
358
+ if primary is None or props["primary"] == primary
359
+ ]
356
360
 
357
361
  def descendants(self, full_table_name: str) -> list[str]:
358
362
  r"""