datajoint 2.0.2__tar.gz → 2.1.1__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 (163) hide show
  1. datajoint-2.1.1/.coveragerc +6 -0
  2. datajoint-2.1.1/.devcontainer/Dockerfile +14 -0
  3. datajoint-2.1.1/.devcontainer/devcontainer.json +6 -0
  4. datajoint-2.1.1/.devcontainer/docker-compose.yml +14 -0
  5. datajoint-2.1.1/.dockerignore +6 -0
  6. datajoint-2.1.1/.gitattributes +2 -0
  7. datajoint-2.1.1/.github/DISCUSSION_TEMPLATE/rfc.yml +107 -0
  8. datajoint-2.1.1/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  9. datajoint-2.1.1/.github/ISSUE_TEMPLATE/feature_request.md +46 -0
  10. datajoint-2.1.1/.github/ISSUE_TEMPLATE/improvement_request.md +46 -0
  11. datajoint-2.1.1/.github/dependabot.yml +12 -0
  12. datajoint-2.1.1/.github/release_drafter.yaml +35 -0
  13. datajoint-2.1.1/.github/workflows/close_inactive_issues_prs.yaml +33 -0
  14. datajoint-2.1.1/.github/workflows/draft_release.yaml +31 -0
  15. datajoint-2.1.1/.github/workflows/lint.yaml +29 -0
  16. datajoint-2.1.1/.github/workflows/post_draft_release_published.yaml +152 -0
  17. datajoint-2.1.1/.github/workflows/test.yaml +55 -0
  18. datajoint-2.1.1/.gitignore +202 -0
  19. datajoint-2.1.1/.pre-commit-config.yaml +49 -0
  20. datajoint-2.1.1/.vscode/launch.json +16 -0
  21. datajoint-2.1.1/CHANGELOG-archive.md +349 -0
  22. datajoint-2.1.1/CONTRIBUTING.md +152 -0
  23. datajoint-2.1.1/Dockerfile +24 -0
  24. {datajoint-2.0.2 → datajoint-2.1.1}/PKG-INFO +51 -50
  25. datajoint-2.1.1/RELEASE_MEMO.md +227 -0
  26. datajoint-2.1.1/activate.sh +4 -0
  27. datajoint-2.1.1/docker-compose.yaml +104 -0
  28. datajoint-2.1.1/images/pipeline.drawio +1 -0
  29. datajoint-2.1.1/images/pipeline.png +0 -0
  30. datajoint-2.1.1/pixi.lock +6128 -0
  31. {datajoint-2.0.2 → datajoint-2.1.1}/pyproject.toml +14 -11
  32. datajoint-2.1.1/src/datajoint/adapters/__init__.py +54 -0
  33. datajoint-2.1.1/src/datajoint/adapters/base.py +1169 -0
  34. datajoint-2.1.1/src/datajoint/adapters/mysql.py +1094 -0
  35. datajoint-2.1.1/src/datajoint/adapters/postgres.py +1510 -0
  36. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/autopopulate.py +26 -12
  37. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/blob.py +3 -0
  38. datajoint-2.1.1/src/datajoint/builtin_codecs/__init__.py +77 -0
  39. datajoint-2.1.1/src/datajoint/builtin_codecs/attach.py +136 -0
  40. datajoint-2.1.1/src/datajoint/builtin_codecs/blob.py +61 -0
  41. datajoint-2.1.1/src/datajoint/builtin_codecs/filepath.py +186 -0
  42. datajoint-2.1.1/src/datajoint/builtin_codecs/hash.py +104 -0
  43. datajoint-2.1.1/src/datajoint/builtin_codecs/npy.py +377 -0
  44. datajoint-2.1.1/src/datajoint/builtin_codecs/object.py +213 -0
  45. datajoint-2.1.1/src/datajoint/builtin_codecs/schema.py +175 -0
  46. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/codecs.py +7 -2
  47. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/condition.py +33 -16
  48. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/connection.py +67 -78
  49. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/declare.py +216 -73
  50. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/dependencies.py +102 -29
  51. datajoint-2.1.1/src/datajoint/diagram.py +1037 -0
  52. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/expression.py +537 -265
  53. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/heading.py +131 -60
  54. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/jobs.py +35 -37
  55. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/lineage.py +68 -32
  56. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/preview.py +2 -31
  57. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/schemas.py +14 -27
  58. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/settings.py +26 -3
  59. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/table.py +439 -205
  60. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/user_tables.py +18 -10
  61. datajoint-2.1.1/src/datajoint/utils.py +214 -0
  62. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/version.py +1 -1
  63. datajoint-2.1.1/tests/__init__.py +0 -0
  64. datajoint-2.1.1/tests/conftest.py +1018 -0
  65. datajoint-2.1.1/tests/integration/__init__.py +0 -0
  66. datajoint-2.1.1/tests/integration/data/Course.csv +46 -0
  67. datajoint-2.1.1/tests/integration/data/CurrentTerm.csv +2 -0
  68. datajoint-2.1.1/tests/integration/data/Department.csv +9 -0
  69. datajoint-2.1.1/tests/integration/data/Enroll.csv +3365 -0
  70. datajoint-2.1.1/tests/integration/data/Grade.csv +3028 -0
  71. datajoint-2.1.1/tests/integration/data/Section.csv +757 -0
  72. datajoint-2.1.1/tests/integration/data/Student.csv +301 -0
  73. datajoint-2.1.1/tests/integration/data/StudentMajor.csv +227 -0
  74. datajoint-2.1.1/tests/integration/data/Term.csv +19 -0
  75. datajoint-2.1.1/tests/integration/test_aggr_regressions.py +249 -0
  76. datajoint-2.1.1/tests/integration/test_alter.py +54 -0
  77. datajoint-2.1.1/tests/integration/test_attach.py +71 -0
  78. datajoint-2.1.1/tests/integration/test_autopopulate.py +230 -0
  79. datajoint-2.1.1/tests/integration/test_blob.py +244 -0
  80. datajoint-2.1.1/tests/integration/test_blob_matlab.py +230 -0
  81. datajoint-2.1.1/tests/integration/test_cascade_delete.py +190 -0
  82. datajoint-2.1.1/tests/integration/test_cascading_delete.py +148 -0
  83. datajoint-2.1.1/tests/integration/test_cli.py +124 -0
  84. datajoint-2.1.1/tests/integration/test_codec_chaining.py +368 -0
  85. datajoint-2.1.1/tests/integration/test_codecs.py +129 -0
  86. datajoint-2.1.1/tests/integration/test_connection.py +138 -0
  87. datajoint-2.1.1/tests/integration/test_declare.py +466 -0
  88. datajoint-2.1.1/tests/integration/test_dependencies.py +52 -0
  89. datajoint-2.1.1/tests/integration/test_erd.py +63 -0
  90. datajoint-2.1.1/tests/integration/test_fetch.py +508 -0
  91. datajoint-2.1.1/tests/integration/test_fetch_same.py +69 -0
  92. datajoint-2.1.1/tests/integration/test_foreign_keys.py +53 -0
  93. datajoint-2.1.1/tests/integration/test_gc.py +349 -0
  94. datajoint-2.1.1/tests/integration/test_groupby.py +11 -0
  95. datajoint-2.1.1/tests/integration/test_hash_storage.py +218 -0
  96. datajoint-2.1.1/tests/integration/test_hidden_job_metadata.py +273 -0
  97. datajoint-2.1.1/tests/integration/test_insert.py +509 -0
  98. datajoint-2.1.1/tests/integration/test_jobs.py +209 -0
  99. datajoint-2.1.1/tests/integration/test_json.py +213 -0
  100. datajoint-2.1.1/tests/integration/test_multi_backend.py +143 -0
  101. datajoint-2.1.1/tests/integration/test_nan.py +50 -0
  102. datajoint-2.1.1/tests/integration/test_npy_codec.py +507 -0
  103. datajoint-2.1.1/tests/integration/test_object.py +760 -0
  104. datajoint-2.1.1/tests/integration/test_privileges.py +112 -0
  105. datajoint-2.1.1/tests/integration/test_reconnection.py +33 -0
  106. datajoint-2.1.1/tests/integration/test_relation.py +286 -0
  107. datajoint-2.1.1/tests/integration/test_relation_u.py +81 -0
  108. datajoint-2.1.1/tests/integration/test_relational_operand.py +665 -0
  109. datajoint-2.1.1/tests/integration/test_schema.py +264 -0
  110. datajoint-2.1.1/tests/integration/test_schema_keywords.py +50 -0
  111. datajoint-2.1.1/tests/integration/test_semantic_matching.py +342 -0
  112. datajoint-2.1.1/tests/integration/test_tls.py +56 -0
  113. datajoint-2.1.1/tests/integration/test_type_aliases.py +184 -0
  114. datajoint-2.1.1/tests/integration/test_university.py +167 -0
  115. datajoint-2.1.1/tests/integration/test_update1.py +154 -0
  116. datajoint-2.1.1/tests/integration/test_utils.py +43 -0
  117. datajoint-2.1.1/tests/integration/test_uuid.py +72 -0
  118. datajoint-2.1.1/tests/integration/test_virtual_module.py +107 -0
  119. datajoint-2.1.1/tests/schema.py +459 -0
  120. datajoint-2.1.1/tests/schema_advanced.py +141 -0
  121. datajoint-2.1.1/tests/schema_aggr_regress.py +52 -0
  122. datajoint-2.1.1/tests/schema_alter.py +57 -0
  123. datajoint-2.1.1/tests/schema_codecs.py +63 -0
  124. datajoint-2.1.1/tests/schema_external.py +89 -0
  125. datajoint-2.1.1/tests/schema_object.py +51 -0
  126. datajoint-2.1.1/tests/schema_privileges.py +35 -0
  127. datajoint-2.1.1/tests/schema_simple.py +313 -0
  128. datajoint-2.1.1/tests/schema_type_aliases.py +46 -0
  129. datajoint-2.1.1/tests/schema_university.py +113 -0
  130. datajoint-2.1.1/tests/schema_uuid.py +46 -0
  131. datajoint-2.1.1/tests/test_package.py +9 -0
  132. datajoint-2.1.1/tests/unit/__init__.py +0 -0
  133. datajoint-2.1.1/tests/unit/test_adapters.py +544 -0
  134. datajoint-2.1.1/tests/unit/test_codecs.py +657 -0
  135. datajoint-2.1.1/tests/unit/test_condition.py +95 -0
  136. datajoint-2.1.1/tests/unit/test_fetch_compat.py +117 -0
  137. datajoint-2.1.1/tests/unit/test_lazy_imports.py +87 -0
  138. datajoint-2.1.1/tests/unit/test_pk_rules.py +207 -0
  139. datajoint-2.1.1/tests/unit/test_settings.py +870 -0
  140. datajoint-2.1.1/tests/unit/test_storage_urls.py +121 -0
  141. datajoint-2.0.2/setup.cfg +0 -4
  142. datajoint-2.0.2/src/datajoint/builtin_codecs.py +0 -1286
  143. datajoint-2.0.2/src/datajoint/diagram.py +0 -498
  144. datajoint-2.0.2/src/datajoint/utils.py +0 -148
  145. datajoint-2.0.2/src/datajoint.egg-info/PKG-INFO +0 -348
  146. datajoint-2.0.2/src/datajoint.egg-info/SOURCES.txt +0 -40
  147. datajoint-2.0.2/src/datajoint.egg-info/dependency_links.txt +0 -1
  148. datajoint-2.0.2/src/datajoint.egg-info/entry_points.txt +0 -3
  149. datajoint-2.0.2/src/datajoint.egg-info/requires.txt +0 -50
  150. datajoint-2.0.2/src/datajoint.egg-info/top_level.txt +0 -1
  151. {datajoint-2.0.2 → datajoint-2.1.1}/LICENSE +0 -0
  152. {datajoint-2.0.2 → datajoint-2.1.1}/README.md +0 -0
  153. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/__init__.py +0 -0
  154. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/cli.py +0 -0
  155. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/errors.py +0 -0
  156. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/gc.py +0 -0
  157. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/hash_registry.py +0 -0
  158. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/logging.py +0 -0
  159. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/migrate.py +0 -0
  160. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/objectref.py +0 -0
  161. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/staged_insert.py +0 -0
  162. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/storage.py +0 -0
  163. {datajoint-2.0.2 → datajoint-2.1.1}/src/datajoint/types.py +0 -0
