ensembl-py 2.0.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 (41) hide show
  1. ensembl_py-2.0.1/.github/actions/python_build/action.yml +41 -0
  2. ensembl_py-2.0.1/.github/dependabot.yml +25 -0
  3. ensembl_py-2.0.1/.github/workflows/ci.yml +41 -0
  4. ensembl_py-2.0.1/.github/workflows/ci_dev.yml +32 -0
  5. ensembl_py-2.0.1/.github/workflows/notice.yml +37 -0
  6. ensembl_py-2.0.1/.github/workflows/publish.yml +77 -0
  7. ensembl_py-2.0.1/.github/workflows/python_ci.yml +105 -0
  8. ensembl_py-2.0.1/.gitignore +142 -0
  9. ensembl_py-2.0.1/.licenserc.yml +26 -0
  10. ensembl_py-2.0.1/LICENSE +201 -0
  11. ensembl_py-2.0.1/NOTICE +5 -0
  12. ensembl_py-2.0.1/PKG-INFO +154 -0
  13. ensembl_py-2.0.1/README.md +92 -0
  14. ensembl_py-2.0.1/docs/code_of_conduct.md +8 -0
  15. ensembl_py-2.0.1/docs/img/ebang.png +0 -0
  16. ensembl_py-2.0.1/docs/index.md +14 -0
  17. ensembl_py-2.0.1/docs/install.md +30 -0
  18. ensembl_py-2.0.1/docs/scripts/gen_ref_pages.py +46 -0
  19. ensembl_py-2.0.1/docs/stylesheets/extra.css +27 -0
  20. ensembl_py-2.0.1/mkdocs.yml +80 -0
  21. ensembl_py-2.0.1/pyproject.toml +169 -0
  22. ensembl_py-2.0.1/setup.cfg +7 -0
  23. ensembl_py-2.0.1/setup.py +19 -0
  24. ensembl_py-2.0.1/src/python/ensembl/core/__init__.py +13 -0
  25. ensembl_py-2.0.1/src/python/ensembl/core/models.py +1957 -0
  26. ensembl_py-2.0.1/src/python/ensembl/ncbi_taxonomy/__init__.py +14 -0
  27. ensembl_py-2.0.1/src/python/ensembl/ncbi_taxonomy/api/__init__.py +16 -0
  28. ensembl_py-2.0.1/src/python/ensembl/ncbi_taxonomy/api/utils.py +254 -0
  29. ensembl_py-2.0.1/src/python/ensembl/ncbi_taxonomy/models.py +70 -0
  30. ensembl_py-2.0.1/src/python/ensembl/xrefs/xref_source_db_model.py +56 -0
  31. ensembl_py-2.0.1/src/python/ensembl/xrefs/xref_update_db_model.py +411 -0
  32. ensembl_py-2.0.1/src/python/ensembl_py.egg-info/PKG-INFO +154 -0
  33. ensembl_py-2.0.1/src/python/ensembl_py.egg-info/SOURCES.txt +40 -0
  34. ensembl_py-2.0.1/src/python/ensembl_py.egg-info/dependency_links.txt +1 -0
  35. ensembl_py-2.0.1/src/python/ensembl_py.egg-info/requires.txt +39 -0
  36. ensembl_py-2.0.1/src/python/ensembl_py.egg-info/top_level.txt +1 -0
  37. ensembl_py-2.0.1/src/python/tests/conftest.py +21 -0
  38. ensembl_py-2.0.1/src/python/tests/ncbi_taxonomy/test_ncbi_taxonomy/ncbi_db/ncbi_taxa_name.txt +1154 -0
  39. ensembl_py-2.0.1/src/python/tests/ncbi_taxonomy/test_ncbi_taxonomy/ncbi_db/ncbi_taxa_node.txt +382 -0
  40. ensembl_py-2.0.1/src/python/tests/ncbi_taxonomy/test_ncbi_taxonomy/ncbi_db/table.sql +23 -0
  41. ensembl_py-2.0.1/src/python/tests/ncbi_taxonomy/test_ncbi_taxonomy.py +519 -0
