anyvar 1.1.0.dev0__tar.gz → 1.1.0.dev1__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 (177) hide show
  1. anyvar-1.1.0.dev1/.dockerignore +33 -0
  2. anyvar-1.1.0.dev1/.env.example +47 -0
  3. anyvar-1.1.0.dev1/.git-blame-ignore-revs +3 -0
  4. anyvar-1.1.0.dev1/.github/CODEOWNERS +1 -0
  5. anyvar-1.1.0.dev1/.github/ISSUE_TEMPLATE/bug-report.yaml +93 -0
  6. anyvar-1.1.0.dev1/.github/ISSUE_TEMPLATE/feature-request.yaml +68 -0
  7. anyvar-1.1.0.dev1/.github/labels.yml +3 -0
  8. anyvar-1.1.0.dev1/.github/workflows/labels.yml +29 -0
  9. anyvar-1.1.0.dev1/.github/workflows/python-package.yml +129 -0
  10. anyvar-1.1.0.dev1/.github/workflows/release.yml +102 -0
  11. anyvar-1.1.0.dev1/.github/workflows/stale.yml +11 -0
  12. anyvar-1.1.0.dev1/.gitignore +131 -0
  13. anyvar-1.1.0.dev1/.pre-commit-config.yaml +31 -0
  14. anyvar-1.1.0.dev1/.readthedocs.yaml +17 -0
  15. anyvar-1.1.0.dev1/.service_info_example.yaml +17 -0
  16. anyvar-1.1.0.dev1/CITATION.cff +35 -0
  17. anyvar-1.1.0.dev1/Dockerfile +39 -0
  18. anyvar-1.1.0.dev1/HISTORY.md +19 -0
  19. anyvar-1.1.0.dev1/Makefile +141 -0
  20. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/PKG-INFO +12 -25
  21. anyvar-1.1.0.dev1/alembic/README +1 -0
  22. anyvar-1.1.0.dev1/alembic/env.py +72 -0
  23. anyvar-1.1.0.dev1/alembic/script.py.mako +28 -0
  24. anyvar-1.1.0.dev1/alembic/versions/18469f31ca97_initial_schema.py +156 -0
  25. anyvar-1.1.0.dev1/alembic.ini +93 -0
  26. anyvar-1.1.0.dev1/compose.yaml +91 -0
  27. anyvar-1.1.0.dev1/docs/Makefile +20 -0
  28. anyvar-1.1.0.dev1/docs/source/_templates/module_summary.rst +7 -0
  29. anyvar-1.1.0.dev1/docs/source/_templates/module_summary_no_inherit.rst +8 -0
  30. anyvar-1.1.0.dev1/docs/source/api/anyvar.anyvar.rst +8 -0
  31. anyvar-1.1.0.dev1/docs/source/api/anyvar.core.categorical_variants.rst +8 -0
  32. anyvar-1.1.0.dev1/docs/source/api/anyvar.core.metadata.rst +8 -0
  33. anyvar-1.1.0.dev1/docs/source/api/anyvar.core.objects.rst +8 -0
  34. anyvar-1.1.0.dev1/docs/source/api/api/queueing/anyvar.queueing.celery_worker.rst +8 -0
  35. anyvar-1.1.0.dev1/docs/source/api/index.rst +79 -0
  36. anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.liftover.rst +8 -0
  37. anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.projection.rst +8 -0
  38. anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.projection_models.rst +8 -0
  39. anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.protocols.rst +8 -0
  40. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.base.rst +9 -0
  41. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.duckdb.rst +9 -0
  42. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.mapper_registry.rst +9 -0
  43. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.mappers.rst +9 -0
  44. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.no_db.rst +9 -0
  45. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.orm.rst +9 -0
  46. anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.postgres.rst +9 -0
  47. anyvar-1.1.0.dev1/docs/source/api/translate/anyvar.translate.base.rst +8 -0
  48. anyvar-1.1.0.dev1/docs/source/api/translate/anyvar.translate.register.rst +8 -0
  49. anyvar-1.1.0.dev1/docs/source/api/translate/anyvar.translate.vrs_python.rst +8 -0
  50. anyvar-1.1.0.dev1/docs/source/api/vcf/anyvar.vcf.ingest.rst +8 -0
  51. anyvar-1.1.0.dev1/docs/source/changelog.rst +7 -0
  52. anyvar-1.1.0.dev1/docs/source/conf.py +62 -0
  53. anyvar-1.1.0.dev1/docs/source/configuration/async.rst +122 -0
  54. anyvar-1.1.0.dev1/docs/source/configuration/authentication.rst +155 -0
  55. anyvar-1.1.0.dev1/docs/source/configuration/docker_compose.rst +156 -0
  56. anyvar-1.1.0.dev1/docs/source/configuration/dotenv_example.rst +4 -0
  57. anyvar-1.1.0.dev1/docs/source/configuration/index.rst +24 -0
  58. anyvar-1.1.0.dev1/docs/source/configuration/logging.rst +66 -0
  59. anyvar-1.1.0.dev1/docs/source/configuration/service_info.rst +23 -0
  60. anyvar-1.1.0.dev1/docs/source/configuration/storage.rst +47 -0
  61. anyvar-1.1.0.dev1/docs/source/contributing.rst +57 -0
  62. anyvar-1.1.0.dev1/docs/source/features.rst +119 -0
  63. anyvar-1.1.0.dev1/docs/source/getting_started/docker_compose.rst +46 -0
  64. anyvar-1.1.0.dev1/docs/source/getting_started/index.rst +14 -0
  65. anyvar-1.1.0.dev1/docs/source/getting_started/manual_setup.rst +99 -0
  66. anyvar-1.1.0.dev1/docs/source/help.rst +10 -0
  67. anyvar-1.1.0.dev1/docs/source/index.rst +26 -0
  68. anyvar-1.1.0.dev1/docs/source/license.rst +4 -0
  69. anyvar-1.1.0.dev1/docs/source/usage/index.rst +16 -0
  70. anyvar-1.1.0.dev1/docs/source/usage/python.rst +164 -0
  71. anyvar-1.1.0.dev1/docs/source/usage/rest_api.rst +344 -0
  72. anyvar-1.1.0.dev1/docs/source/usage/rest_service.rst +35 -0
  73. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/pyproject.toml +21 -9
  74. anyvar-1.1.0.dev1/scripts/vcf_benchmark.py +157 -0
  75. anyvar-1.1.0.dev1/src/anyvar/anyvar.py +448 -0
  76. anyvar-1.1.0.dev1/src/anyvar/core/categorical_variants.py +121 -0
  77. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/core/metadata.py +17 -12
  78. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/core/objects.py +8 -12
  79. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/mapping/liftover.py +19 -19
  80. anyvar-1.1.0.dev1/src/anyvar/mapping/projection.py +1036 -0
  81. anyvar-1.1.0.dev1/src/anyvar/mapping/projection_models.py +112 -0
  82. anyvar-1.1.0.dev1/src/anyvar/mapping/protocols.py +44 -0
  83. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/queueing/celery_worker.py +50 -1
  84. anyvar-1.1.0.dev1/src/anyvar/restapi/__init__.py +20 -0
  85. anyvar-1.1.0.dev1/src/anyvar/restapi/async_utils.py +174 -0
  86. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/auth.py +1 -1
  87. anyvar-1.1.0.dev1/src/anyvar/restapi/categorical_variants_router.py +233 -0
  88. anyvar-1.1.0.dev1/src/anyvar/restapi/examples.py +499 -0
  89. anyvar-1.1.0.dev1/src/anyvar/restapi/main.py +176 -0
  90. anyvar-1.1.0.dev1/src/anyvar/restapi/objects_router.py +318 -0
  91. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/schema.py +76 -119
  92. anyvar-1.1.0.dev1/src/anyvar/restapi/variation_request.py +42 -0
  93. anyvar-1.1.0.dev1/src/anyvar/restapi/variations_router.py +334 -0
  94. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/vcf_router.py +55 -129
  95. anyvar-1.1.0.dev1/src/anyvar/restapi/vrs_objects.py +30 -0
  96. anyvar-1.1.0.dev1/src/anyvar/storage/alembic_config.py +13 -0
  97. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/storage/base.py +101 -27
  98. anyvar-1.1.0.dev1/src/anyvar/storage/duckdb.py +137 -0
  99. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/storage/mapper_registry.py +10 -3
  100. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/storage/mappers.py +80 -14
  101. anyvar-1.1.0.dev1/src/anyvar/storage/no_db.py +110 -0
  102. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/storage/orm.py +31 -102
  103. anyvar-1.1.0.dev1/src/anyvar/storage/postgres.py +136 -0
  104. anyvar-1.1.0.dev0/src/anyvar/storage/postgres.py → anyvar-1.1.0.dev1/src/anyvar/storage/sqlalchemy.py +263 -88
  105. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/translate/base.py +3 -13
  106. anyvar-1.1.0.dev1/src/anyvar/translate/register.py +170 -0
  107. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/translate/vrs_python.py +10 -42
  108. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/vcf/ingest.py +3 -3
  109. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/PKG-INFO +12 -25
  110. anyvar-1.1.0.dev1/src/anyvar.egg-info/SOURCES.txt +165 -0
  111. anyvar-1.1.0.dev1/src/anyvar.egg-info/requires.txt +30 -0
  112. anyvar-1.1.0.dev1/src/anyvar.egg-info/scm_file_list.json +162 -0
  113. anyvar-1.1.0.dev1/src/anyvar.egg-info/scm_version.json +8 -0
  114. anyvar-1.1.0.dev1/tests/__init__.py +0 -0
  115. anyvar-1.1.0.dev1/tests/conftest.py +150 -0
  116. anyvar-1.1.0.dev1/tests/data/service_info_openapi.yaml +122 -0
  117. anyvar-1.1.0.dev1/tests/data/ucsc-chainfile/chainfile_hg19_to_hg38_.chain +56506 -0
  118. anyvar-1.1.0.dev1/tests/data/ucsc-chainfile/chainfile_hg38_to_hg19_.chain +236543 -0
  119. anyvar-1.1.0.dev1/tests/data/variations.json +583 -0
  120. anyvar-1.1.0.dev1/tests/integration/restapi/conftest.py +99 -0
  121. anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_extension.py +73 -0
  122. anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_location.py +18 -0
  123. anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_mappings.py +255 -0
  124. anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_object.py +13 -0
  125. anyvar-1.1.0.dev1/tests/integration/restapi/test_catvars_router.py +331 -0
  126. anyvar-1.1.0.dev1/tests/integration/restapi/test_search_router.py +26 -0
  127. anyvar-1.1.0.dev1/tests/integration/restapi/variations_router/test_projection.py +661 -0
  128. anyvar-1.1.0.dev1/tests/integration/restapi/variations_router/test_projection_protein_edges.py +175 -0
  129. anyvar-1.1.0.dev1/tests/integration/restapi/variations_router/test_variation.py +227 -0
  130. anyvar-1.1.0.dev1/tests/integration/restapi/vcf_router/test_annotate_vcf.py +383 -0
  131. anyvar-1.1.0.dev1/tests/integration/restapi/vcf_router/test_ingest_vcf.py +354 -0
  132. anyvar-1.1.0.dev1/tests/unit/__init__.py +0 -0
  133. anyvar-1.1.0.dev1/tests/unit/mapping/__init__.py +0 -0
  134. anyvar-1.1.0.dev1/tests/unit/mapping/test_liftover.py +228 -0
  135. anyvar-1.1.0.dev1/tests/unit/mapping/test_projection.py +1630 -0
  136. anyvar-1.1.0.dev1/tests/unit/restapi/__init__.py +0 -0
  137. anyvar-1.1.0.dev1/tests/unit/restapi/test_async_utils.py +237 -0
  138. anyvar-1.1.0.dev1/tests/unit/restapi/test_auth.py +1031 -0
  139. anyvar-1.1.0.dev1/tests/unit/restapi/test_meta_router.py +75 -0
  140. anyvar-1.1.0.dev1/tests/unit/restapi/test_objects_router.py +284 -0
  141. anyvar-1.1.0.dev1/tests/unit/restapi/test_schema.py +18 -0
  142. anyvar-1.1.0.dev1/tests/unit/restapi/test_variations_router.py +278 -0
  143. anyvar-1.1.0.dev1/tests/unit/storage/__init__.py +0 -0
  144. anyvar-1.1.0.dev1/tests/unit/storage/conftest.py +35 -0
  145. anyvar-1.1.0.dev1/tests/unit/storage/storage_test_funcs.py +580 -0
  146. anyvar-1.1.0.dev1/tests/unit/storage/test_duckdb.py +109 -0
  147. anyvar-1.1.0.dev1/tests/unit/storage/test_no_db.py +38 -0
  148. anyvar-1.1.0.dev1/tests/unit/storage/test_postgres.py +129 -0
  149. anyvar-1.1.0.dev1/tests/unit/test_anyvar.py +55 -0
  150. anyvar-1.1.0.dev1/tests/unit/test_catvars.py +40 -0
  151. anyvar-1.1.0.dev1/tests/unit/translate/__init__.py +0 -0
  152. anyvar-1.1.0.dev1/tests/unit/translate/test_register.py +230 -0
  153. anyvar-1.1.0.dev1/tests/unit/translate/test_vrs_python.py +32 -0
  154. anyvar-1.1.0.dev1/tests/unit/translate/test_vrs_python_caching.py +188 -0
  155. anyvar-1.1.0.dev0/src/anyvar/anyvar.py +0 -275
  156. anyvar-1.1.0.dev0/src/anyvar/restapi/__init__.py +0 -1
  157. anyvar-1.1.0.dev0/src/anyvar/restapi/main.py +0 -105
  158. anyvar-1.1.0.dev0/src/anyvar/restapi/objects_router.py +0 -501
  159. anyvar-1.1.0.dev0/src/anyvar/restapi/search_router.py +0 -69
  160. anyvar-1.1.0.dev0/src/anyvar/restapi/translate_router.py +0 -69
  161. anyvar-1.1.0.dev0/src/anyvar/storage/no_db.py +0 -80
  162. anyvar-1.1.0.dev0/src/anyvar/storage/snowflake.py +0 -792
  163. anyvar-1.1.0.dev0/src/anyvar.egg-info/SOURCES.txt +0 -39
  164. anyvar-1.1.0.dev0/src/anyvar.egg-info/requires.txt +0 -44
  165. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/LICENSE +0 -0
  166. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/README.md +0 -0
  167. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/setup.cfg +0 -0
  168. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/__init__.py +0 -0
  169. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/core/__init__.py +0 -0
  170. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/mapping/__init__.py +0 -0
  171. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/queueing/__init__.py +0 -0
  172. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/meta_router.py +0 -0
  173. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/storage/__init__.py +0 -0
  174. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/translate/__init__.py +0 -0
  175. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar/vcf/__init__.py +0 -0
  176. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/dependency_links.txt +0 -0
  177. {anyvar-1.1.0.dev0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/top_level.txt +0 -0
@@ -0,0 +1,33 @@
1
+ # Bytecode files
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+
6
+ # Virtual environment
7
+ venv/
8
+ .venv/
9
+
10
+ # Debug and log files
11
+ *.log
12
+ debug*.txt
13
+
14
+ # Data and media
15
+ data/
16
+ media/
17
+
18
+ # Temporary files and directories
19
+ tmp/
20
+ temp/
21
+ *.swp
22
+
23
+ # IDE and OS files
24
+ .idea/
25
+ .vscode/
26
+ .DS_Store
27
+
28
+ # Distribution files
29
+ dist/
30
+ build/
31
+ *.egg-info/
32
+
33
+ .env
@@ -0,0 +1,47 @@
1
+ ###############
2
+ # BASIC SETUP #
3
+ ###############
4
+
5
+ # Data resources -- see "Getting Started" -> "Manual Setup" in the docs
6
+ UTA_DB_URL=postgresql://anonymous@localhost:5432/uta/uta_20241220
7
+ SEQREPO_DATAPROXY_URI=seqrepo+file:///usr/local/share/seqrepo/2024-12-20
8
+
9
+ # Storage configuration -- see "Configuration" -> "Object Storage" in the docs
10
+ ANYVAR_STORAGE_URI=postgresql://anyvar:anyvar-pw@localhost:5432/anyvar
11
+
12
+ ############
13
+ # OPTIONAL #
14
+ ############
15
+
16
+ ## Service info definition -- see "Configuration" -> "Service-Info" in the docs
17
+ ANYVAR_SERVICE_INFO=./.service_info_example.yaml
18
+
19
+ ## Logging - see "Configuration" -> "Logging" in the docs
20
+ ANYVAR_LOGGING_CONFIG=path/to/logging/config/file.yaml
21
+
22
+ ## Projection - see "Features" -> "Variant Projection" in the docs
23
+ ## Requires installing AnyVar with the projection extra and configured UTA/SeqRepo resources.
24
+ ## Set to true to automatically store transcript/protein projections during registration.
25
+ ANYVAR_ENABLE_PROJECTION=false
26
+
27
+ ## Celery - See "Configuration" -> "Asynchronous Processing" in the docs
28
+ CELERY_BROKER_URL=redis://localhost:6379/0
29
+ CELERY_BACKEND_URL=redis://localhost:6379/0
30
+ ANYVAR_VCF_ASYNC_WORK_DIR=/path/to/shared/file/system
31
+ ANYVAR_VCF_ASYNC_FAILURE_STATUS_CODE=500
32
+ CELERY_TASK_DEFAULT_QUEUE=anyvar_q
33
+ CELERY_EVENT_QUEUE_PREFIX=anyvar_ev
34
+ CELERY_TIMEZONE=UTC
35
+ CELERY_RESULT_EXPIRES=7200
36
+ CELERY_TASK_ACKS_LATE=true
37
+ CELERY_TASK_REJECT_ON_WORKER_LOST=false
38
+ CELERY_WORKER_PREFETCH_MULTIPLIER=1
39
+ CELERY_TASK_TIME_LIMIT=3900
40
+ CELERY_SOFT_TIME_LIMIT=3600
41
+ CELERY_WORKER_SEND_TASK_EVENTS=false
42
+
43
+ ## Testing - see "Contributing" -> "Testing" in the docs
44
+ ANYVAR_TEST_STORAGE_URI=postgresql://postgres:postgres@localhost/anyvar_test
45
+
46
+ # for Docker-based SeqRepo install
47
+ SEQREPO_INSTANCE_DIR="/usr/local/share/seqrepo/2024-12-20"
@@ -0,0 +1,3 @@
1
+ # .git-blame-ignore-revs
2
+ # Initial linting
3
+ 1c01e4880f1973bfad61b7c591508e96e99fe6bc
@@ -0,0 +1 @@
1
+ * @biocommons/anyvar-maintainers
@@ -0,0 +1,93 @@
1
+ name: Bug Report
2
+ description: Report a bug.
3
+ labels: ["bug"]
4
+ body:
5
+ - type: textarea
6
+ attributes:
7
+ label: Describe the bug
8
+ description: Provide a clear and concise description of what the bug is.
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ attributes:
13
+ label: Steps to reproduce
14
+ description: Provide detailed steps to replicate the bug.
15
+ placeholder: |
16
+ 1. In this environment...
17
+ 2. With this config...
18
+ 3. Run '...'
19
+ 4. See error...
20
+ validations:
21
+ required: true
22
+ - type: textarea
23
+ attributes:
24
+ label: Expected behavior
25
+ description: What did you expect to happen?
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ attributes:
30
+ label: Current behavior
31
+ description: |
32
+ What actually happened?
33
+
34
+ Include full errors, stack traces, and/or relevant logs.
35
+ validations:
36
+ required: true
37
+ - type: textarea
38
+ attributes:
39
+ label: Acceptance Criteria
40
+ description: |
41
+ Provide the criteria that must be met in order for this issue to be considered fixed.
42
+ Be specific, and consider potential edge cases.
43
+ validations:
44
+ required: true
45
+ - type: textarea
46
+ attributes:
47
+ label: Possible reason(s)
48
+ description: Provide any insights into what might be causing the issue.
49
+ validations:
50
+ required: false
51
+ - type: textarea
52
+ attributes:
53
+ label: Suggested fix
54
+ description: Provide any suggestions on how to resolve the bug.
55
+ validations:
56
+ required: false
57
+ - type: textarea
58
+ attributes:
59
+ label: Branch, commit, and/or version
60
+ description: Provide the branch, commit, and/or version you're using.
61
+ placeholder: |
62
+ branch: issue-1
63
+ commit: abc123d
64
+ validations:
65
+ required: true
66
+ - type: textarea
67
+ attributes:
68
+ label: Screenshots
69
+ description: If applicable, add screenshots with descriptions to help explain your problem.
70
+ validations:
71
+ required: false
72
+ - type: textarea
73
+ attributes:
74
+ label: Environment details
75
+ description: Provide environment details (OS name and version, etc).
76
+ validations:
77
+ required: true
78
+ - type: textarea
79
+ attributes:
80
+ label: Additional details
81
+ description: Provide any other additional details about the problem.
82
+ validations:
83
+ required: false
84
+ - type: dropdown
85
+ attributes:
86
+ label: Contribution
87
+ description: Can you contribute to the development of this feature?
88
+ options:
89
+ - "Yes, I can create a PR for this fix."
90
+ - "Yes, but I can only provide ideas and feedback."
91
+ - "No, I cannot contribute."
92
+ validations:
93
+ required: false
@@ -0,0 +1,68 @@
1
+ name: Feature Request
2
+ description: Suggest an idea for this project.
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: textarea
6
+ attributes:
7
+ label: Feature description
8
+ description: Provide a clear and concise description of what you want to happen.
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ attributes:
13
+ label: Use case
14
+ description: |
15
+ Why do you need this feature? For example: "I'm always frustrated when..."
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ attributes:
20
+ label: Acceptance Criteria
21
+ description: |
22
+ Provide the criteria that must be met in order for this issue to be considered complete.
23
+ Be specific, and consider potential edge cases.
24
+ validations:
25
+ required: true
26
+ - type: textarea
27
+ attributes:
28
+ label: Proposed solution
29
+ description: Provide proposed solution.
30
+ validations:
31
+ required: false
32
+ - type: textarea
33
+ attributes:
34
+ label: Alternatives considered
35
+ description: Describe any alternative solutions you've considered.
36
+ validations:
37
+ required: false
38
+ - type: textarea
39
+ attributes:
40
+ label: Implementation details
41
+ description: Provide any technical details on how the feature might be implemented.
42
+ validations:
43
+ required: false
44
+ - type: textarea
45
+ attributes:
46
+ label: Potential Impact
47
+ description: |
48
+ Discuss any potential impacts of this feature on existing functionality or performance, if known.
49
+ Will this feature cause breaking changes?
50
+ What challenges might arise?
51
+ validations:
52
+ required: false
53
+ - type: textarea
54
+ attributes:
55
+ label: Additional context
56
+ description: Provide any other context or screenshots about the feature.
57
+ validations:
58
+ required: false
59
+ - type: dropdown
60
+ attributes:
61
+ label: Contribution
62
+ description: Can you contribute to the development of this feature?
63
+ options:
64
+ - "Yes, I can create a PR for this feature."
65
+ - "Yes, but I can only provide ideas and feedback."
66
+ - "No, I cannot contribute."
67
+ validations:
68
+ required: false
@@ -0,0 +1,3 @@
1
+ # file must contain an array, which may be empty
2
+
3
+ []
@@ -0,0 +1,29 @@
1
+ name: Sync labels
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+ branches:
6
+ - 'main'
7
+ paths:
8
+ - '.github/labels.yml'
9
+ - '.github/workflows/labels.yml'
10
+
11
+ permissions:
12
+ issues: write
13
+
14
+ jobs:
15
+ labels:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ sparse-checkout: .github/labels.yml
22
+
23
+ - uses: EndBug/label-sync@v2
24
+ with:
25
+ config-file: |
26
+ https://raw.githubusercontent.com/biocommons/.github/main/etc/labels.yml
27
+ .github/labels.yml
28
+
29
+ delete-other-labels: false
@@ -0,0 +1,129 @@
1
+ name: Python package
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ lint:
12
+ name: lint
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v6
19
+ with:
20
+ python-version: "3.11"
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v6
24
+ with:
25
+ enable-cache: true
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --group dev
29
+
30
+ - name: Check style
31
+ run: uv run ruff check && uv run ruff format --check
32
+ test:
33
+ name: test
34
+ runs-on: ubuntu-latest
35
+ strategy:
36
+ matrix:
37
+ python-version: ["3.11", "3.12", "3.13"]
38
+ storage:
39
+ - backend: postgres
40
+ uri: postgresql://postgres:postgres@localhost:5432/postgres
41
+ deps:
42
+
43
+ - backend: duckdb
44
+ uri: duckdb:///variants.duckdb
45
+ deps: '--extra duckdb'
46
+ services:
47
+ redis:
48
+ image: redis:alpine
49
+ ports:
50
+ - 6379:6379
51
+ steps:
52
+ - uses: actions/checkout@v6
53
+
54
+ - name: Start Postgres
55
+ if: matrix.storage.backend == 'postgres'
56
+ run: |
57
+ docker run -d \
58
+ --name postgres \
59
+ -e POSTGRES_PASSWORD=postgres \
60
+ -p 5432:5432 \
61
+ postgres:17
62
+
63
+ - name: Wait for Postgres
64
+ if: matrix.storage.backend == 'postgres'
65
+ run: |
66
+ for i in {1..30}; do
67
+ pg_isready -h localhost -p 5432 -U postgres && exit 0
68
+ sleep 1
69
+ done
70
+ docker logs postgres
71
+ exit 1
72
+
73
+ - name: Cache chainfiles for liftover
74
+ uses: actions/cache@v5
75
+ with:
76
+ path: ~/.local/share/wags_tails
77
+ key: ${{ runner.os }}-test-${{ hashFiles('pyproject.toml') }}
78
+
79
+ - name: Setup Python
80
+ uses: actions/setup-python@v6
81
+ with:
82
+ python-version: ${{ matrix.python-version }}
83
+
84
+ - name: Install uv
85
+ uses: astral-sh/setup-uv@v6
86
+ with:
87
+ enable-cache: true
88
+
89
+ - name: Install dependencies
90
+ run: uv sync --group test --extra queueing ${{ matrix.storage.deps }}
91
+
92
+ - name: Run tests
93
+ run: uv run pytest -vv -m "ci_ok"
94
+ env:
95
+ ANYVAR_TEST_STORAGE_URI: ${{ matrix.storage.uri }}
96
+ CELERY_BROKER_URL: redis://localhost:6379/0
97
+
98
+ precommit_hooks:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@v6
102
+
103
+ - uses: j178/prek-action@v2
104
+ with:
105
+ extra_args: '--all-files --skip "ruff-format" --skip "ruff-check"'
106
+
107
+ docs:
108
+ runs-on: ubuntu-latest
109
+ env:
110
+ SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111
+ steps:
112
+ - uses: actions/checkout@v6
113
+
114
+ - name: Set up Python
115
+ uses: actions/setup-python@v6
116
+ with:
117
+ python-version: 3.11
118
+
119
+ - name: Install uv
120
+ uses: astral-sh/setup-uv@v6
121
+ with:
122
+ enable-cache: true
123
+
124
+ - name: Install dependencies
125
+ run: uv sync --group docs
126
+
127
+ - name: Attempt docs build
128
+ working-directory: ./docs
129
+ run: source ../.venv/bin/activate && make html
@@ -0,0 +1,102 @@
1
+ # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2
+ name: Publish Python distribution to PyPI
3
+
4
+ on:
5
+ release:
6
+ types: [created]
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.x"
21
+ - name: Install pypa/build
22
+ run: >-
23
+ python3 -m
24
+ pip install
25
+ build
26
+ --user
27
+ - name: Build a binary wheel and a source tarball
28
+ run: python3 -m build
29
+ - name: Store the distribution packages
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: python-package-distributions
33
+ path: dist/
34
+ publish-to-pypi:
35
+ name: >-
36
+ Publish Python distribution to PyPI
37
+ needs:
38
+ - build
39
+ runs-on: ubuntu-latest
40
+ environment:
41
+ name: pypi
42
+ url: https://pypi.org/p/anyvar
43
+ permissions:
44
+ id-token: write # IMPORTANT: mandatory for trusted publishing
45
+ steps:
46
+ - name: Download all the dists
47
+ uses: actions/download-artifact@v4
48
+ with:
49
+ name: python-package-distributions
50
+ path: dist/
51
+ - name: Publish distribution to PyPI
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+
54
+ build-and-push-image:
55
+ # https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action
56
+ runs-on: ubuntu-latest
57
+
58
+ permissions:
59
+ contents: read
60
+ packages: write
61
+ attestations: write
62
+ id-token: write
63
+
64
+ env:
65
+ REGISTRY: ghcr.io
66
+ IMAGE_NAME: ${{ github.repository }}
67
+
68
+ steps:
69
+ - name: Checkout repository
70
+ uses: actions/checkout@v6
71
+
72
+ - name: Log in to GHCR
73
+ uses: docker/login-action@v3
74
+ with:
75
+ registry: ${{ env.REGISTRY }}
76
+ username: ${{ github.actor }}
77
+ password: ${{ secrets.GITHUB_TOKEN }}
78
+
79
+ - name: Extract metadata (tags, labels) for Docker
80
+ id: meta
81
+ uses: docker/metadata-action@v5
82
+ with:
83
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
84
+ tags: |
85
+ type=raw,value=latest,enable=${{ !github.event.release.prerelease }}
86
+ type=semver,pattern={{version}}
87
+
88
+ - name: Build and push Docker image
89
+ id: push
90
+ uses: docker/build-push-action@v6
91
+ with:
92
+ context: .
93
+ push: true
94
+ tags: ${{ steps.meta.outputs.tags }}
95
+ labels: ${{ steps.meta.outputs.labels }}
96
+
97
+ - name: Generate artifact attestation
98
+ uses: actions/attest-build-provenance@v3
99
+ with:
100
+ subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
101
+ subject-digest: ${{ steps.push.outputs.digest }}
102
+ push-to-registry: true
@@ -0,0 +1,11 @@
1
+ # https://github.com/actions/stale
2
+
3
+ name: 'Close stale issues and PRs'
4
+ on:
5
+ workflow_dispatch:
6
+ schedule:
7
+ - cron: '1 1 * * *'
8
+
9
+ jobs:
10
+ stale:
11
+ uses: biocommons/.github/.github/workflows/stale.yml@main
@@ -0,0 +1,131 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # IDEs and editors
7
+ .vscode/
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ *.DS_Store
19
+ eggs/
20
+ .eggs/
21
+ .idea/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Testing stuff and coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ anyvar-test.duckdb
55
+ tests/tmp_async_work_dir
56
+ tests/data/ncbi*
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # pyenv
84
+ .python-version
85
+
86
+ # celery beat schedule file
87
+ celerybeat-schedule
88
+
89
+ # SageMath parsed files
90
+ *.sage.py
91
+
92
+ # Environments
93
+ .env
94
+ .venv
95
+ env/
96
+ venv/
97
+ ENV/
98
+ env.bak/
99
+ venv.bak/
100
+
101
+ # Lockfiles
102
+ Pipfile.lock
103
+ uv.lock
104
+
105
+ # Spyder project settings
106
+ .spyderproject
107
+ .spyproject
108
+
109
+ # Rope project settings
110
+ .ropeproject
111
+
112
+ # mkdocs documentation
113
+ /site
114
+
115
+ # mypy
116
+ .mypy_cache/
117
+ *~
118
+ *.orig
119
+ archive
120
+
121
+ # local dev tooling
122
+ .justfile
123
+
124
+ docker/data*
125
+
126
+ # logging configs
127
+ logging.yaml
128
+
129
+ # test data stuff
130
+ tests/data/ncbi_lrg_refseqgene
131
+ tests/data/ncbi_mane_summary
@@ -0,0 +1,31 @@
1
+ exclude: ^tests/data/ucsc-chainfile/
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0 # pre-commit-hooks version
6
+ hooks:
7
+ - id: detect-aws-credentials
8
+ args: [ --allow-missing-credentials ]
9
+ - repo: builtin
10
+ hooks:
11
+ - id: trailing-whitespace
12
+ - id: check-added-large-files
13
+ args: ['--maxkb=1500']
14
+ - id: check-case-conflict
15
+ - id: end-of-file-fixer
16
+ exclude: "^docs/source/_templates/.*\\.rst"
17
+ - id: fix-byte-order-marker
18
+ - id: check-json
19
+ - id: check-toml
20
+ - id: check-yaml
21
+ - id: mixed-line-ending
22
+ args: [ --fix=lf ]
23
+ - id: check-merge-conflict
24
+ - id: detect-private-key
25
+ - repo: https://github.com/astral-sh/ruff-pre-commit
26
+ rev: v0.12.8 # ruff version
27
+ hooks:
28
+ - id: ruff-format
29
+ - id: ruff-check
30
+ args: [ --fix, --exit-non-zero-on-fix ]
31
+ minimum_prek_version: 0.2.23