@@ -0,0 +1,6 @@
1
+ [run]
2
+ branch = False
3
+ source = datajoint
4
+
5
+ [report]
6
+ show_missing = True
@@ -0,0 +1,14 @@
1
+ ARG PY_VER
2
+ ARG DISTRO
3
+ FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO}
4
+ RUN \
5
+ apt update && \
6
+ apt-get install bash-completion graphviz default-mysql-client -y && \
7
+ pip install flake8 black faker ipykernel pytest pytest-cov nose nose-cov datajoint jupyterlab && \
8
+ pip uninstall datajoint -y
9
+
10
+ USER root
11
+ ENV DJ_HOST=db
12
+ ENV DJ_USER=root
13
+ ENV DJ_PASS=password
14
+ ENV S3_ENDPOINT=minio:9000
@@ -0,0 +1,6 @@
1
+ {
2
+ "dockerComposeFile": ["../docker-compose.yaml", "docker-compose.yml"],
3
+ "service": "app",
4
+ "workspaceFolder": "/src",
5
+ "postCreateCommand": "curl -fsSL https://pixi.sh/install.sh | bash && echo 'export PATH=\"$HOME/.pixi/bin:$PATH\"' >> ~/.bashrc"
6
+ }
@@ -0,0 +1,14 @@
1
+ # Devcontainer overrides for the app service from ../docker-compose.yaml
2
+ # Inherits db and minio services automatically
3
+ services:
4
+ app:
5
+ container_name: datajoint-python-devcontainer
6
+ build:
7
+ context: ..
8
+ dockerfile: .devcontainer/Dockerfile
9
+ args:
10
+ - PY_VER=${PY_VER:-3.11}
11
+ - DISTRO=${DISTRO:-bookworm}
12
+ user: root
13
+ # Keep container running for devcontainer
14
+ command: /bin/sh -c "while sleep 1000; do :; done"
@@ -0,0 +1,6 @@
1
+ notebook
2
+ build
3
+ *.egg-info
4
+ dist
5
+ .vscode
6
+ __pycache__
@@ -0,0 +1,2 @@
1
+ # SCM syntax highlighting & preventing 3-way merges
2
+ pixi.lock merge=binary linguist-language=YAML linguist-generated=true
@@ -0,0 +1,107 @@
1
+ title: "[RFC] "
2
+ labels:
3
+ - rfc
4
+ - "status: proposed"
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ ## DataJoint Enhancement Proposal
10
+
11
+ Use this template to propose changes to DataJoint specifications, APIs, or documentation structure.
12
+
13
+ **Before submitting:**
14
+ - Search existing discussions to avoid duplicates
15
+ - Consider starting with an informal discussion in the Ideas category first
16
+
17
+ - type: textarea
18
+ id: summary
19
+ attributes:
20
+ label: Summary
21
+ description: A brief, one-paragraph explanation of the proposal.
22
+ placeholder: This proposal adds/changes/removes...
23
+ validations:
24
+ required: true
25
+
26
+ - type: textarea
27
+ id: motivation
28
+ attributes:
29
+ label: Motivation
30
+ description: |
31
+ Why is this change needed? What problem does it solve?
32
+ Include concrete use cases and examples where possible.
33
+ placeholder: |
34
+ Currently, users need to...
35
+ This causes problems when...
36
+ With this change, users could...
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: design
42
+ attributes:
43
+ label: Proposed Design
44
+ description: |
45
+ Detailed explanation of the proposed solution.
46
+ Include code examples, API signatures, or schema definitions as appropriate.
47
+ placeholder: |
48
+ ## API Changes
49
+ ```python
50
+ # Example usage
51
+ ```
52
+
53
+ ## Behavior
54
+ - When X happens, Y should occur
55
+ - Error handling: ...
56
+ validations:
57
+ required: true
58
+
59
+ - type: textarea
60
+ id: alternatives
61
+ attributes:
62
+ label: Alternatives Considered
63
+ description: What other approaches were considered and why were they not chosen?
64
+ placeholder: |
65
+ 1. Alternative A: ...
66
+ Rejected because: ...
67
+
68
+ 2. Alternative B: ...
69
+ Rejected because: ...
70
+
71
+ - type: textarea
72
+ id: compatibility
73
+ attributes:
74
+ label: Backwards Compatibility
75
+ description: |
76
+ How does this affect existing users?
77
+ - Breaking changes?
78
+ - Migration path?
79
+ - Deprecation timeline?
80
+ placeholder: |
81
+ This change is/is not backwards compatible.
82
+
83
+ Migration path:
84
+ 1. ...
85
+
86
+ - type: textarea
87
+ id: implementation
88
+ attributes:
89
+ label: Implementation Notes
90
+ description: |
91
+ Optional: Technical details, affected files, estimated scope.
92
+ Prototyping in parallel with RFC discussion is encouraged.
93
+ placeholder: |
94
+ Affected components:
95
+ - datajoint-python/src/datajoint/...
96
+
97
+ Estimated scope: small/medium/large
98
+
99
+ - type: checkboxes
100
+ id: checklist
101
+ attributes:
102
+ label: Checklist
103
+ options:
104
+ - label: I have searched existing discussions and issues for duplicates
105
+ required: true
106
+ - label: I have considered backwards compatibility
107
+ required: true
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "Bug: "
5
+ labels: ["bug", "triage"]
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Bug Report
11
+
12
+ ### Description
13
+ A clear and concise description of what is the overall operation that is intended to be performed that resulted in an error.
14
+
15
+ ### Reproducibility
16
+ Include:
17
+ - OS (WIN | MACOS | Linux)
18
+ - Python Version OR MATLAB Version
19
+ - MySQL Version
20
+ - MySQL Deployment Strategy (local-native | local-docker | remote)
21
+ - DataJoint Version
22
+ - Minimum number of steps to reliably reproduce the issue
23
+ - Complete error stack as a result of evaluating the above steps
24
+
25
+ ### Expected Behavior
26
+ A clear and concise description of what you expected to happen.
27
+
28
+ ### Screenshots
29
+ If applicable, add screenshots to help explain your problem.
30
+
31
+ ### Additional Research and Context
32
+ Add any additional research or context that was conducted in creating this report.
33
+
34
+ For example:
35
+ - Related GitHub issues and PR's either within this repository or in other relevant repositories.
36
+ - Specific links to specific lines or a focus within source code.
37
+ - Relevant summary of Maintainers development meetings, milestones, projects, etc.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for a new feature
4
+ title: "FEAT: "
5
+ labels: ["enhancement", "triage"]
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Feature Request
11
+
12
+ ### Problem
13
+ A clear and concise description how this idea has manifested and the context. Elaborate on the need for this feature. Ex. I'm always frustrated when [...]
14
+
15
+ ### Requirements
16
+ A clear and concise description of the requirements to satisfy the new feature. Detail what you expect from a successful implementation of the feature. Ex. When using this feature, it should [...]
17
+
18
+ ### Justification
19
+ Provide the key benefits in making this a supported feature. Ex. Adding support for this feature would ensure [...]
20
+
21
+ ### Alternative Considerations
22
+ Do you currently have a work-around for this? Provide any alternative solutions or features you've considered.
23
+
24
+ ### Related Errors
25
+ Add any errors as a direct result of not exposing this feature.
26
+
27
+ Please include steps to reproduce provided errors as follows:
28
+ - OS (WIN | MACOS | Linux)
29
+ - Python Version OR MATLAB Version
30
+ - MySQL Version
31
+ - MySQL Deployment Strategy (local-native | local-docker | remote)
32
+ - DataJoint Version
33
+ - Minimum number of steps to reliably reproduce the issue
34
+ - Complete error stack as a result of evaluating the above steps
35
+
36
+ ### Screenshots
37
+ If applicable, add screenshots to help explain your feature.
38
+
39
+ ### Additional Research and Context
40
+ Add any additional research or context that was conducted in creating this feature request.
41
+
42
+ For example:
43
+ - Related GitHub issues and PR's either within this repository or in other relevant repositories.
44
+ - Specific links to specific line or focus within source code.
45
+ - Relevant summary of Maintainers development meetings, milestones, projects, etc.
46
+ - Any additional supplemental web references or links that would further justify this feature request.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: Improvement request
3
+ about: Suggest an idea for improvement
4
+ title: "IMPR: "
5
+ labels: ["enhancement", "triage"]
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Improvement Request
11
+
12
+ ### Problem
13
+ A clear and concise description how this idea has manifested and the context. Elaborate on the need for what could be improved. Ex. I'm always frustrated when [...]
14
+
15
+ ### Requirements
16
+ A clear and concise description of the requirements to satisfy the new improvement. Detail what you expect from a successful implementation of the improvement. Ex. When using this improvement, it should [...]
17
+
18
+ ### Justification
19
+ Provide the key benefits in making this a supported improvement. Ex. Adding support for this improvement would ensure [...]
20
+
21
+ ### Alternative Considerations
22
+ Do you currently have a work-around for this? Provide any alternative solutions or improvements you've considered.
23
+
24
+ ### Related Errors
25
+ Add any errors as a direct result of not exposing this improvement.
26
+
27
+ Please include steps to reproduce provided errors as follows:
28
+ - OS (WIN | MACOS | Linux)
29
+ - Python Version OR MATLAB Version
30
+ - MySQL Version
31
+ - MySQL Deployment Strategy (local-native | local-docker | remote)
32
+ - DataJoint Version
33
+ - Minimum number of steps to reliably reproduce the issue
34
+ - Complete error stack as a result of evaluating the above steps
35
+
36
+ ### Screenshots
37
+ If applicable, add screenshots to help explain your improvement.
38
+
39
+ ### Additional Research and Context
40
+ Add any additional research or context that was conducted in creating this improvement request.
41
+
42
+ For example:
43
+ - Related GitHub issues and PR's either within this repository or in other relevant repositories.
44
+ - Specific links to specific line or focus within source code.
45
+ - Relevant summary of Maintainers development meetings, milestones, projects, etc.
46
+ - Any additional supplemental web references or links that would further justify this improvement request.
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ day: "wednesday"
8
+ time: "9:00"
9
+ timezone: "America/Chicago"
10
+ groups:
11
+ all-actions:
12
+ patterns: [ "*" ]
@@ -0,0 +1,35 @@
1
+ version-resolver:
2
+ major:
3
+ labels:
4
+ - 'breaking'
5
+ minor:
6
+ labels:
7
+ - 'feature'
8
+ patch:
9
+ labels:
10
+ - 'documentation'
11
+ - 'enhancement'
12
+ - 'bug'
13
+ name-template: '$RESOLVED_VERSION'
14
+ tag-template: 'v$RESOLVED_VERSION'
15
+ categories:
16
+ - title: '💥 Breaking Changes'
17
+ labels:
18
+ - 'breaking'
19
+ - title: '🚀 Features'
20
+ labels:
21
+ - 'feature'
22
+ - title: '⚡️ Enhancements'
23
+ labels:
24
+ - 'enhancement'
25
+ - title: '🐛 Bug Fixes'
26
+ labels:
27
+ - 'bug'
28
+ - title: '📝 Documentation'
29
+ label: 'documentation'
30
+ change-template: '- $TITLE(#$NUMBER)@$AUTHOR'
31
+ change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
32
+ template: |
33
+ $CHANGES
34
+
35
+ **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
@@ -0,0 +1,33 @@
1
+ name: Close inactive issues and PRs
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ close-issues:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ pull-requests: write
13
+ steps:
14
+ - uses: actions/stale@v9
15
+ with:
16
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
17
+ operations-per-run: 500 # API rate limit
18
+ ## issues
19
+ # stale
20
+ days-before-issue-stale: 45 # for initial period, suggest 15
21
+ stale-issue-label: "stale"
22
+ stale-issue-message: "This issue is stale because it has been open for 45 days with no activity."
23
+ # close
24
+ days-before-issue-close: 365 # for initial period, suggest 30
25
+ close-issue-message: "This issue was closed because it has been inactive for 365 days since being marked as stale, please reopen if it's still applicable."
26
+ ## PRs
27
+ # stale
28
+ days-before-pr-stale: 45 # for initial period, suggest 15
29
+ stale-pr-label: "stale"
30
+ stale-pr-message: "This PR is stale because it has been open for 45 days with no activity."
31
+ # close
32
+ days-before-pr-close: 365 # for initial period, suggest 30
33
+ close-pr-message: "This PR was closed because it has been inactive for 365 days since being marked as stale, please reopen if it's still applicable."
@@ -0,0 +1,31 @@
1
+ name: Manual Draft Release
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ testpypi:
6
+ description: 'Release to TestPyPI then skip following'
7
+ default: 'false'
8
+ type: choice
9
+ options:
10
+ - 'true'
11
+ - 'false'
12
+ jobs:
13
+ build-release:
14
+ permissions:
15
+ # write permission is required to create a github release
16
+ contents: write
17
+ # write permission is required for autolabeler
18
+ # otherwise, read permission is required at least
19
+ pull-requests: read
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ # Drafts your next Release notes as Pull Requests are merged into "master"
23
+ - name: Draft release notes
24
+ id: create_gh_release
25
+ uses: release-drafter/release-drafter@v6
26
+ with:
27
+ config-name: release_drafter.yaml
28
+ disable-autolabeler: true
29
+ name: ${{ github.event.inputs.testpypi == 'true' && 'Test $RESOLVED_VERSION' || 'Release $RESOLVED_VERSION' }}
30
+ env:
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,29 @@
1
+ name: Lint
2
+ on:
3
+ push:
4
+ branches:
5
+ - "**" # every branch
6
+ - "!gh-pages" # exclude gh-pages branch
7
+ - "!stage*" # exclude branches beginning with stage
8
+ pull_request:
9
+ branches:
10
+ - "**" # every branch
11
+ - "!gh-pages" # exclude gh-pages branch
12
+ - "!stage*" # exclude branches beginning with stage
13
+ jobs:
14
+ lint:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ # enforce the same check as pre-commit
20
+ # but only run important checks
21
+ - uses: pre-commit/action@v3.0.1
22
+ with:
23
+ extra_args: codespell --all-files
24
+ - uses: pre-commit/action@v3.0.1
25
+ with:
26
+ extra_args: ruff --all-files
27
+ - uses: pre-commit/action@v3.0.1
28
+ with:
29
+ extra_args: ruff-format --all-files
@@ -0,0 +1,152 @@
1
+ name: Post Draft Release Published
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ ## pre-release and stable release
7
+ #- published
8
+ ## stable release only
9
+ - released
10
+ run-name: Post ${{ github.event.release.name }}
11
+
12
+ jobs:
13
+ pypi-release:
14
+ permissions:
15
+ # write permission is required to update version.py
16
+ contents: write
17
+ pull-requests: write
18
+ # Use the oldest supported version to build, just in case there are issues
19
+ # for our case, this doesn't matter that much, since the build is for 3.x
20
+ strategy:
21
+ matrix:
22
+ include:
23
+ - py_ver: "3.10"
24
+ runs-on: ubuntu-latest
25
+ env:
26
+ PY_VER: ${{matrix.py_ver}}
27
+ TWINE_USERNAME: ${{secrets.twine_username}}
28
+ TWINE_PASSWORD: ${{secrets.twine_password}}
29
+ TWINE_TEST_USERNAME: ${{secrets.twine_test_username}}
30
+ TWINE_TEST_PASSWORD: ${{secrets.twine_test_password}}
31
+ steps:
32
+ - name: Checkout repository
33
+ uses: actions/checkout@v4
34
+ with:
35
+ 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 }}"
62
+ - name: Set up Python ${{matrix.py_ver}}
63
+ uses: actions/setup-python@v5
64
+ with:
65
+ python-version: ${{matrix.py_ver}}
66
+ # Merging build and release steps just for the simplicity,
67
+ # since datajoint-python doesn't have platform specific dependencies or binaries,
68
+ # and the build process is fairly fast, so removed upload/download artifacts
69
+ - name: Build package
70
+ id: build
71
+ run: |
72
+ python -m pip install build
73
+ python -m build .
74
+ echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV
75
+ echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV
76
+ echo "NEW_VERSION=${{github.event.release.resolved_version}}" >> $GITHUB_ENV
77
+ - name: Publish package
78
+ id: publish
79
+ env:
80
+ RELEASE_NAME: ${{ github.event.release.name }}
81
+ run: |
82
+ export HOST_UID=$(id -u)
83
+ if [[ "$RELEASE_NAME" =~ ^Test ]]; then
84
+ LATEST_PYPI=$(curl -s https://test.pypi.org/pypi/datajoint/json | jq -r '.info.version')
85
+ echo "TEST_PYPI=true" >> $GITHUB_ENV
86
+ export TWINE_REPOSITORY="testpypi"
87
+ export TWINE_USERNAME=${TWINE_TEST_USERNAME}
88
+ export TWINE_PASSWORD=${TWINE_TEST_PASSWORD}
89
+ else
90
+ LATEST_PYPI=$(curl -s https://pypi.org/pypi/datajoint/json | jq -r '.info.version')
91
+ echo "TEST_PYPI=false" >> $GITHUB_ENV
92
+ export TWINE_REPOSITORY="pypi"
93
+ 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
104
+ # Upload package as release assets
105
+ - name: Upload pip wheel asset to release
106
+ uses: actions/upload-release-asset@v1
107
+ env:
108
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
109
+ with:
110
+ upload_url: ${{github.event.release.upload_url}}
111
+ asset_path: ${{env.DJ_WHEEL_PATH}}
112
+ asset_name: pip-datajoint-${{ github.event.release.tag_name }}.whl
113
+ asset_content_type: application/zip
114
+ - name: Upload pip sdist asset to release
115
+ uses: actions/upload-release-asset@v1
116
+ env:
117
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
118
+ with:
119
+ upload_url: ${{github.event.release.upload_url}}
120
+ asset_path: ${{env.DJ_SDIST_PATH}}
121
+ asset_name: pip-datajoint-${{ github.event.release.tag_name }}.tar.gz
122
+ 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
+ - name: Post release notification to Slack
135
+ if: ${{ env.TEST_PYPI == 'false' }}
136
+ uses: slackapi/slack-github-action@v2.0.0
137
+ with:
138
+ webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
139
+ webhook-type: incoming-webhook
140
+ payload: |
141
+ {
142
+ "text": "*New Release Published!* :tada: \n*Repository:* ${{ github.repository }}\n*Version:* ${{ github.event.release.tag_name }}\n*URL:* ${{ github.event.release.html_url }}",
143
+ "blocks": [
144
+ {
145
+ "type": "section",
146
+ "text": {
147
+ "type": "mrkdwn",
148
+ "text": "*New Release Published!* :tada:\n*Repository:* ${{ github.repository }}\n*Version:* ${{ github.event.release.tag_name }}\n*URL:* <${{ github.event.release.html_url }}|View Release>"
149
+ }
150
+ }
151
+ ]
152
+ }
@@ -0,0 +1,55 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "**"
7
+ - "!gh-pages"
8
+ - "!stage*"
9
+ paths:
10
+ - "src/datajoint/**"
11
+ - "tests/**"
12
+ - "pyproject.toml"
13
+ - "pixi.lock"
14
+ - ".github/workflows/test.yaml"
15
+ pull_request:
16
+ branches:
17
+ - "**"
18
+ - "!gh-pages"
19
+ - "!stage*"
20
+ paths:
21
+ - "src/datajoint/**"
22
+ - "tests/**"
23
+ - "pyproject.toml"
24
+ - "pixi.lock"
25
+ - ".github/workflows/test.yaml"
26
+
27
+ jobs:
28
+ test:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+
33
+ - name: Set up pixi
34
+ uses: prefix-dev/setup-pixi@v0.9.3
35
+ with:
36
+ cache: true
37
+ locked: false
38
+
39
+ - name: Run tests
40
+ run: pixi run -e test test-cov
41
+
42
+ # Unit tests run without containers (faster feedback)
43
+ unit-tests:
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+
48
+ - name: Set up pixi
49
+ uses: prefix-dev/setup-pixi@v0.9.3
50
+ with:
51
+ cache: true
52
+ locked: false
53
+
54
+ - name: Run unit tests
55
+ run: pixi run -e test pytest tests/unit -v