@@ -0,0 +1,41 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: python-build
17
+ description: "Common steps to build the Python environment"
18
+ inputs:
19
+ python-version:
20
+ description: "Python version"
21
+ required: true
22
+ default: "3.10"
23
+ tags:
24
+ description: "Optional dependencies (via available tags) to install, e.g. [cicd]"
25
+ required: true
26
+ default: ""
27
+
28
+ runs:
29
+ using: "composite"
30
+ steps:
31
+ - name: Set up Python ${{ inputs.python-version }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ inputs.python-version }}
35
+ cache: 'pip'
36
+
37
+ - name: Install dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ pip install -e .${{ inputs.tags }}
41
+ shell: bash
@@ -0,0 +1,25 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # To get started with Dependabot version updates, you'll need to specify which
16
+ # package ecosystems to update and where the package manifests are located.
17
+ # Please see the documentation for all configuration options:
18
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
19
+
20
+ version: 2
21
+ updates:
22
+ - package-ecosystem: "pip"
23
+ directory: "/"
24
+ schedule:
25
+ interval: "monthly"
@@ -0,0 +1,41 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: "CI"
17
+
18
+ on:
19
+ push:
20
+ branches:
21
+ - main
22
+ pull_request:
23
+
24
+ jobs:
25
+ license_check:
26
+ name: Check missing license headers
27
+ runs-on: ubuntu-latest
28
+
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+
32
+ - name: Check license header
33
+ uses: apache/skywalking-eyes/header@v0.6.0
34
+ with:
35
+ config: .licenserc.yml
36
+
37
+ python_ci:
38
+ name: Python CI
39
+ uses: ./.github/workflows/python_ci.yml
40
+ with:
41
+ python-version: "3.10"
@@ -0,0 +1,32 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: "CI (dev)"
17
+ run-name: Run CI for Python ${{ inputs.python-version }} by @${{ github.actor }}
18
+
19
+ on:
20
+ workflow_dispatch:
21
+ inputs:
22
+ python-version:
23
+ description: Python version
24
+ required: true
25
+ type: string
26
+
27
+ jobs:
28
+ python_ci:
29
+ name: Python CI
30
+ uses: ./.github/workflows/python_ci.yml
31
+ with:
32
+ python-version: ${{ inputs.python-version }}
@@ -0,0 +1,37 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: "Update NOTICE copyright year at the start of every year"
17
+
18
+ on:
19
+ schedule:
20
+ - cron: '15 15 1 1 *'
21
+
22
+ jobs:
23
+ notice_update:
24
+ name: Update NOTICE copyright year
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - name: Update NOTICE file
31
+ run: |
32
+ sed -i "s/$(date +%Y --date='1 year ago')/$(date +%Y)/" NOTICE
33
+
34
+ - uses: EndBug/add-and-commit@v9
35
+ with:
36
+ add: 'NOTICE'
37
+ message: 'Update NOTICE copyright year'
@@ -0,0 +1,77 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: Upload Python package to PyPI when a release is created
17
+
18
+ on:
19
+ release:
20
+ types: [created]
21
+
22
+ defaults:
23
+ run:
24
+ working-directory: ./
25
+
26
+ env:
27
+ PYTHON_VERSION: "3.10"
28
+
29
+ jobs:
30
+ mkdocs:
31
+ name: Deploy documentation to GitHub Pages
32
+ runs-on: ubuntu-latest
33
+ permissions:
34
+ contents: write
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - uses: ./.github/actions/python_build
40
+ with:
41
+ python-version: ${{ env.PYTHON_VERSION }}
42
+ tags: "[cicd,docs]"
43
+
44
+ - name: Generate coverage report
45
+ run: |
46
+ coverage run -m pytest
47
+ coverage html -d ./reports/htmlcov
48
+ coverage xml -o ./reports/coverage.xml
49
+ genbadge coverage -i ./reports/coverage.xml -o ./reports/htmlcov/coverage-badge.svg
50
+
51
+ - name: Run mkdocs
52
+ run: |
53
+ mkdocs gh-deploy --force
54
+
55
+ pypi-publish:
56
+ name: Publish release to PyPI
57
+ runs-on: ubuntu-latest
58
+ environment:
59
+ name: pypi
60
+ url: https://pypi.org/p/ensembl-py
61
+ permissions:
62
+ id-token: write
63
+
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+
67
+ - uses: ./.github/actions/python_build
68
+ with:
69
+ python-version: ${{ env.PYTHON_VERSION }}
70
+ tags: "[build]"
71
+
72
+ - name: Build package
73
+ run: |
74
+ python -m build
75
+
76
+ - name: Publish package distributions to PyPI
77
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,105 @@
1
+ # See the NOTICE file distributed with this work for additional information
2
+ # regarding copyright ownership.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ name: "Python CI"
17
+
18
+ on:
19
+ workflow_call:
20
+ inputs:
21
+ python-version:
22
+ description: Python version to run the CI checks on
23
+ required: true
24
+ type: string
25
+
26
+ defaults:
27
+ run:
28
+ working-directory: ./
29
+
30
+ jobs:
31
+ pylint:
32
+ runs-on: ubuntu-latest
33
+
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - uses: ./.github/actions/python_build
38
+ with:
39
+ python-version: ${{ inputs.python-version }}
40
+ tags: "[cicd]"
41
+
42
+ - name: Run pylint
43
+ run: |
44
+ pylint --rcfile pyproject.toml src/python/ensembl
45
+ pylint --rcfile pyproject.toml src/python/tests
46
+
47
+ mypy:
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - uses: ./.github/actions/python_build
54
+ with:
55
+ python-version: ${{ inputs.python-version }}
56
+ tags: "[cicd]"
57
+
58
+ - name: Run mypy
59
+ run: |
60
+ mypy --config-file pyproject.toml src/python/ensembl
61
+ mypy --config-file pyproject.toml src/python/tests
62
+
63
+ black:
64
+ runs-on: ubuntu-latest
65
+
66
+ steps:
67
+ - uses: actions/checkout@v4
68
+
69
+ - uses: ./.github/actions/python_build
70
+ with:
71
+ python-version: ${{ inputs.python-version }}
72
+ tags: "[cicd]"
73
+
74
+ - name: Run black
75
+ run: |
76
+ black --config pyproject.toml --check .
77
+
78
+ pytest:
79
+ runs-on: ubuntu-latest
80
+ permissions:
81
+ contents: write
82
+ checks: write
83
+ pull-requests: write
84
+
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+
88
+ - uses: ./.github/actions/python_build
89
+ with:
90
+ python-version: ${{ inputs.python-version }}
91
+ tags: "[cicd]"
92
+
93
+ - name: Run pytest with coverage
94
+ run: |
95
+ coverage run -m pytest --junitxml=./reports/test_results.xml
96
+ coverage xml -o ./reports/coverage.xml
97
+ coverage report -m
98
+
99
+ - name: Add coverage reports
100
+ if: ${{ github.event_name == 'pull_request' }}
101
+ continue-on-error: true
102
+ uses: MishaKav/pytest-coverage-comment@main
103
+ with:
104
+ pytest-xml-coverage-path: ./reports/coverage.xml
105
+ junitxml-path: ./reports/test_results.xml
@@ -0,0 +1,142 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99
+ __pypackages__/
100
+
101
+ # Celery stuff
102
+ celerybeat-schedule
103
+ celerybeat.pid
104
+
105
+ # SageMath parsed files
106
+ *.sage.py
107
+
108
+ # Environments
109
+ .env
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # Rope project settings
122
+ .ropeproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
134
+
135
+ # pytype static type analyzer
136
+ .pytype/
137
+
138
+ # Cython debug symbols
139
+ cython_debug/
140
+
141
+ # ruff
142
+ .ruff_cache/
@@ -0,0 +1,26 @@
1
+ header:
2
+ license:
3
+ content: |
4
+ See the NOTICE file distributed with this work for additional information
5
+ regarding copyright ownership.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ paths-ignore:
20
+ - '**/*.md'
21
+ - 'src/python/tests/**/test_*/**/*'
22
+ - '.gitignore'
23
+ - 'LICENSE'
24
+ - 'NOTICE'
25
+
26
+ comment: on-failure