Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
297 commits
Select commit Hold shift + click to select a range
a8aaa68
Move tests directory
Mar 17, 2022
1a80674
update some uuids for testing
Mar 17, 2022
7817d44
Merge pull request #7 from Ensembl/make_nicer_inputs
alisha17 Mar 17, 2022
d93e03d
update gitlab ci file
Mar 21, 2022
da02515
update gitlab ci file
Mar 21, 2022
565920c
Update gitlab ci
Mar 22, 2022
42bed4d
Merge pull request #8 from Ensembl/gitlab_ci
alisha17 Mar 22, 2022
991799e
update env vars
Apr 1, 2022
8c5a70b
Update gitlab yml
Apr 1, 2022
11ce9ca
Merge pull request #9 from Ensembl/update_env_vars
alisha17 Apr 1, 2022
2443297
update gitlab ci for prod env
alisha17 May 9, 2022
6875c5c
add changes for testing pipeline
alisha17 May 10, 2022
7cf1623
add changes
alisha17 May 12, 2022
36115a7
Merge branch 'main' into add_production_config
alisha17 May 12, 2022
59635b1
Remove scientific_parlance_name and add default ncbi_common_name
ahc87 Jun 22, 2022
0767f21
Merge pull request #10 from Ensembl/add_production_config
marcoooo Jun 22, 2022
0409658
Restore scientific_parlance_name in tests
ahc87 Jun 23, 2022
dff56cf
Merge pull request #11 from Ensembl/get-tests-working
marcoooo Jun 23, 2022
231a3c2
:construction: Push initial changes which are returning interesting r…
bilalebi Jul 20, 2022
0ec78c9
:construction: removed datasets_obj name level
bilalebi Jul 21, 2022
ca78973
:construction: fixed sql query and switched to Struct for dynamic fields
bilalebi Jul 21, 2022
6703795
:sparkles: add release version
bilalebi Jul 21, 2022
9d2b889
:pencil: remove comment
bilalebi Jul 21, 2022
224c3f5
:pencil: add genome_uuid to where statement
bilalebi Jul 25, 2022
b2fa1ba
Add RPC method for getting datasets of a given type
ahc87 Jul 25, 2022
0274491
Check for null data when creating dataset info
ahc87 Jul 25, 2022
da06e0c
:pencil: apply review suggestions
bilalebi Jul 25, 2022
a4dac37
:pencil: commit the auto-generated changes to the pb2 files
bilalebi Jul 25, 2022
e15b749
Change method name in client_examples
ahc87 Jul 26, 2022
a138c62
:recycle: replace struct with nested message to get a cleaner response
bilalebi Jul 27, 2022
37b8fba
:white_check_mark: add tests
bilalebi Jul 28, 2022
f02f6e3
Merge pull request #13 from Ensembl/datasets_by_genomeid
marcoooo Aug 12, 2022
7cd5526
Merge branch 'main' into feat/get_datasets_list
bilalebi Aug 17, 2022
1935705
:recycle: regenerate the proper pb2 files after fixing merge conflicts
bilalebi Aug 17, 2022
42f8a21
:pencil: fix typo
bilalebi Aug 17, 2022
a9b1fd7
:test_tube: fix broken test and edit README
bilalebi Aug 17, 2022
0e0d9bd
Add directories so that protos directory mirrors src
ahc87 Aug 18, 2022
28bc0c8
Add comment explaining importance of protos directory structure
ahc87 Aug 18, 2022
6bb1337
Merge pull request #14 from Ensembl/import_fix
marcoooo Aug 18, 2022
9618476
:recycle: remove duplicated dataset objects
bilalebi Aug 18, 2022
3dddabd
:twisted_rightwards_arrows: fix merge conflicts
bilalebi Aug 19, 2022
b1cf509
:pencil: update readme and pb2 files
bilalebi Aug 22, 2022
c975a6f
:test_tube: fix broken test
bilalebi Aug 22, 2022
eaf7114
Genome search by keyword (#15)
ahc87 Sep 1, 2022
36b08e9
Add rpc method to get genomes from assembly accesion id
ahc87 Sep 1, 2022
89cee7c
Merge branch 'main' into feat/get_datasets_list
bilalebi Sep 1, 2022
8b3f4df
:pencil: convert release to float/double
bilalebi Sep 5, 2022
96ca5f2
Merge pull request #12 from Ensembl/feat/get_datasets_list
marcoooo Sep 21, 2022
d796f32
Merge branch 'main' into genomes_from_assembly_git_simplified
ahc87 Sep 21, 2022
c487781
Merge pull request #16 from Ensembl/genomes_from_assembly_git_simplified
marcoooo Sep 21, 2022
1c3234f
Remove duplicate GetGenomesByAssemblyAccessionID method
ahc87 Sep 26, 2022
e6f5be4
Merge pull request #17 from Ensembl/deduplicate_methods
marcoooo Sep 27, 2022
24c333f
2023 copyright update
marcoooo Jan 5, 2023
d4bacc2
Merge pull request #18 from Ensembl/bau/copyright-2023
marcoooo Jan 6, 2023
c221ebd
concise db envs to single mysql uri
vinay-ebi Feb 18, 2023
cdea29a
Merge pull request #19 from Ensembl/feature/config_metadata_uri
marcoooo Feb 21, 2023
904463f
Add ensembl_name to keyword search
Mar 28, 2023
25e23c4
Add Assembly ensembl name
Mar 29, 2023
5c9d5b3
Merge pull request #20 from Ensembl/search_ensembl_name
marcoooo Mar 29, 2023
4615a90
Update setup.py
marcoooo Mar 29, 2023
f792efd
Update VERSION
marcoooo Mar 29, 2023
41b30f9
Update setup.py
marcoooo Mar 29, 2023
21d5f6c
Merge pull request #21 from Ensembl/features/python-packaging-from-gi…
marcoooo Mar 30, 2023
b074e32
Added LICENCE comments and moved tests under expected src/tests path
marcoooo Jun 8, 2023
49cb36f
Refactored tests to use latest schema updates.
marcoooo Jun 8, 2023
482df2a
Updated setup import and removed print statement
marcoooo Jun 8, 2023
e61d0c8
Updated default DB uris.
marcoooo Jun 9, 2023
e442e32
Updated includes to build library.
marcoooo Jun 12, 2023
371e278
Tests run from metadata-api sample DB.
marcoooo Jun 14, 2023
fa6286f
Fixed the never ending part! Was due to wrong usage of session in cod…
marcoooo Jun 14, 2023
1c6db0a
Missing `conftest.py` !
marcoooo Jun 14, 2023
9de4c14
Added required params for travis now!
marcoooo Jun 14, 2023
2c54cfa
Integrated latest service from https://github.com/Ensembl/ensembl-met…
marcoooo Jun 20, 2023
0763f5c
Fixed ordering future issue with newer MySQL db version (order fields…
marcoooo Jun 20, 2023
2fead99
updated target VERSION
marcoooo Jun 20, 2023
772b184
Merge pull request #22 from Ensembl/features/updated-schema
marcoooo Jun 20, 2023
ebe385a
add getByGenomeUUID methods
bilalebi Jun 21, 2023
65f7b72
switch to use metadata api instead of sqlalchemy when getting genome_…
bilalebi Jul 3, 2023
5ec2c62
fix typo
bilalebi Jul 3, 2023
fe5918d
fix broken client_examples
bilalebi Jul 3, 2023
1e757eb
start replacing sqlalchemy with metadata api
bilalebi Jul 10, 2023
aa77fa7
refactor get_datasets_list_by_uuid and populate_dataset_info to use api
bilalebi Jul 11, 2023
18dd110
refactor dataset related code
bilalebi Jul 11, 2023
2c6eb69
refactor statistics and assembly info
bilalebi Jul 12, 2023
e072ee9
refactor get_species and sub_species info
bilalebi Jul 13, 2023
5f6cfde
remove Grouping as it's identical to SubSpecies
bilalebi Jul 13, 2023
bf7d477
replace organism_id with organism_uuid, remove grouping left over code
bilalebi Jul 13, 2023
55a10fe
refactor get_genomes_by_keyword
bilalebi Jul 13, 2023
b595dd2
replace load_database() with connect_to_db()
bilalebi Jul 14, 2023
0021cb2
restructure the code and split service.py file
bilalebi Jul 14, 2023
9f9deee
Update Readme and tests
bilalebi Jul 19, 2023
1ae698a
Reverse get_genome_uuid() to use sqlalchemy instead of the API
bilalebi Jul 19, 2023
6b997ee
fix broken test
bilalebi Jul 19, 2023
b97e565
Merge pull request #24 from Ensembl/feat/get_genome_uuid
bilalebi Jul 24, 2023
9d020b2
fix 22 tests out of 29
bilalebi Jul 27, 2023
f4be910
fix test_create_.. functions
bilalebi Jul 27, 2023
e8de030
fix travis
bilalebi Jul 27, 2023
60e45ea
split test file
bilalebi Jul 27, 2023
696ab90
set this branch to depend on ensembl-metadata-api.git@feat/ftch_gnome…
bilalebi Jul 27, 2023
adccfd4
fix more broken tests
bilalebi Jul 27, 2023
2d61e88
fix merge conflicts
bilalebi Jul 27, 2023
b98c9bf
remove fixtures duplication
bilalebi Jul 28, 2023
4f070a8
add GetGenomeAssemblySequence endpoint
bilalebi Jul 31, 2023
2affdf1
add fetch genome_assembly_sequence_region by assembly_sequence_accession
bilalebi Aug 2, 2023
6e71262
add use_default to get_genome_uuid() with tests and examples
bilalebi Aug 8, 2023
79029c0
Pytest verbose
Aug 14, 2023
3442209
Longer travis build
Aug 14, 2023
48d2303
Revert to previous setting
Aug 16, 2023
cff097f
Remove problamatic test
Aug 16, 2023
f40ce05
Merge pull request #27 from Ensembl/hotfix/add_assembly_default
bilalebi Aug 29, 2023
28c9c4d
:twisted_rightwards_arrows: fix merge conflicts
bilalebi Sep 5, 2023
a35f0f4
update servicer, proto, utils and client example to reflect the schem…
bilalebi Sep 11, 2023
bb88d41
fix broken tests
bilalebi Sep 11, 2023
81a5742
delete unnecessary init files
bilalebi Sep 11, 2023
c1d4be5
fix travis tests
bilalebi Sep 11, 2023
d0a3a42
fix last travis test
bilalebi Sep 11, 2023
d0b0baa
fix last travis test (another try)
bilalebi Sep 11, 2023
b5d73d3
:twisted_rightwards_arrows: fix merge conflicts
bilalebi Sep 11, 2023
61d2135
fix broken tests
bilalebi Sep 11, 2023
9b483c4
add the possibility to fetch genome uuid using default_assembly name …
bilalebi Sep 12, 2023
5e6ca8e
Merge branch 'chore/switch_to_md_api' into feat/get_region_info
bilalebi Sep 12, 2023
1e3e03a
point ensembl-metadata-api to main branch
bilalebi Sep 13, 2023
143876c
push initial working example
bilalebi Sep 13, 2023
f4ee615
expand OrganismsGroup
bilalebi Sep 13, 2023
a657b46
add tests
bilalebi Sep 14, 2023
aa461e1
fetch unreleased data only if required internally
bilalebi Sep 18, 2023
dd6acc1
Merge pull request #25 from Ensembl/chore/switch_to_md_api
marcoooo Sep 19, 2023
eea9fcc
add release_version to the request and response
bilalebi Sep 19, 2023
6a02551
fix client_examples
bilalebi Sep 19, 2023
0fb1684
Merge pull request #29 from Ensembl/feat/popular_organism_grpc
bilalebi Sep 20, 2023
5bde08f
add client examples, fix broken tests, update config
bilalebi Sep 20, 2023
957c218
fix tests (remember to reverse back meatadata-api to main before merg…
bilalebi Sep 21, 2023
8e67f87
point requirement.txt to metadata-api main branch
bilalebi Sep 21, 2023
77a0e13
Merge pull request #30 from Ensembl/hotfix/update_unreleased_logic
marcoooo Sep 22, 2023
2bddb35
Update VERSION
marcoooo Sep 22, 2023
fdd62f6
Update VERSION
marcoooo Sep 22, 2023
454289b
Merge branch 'chore/switch_to_md_api' into hotfix/fix_build_pipline
bilalebi Sep 22, 2023
9f16003
update requirments.in using pip-tools
bilalebi Sep 22, 2023
16fbed5
pip compile with python 3.8
bilalebi Sep 22, 2023
2106ef7
Merge pull request #31 from Ensembl/hotfix/fix_build_pipline
marcoooo Sep 22, 2023
4fe34c0
:twisted_rightwards_arrows: fix merge conflicts with main
bilalebi Sep 25, 2023
d8725c8
turn off allow_unreleased
bilalebi Sep 26, 2023
ca46f34
[WIP] initial draft of GetInfoByAssemblyUUID, refactor protobuf_msg_f…
bilalebi Sep 29, 2023
c7d895d
fix client examples and broken tests
bilalebi Oct 2, 2023
1fce5a6
fix broken test
bilalebi Oct 2, 2023
180a073
get genome uuid using default assembly only (without the need for ens…
bilalebi Oct 2, 2023
c33ac7d
add related_assemblies_count and client example
bilalebi Oct 3, 2023
698cdb7
add release and fix broken tests
bilalebi Oct 3, 2023
24518fd
add tests
bilalebi Oct 3, 2023
0b3c828
Updated Dockerfile
marcoooo Oct 3, 2023
f8348dd
Merge pull request #32 from Ensembl/feat/get_guuid_using_assm_default…
marcoooo Oct 4, 2023
de83e5e
Merge pull request #34 from Ensembl/hotfix/docker-build
bilalebi Oct 4, 2023
d083cad
improve and refactore get_genome_uuid tests
bilalebi Oct 4, 2023
d920ea7
update metadata api dependency tag
bilalebi Oct 4, 2023
dfaea50
fix broken test
bilalebi Oct 4, 2023
f2e8614
remove assembly_accession, unint64 lenght and fix broken tests
bilalebi Oct 5, 2023
6419ef4
fix broken tests
bilalebi Oct 5, 2023
30c7478
Merge pull request #35 from Ensembl/test/improve_get_genome_uuid_tests
bilalebi Oct 6, 2023
ecc0f2b
Merge pull request #26 from Ensembl/feat/get_region_info
bilalebi Oct 9, 2023
76a33df
:twisted_rightwards_arrows: fix merge conflicts with main
bilalebi Oct 10, 2023
b944394
update pb2 script
bilalebi Oct 10, 2023
afd0944
Fix examples and update api dependancy tag (#36)
bilalebi Oct 10, 2023
676b443
:twisted_rightwards_arrows: fix merge conflicts with main (region work)
bilalebi Oct 10, 2023
dc0ab60
:recycle: switch to use genome_uuid instead of assembly_uuid and refa…
bilalebi Oct 10, 2023
b762101
[WIP] fix some broken tests, remove unnecessary code
bilalebi Oct 11, 2023
d1a02d5
[WIP] fix more broken tests
bilalebi Oct 11, 2023
2a4b5f3
fix last tests
bilalebi Oct 11, 2023
69fc8d2
:recycle: code refactoring using create_genome_with_attributes_and_count
bilalebi Oct 11, 2023
870a904
fix and refactor tests
bilalebi Oct 11, 2023
9408597
fix one last test (hopefully)
bilalebi Oct 11, 2023
7f703da
reverse back the latest test fix
bilalebi Oct 11, 2023
afaa9fa
Merge pull request #33 from Ensembl/feat/get_detailed_genome_data
bilalebi Oct 11, 2023
af7d02a
add GetGenomeUUIDByTag endpoint
bilalebi Oct 11, 2023
46b9958
add tests
bilalebi Oct 12, 2023
b73e0f7
:twisted_rightwards_arrows: fix merge conflicts with main
bilalebi Oct 12, 2023
dc94e9a
improve the endpoint respoonse and add tests
bilalebi Oct 13, 2023
f70fc3b
Update api tag and repo version
bilalebi Oct 13, 2023
4594a58
fix stats tests
bilalebi Oct 13, 2023
48148c1
fix broken test and upgrade repo version
bilalebi Oct 13, 2023
0296532
tiny test fix
bilalebi Oct 13, 2023
1fb1f69
Moved GenomeAdaptor to its final destination. Avoiding updates in bot…
marcoooo Oct 17, 2023
b80379f
Updated dependency to latest ensembl-py / ensembl-metadata-api
marcoooo Oct 17, 2023
46b31b9
Updated dependency to latest ensembl-py / ensembl-metadata-api
marcoooo Oct 17, 2023
591efa0
Ordered query to fetch genomes
marcoooo Oct 17, 2023
7a87c21
Ordered query to fetch genomes datasets now
marcoooo Oct 17, 2023
10e01ac
Merge pull request #37 from Ensembl/feat/genome_uuid_by_tag
marcoooo Oct 17, 2023
d16daa2
Merge branch 'main' into fix/get_stats_by_organism_uuid
marcoooo Oct 17, 2023
770d37d
Merge remote-tracking branch 'origin/fix/get_stats_by_organism_uuid' …
marcoooo Oct 17, 2023
c37401e
Merged back merge conflicts from https://github.com/Ensembl/ensembl-m…
marcoooo Oct 17, 2023
d5344fc
Merge pull request #39 from Ensembl/features/genome-adaptor
bilalebi Oct 17, 2023
9ea8743
add 4 extra fields to the response
bilalebi Oct 17, 2023
aec027f
update ensembl_metadata_pb2
bilalebi Oct 18, 2023
70bd2cf
fix broken tests
bilalebi Oct 18, 2023
c57a243
replace annotation.* with genebuild.*
bilalebi Oct 18, 2023
8008b18
Merge pull request #40 from Ensembl/feat/genome_uuid_extra_fields
bilalebi Oct 20, 2023
926f94b
revert VERSION for it to be aligned with the latest release number
bilalebi Oct 20, 2023
fd491d5
Merge pull request #41 from Ensembl/revert_version
marcoooo Oct 20, 2023
6ca4478
remove redundant Karyotype endpoint (GetGenomeAssemblySequence does t…
bilalebi Oct 23, 2023
75fedf8
remove chromosomal_only from GenomeAssemblySequenceRegionRequest
bilalebi Oct 23, 2023
c1ac67d
rename GetGenomeAssemblySequence to GetAssemblyRegions
bilalebi Oct 23, 2023
caebda8
fix broken test
bilalebi Oct 23, 2023
1530bcc
singularize AssemblyRegions and improve imports
bilalebi Oct 27, 2023
e50106b
Merge pull request #42 from Ensembl/chore/code_cleanup
bilalebi Oct 30, 2023
28147fa
add get_common_name
bilalebi Oct 30, 2023
328a2da
fix broken tests
bilalebi Oct 30, 2023
6bf7956
fix one more test and remove duplicates
bilalebi Oct 30, 2023
3bc5a36
fix broken tests cansed by sorting (it's a whack a mole game)
bilalebi Oct 30, 2023
99bebe5
rename common_name to alternative_names to avoid confusions with orga…
bilalebi Oct 31, 2023
cf4c892
add missing param
bilalebi Nov 2, 2023
e87599e
add genebuild_method_display
bilalebi Nov 2, 2023
0ff79e6
replace sample prefix for gene and location with genebuild
bilalebi Nov 2, 2023
06e5c7d
add variation.sample_variant
bilalebi Nov 2, 2023
f17c45b
Merge pull request #44 from Ensembl/hotfix/missing_attrib_values
bilalebi Nov 2, 2023
5f860a0
fix related assemblies count check
bilalebi Nov 8, 2023
37051be
fix a bug where thoas gRPC query returns unreleased data
bilalebi Nov 8, 2023
6048436
:twisted_rightwards_arrows: fix merge conflicts with main
bilalebi Nov 8, 2023
d5870a9
[WIP] add fetch_related_assemblies_count
bilalebi Nov 9, 2023
fe43469
add tests
bilalebi Nov 9, 2023
6fdcd84
remove prints
bilalebi Nov 9, 2023
bc653ad
remove plural
bilalebi Nov 9, 2023
59fcb87
Merge pull request #43 from Ensembl/fix/taxon_common_name
bilalebi Nov 9, 2023
4118fe8
apply PR suggestion and improve tests
bilalebi Nov 10, 2023
5bce364
Updated field for sha512 typo
marcoooo Nov 10, 2023
d26df8d
Removed copy/paste in travis.
marcoooo Nov 10, 2023
bec0494
Merge branch 'main' into fix_related_assemblies_count
marcoooo Nov 10, 2023
fb244ae
Reimported lost `alternative_names` -> `common_names` (fixed typo wit…
marcoooo Nov 10, 2023
5a75054
Removed extra common_names from code.
marcoooo Nov 10, 2023
35da52e
Removed extra common_names from code.
marcoooo Nov 10, 2023
bc35f4f
Fixed tests
marcoooo Nov 10, 2023
bf422ed
Revert to commits presents in `main` branch and related to PR https:/…
marcoooo Nov 13, 2023
799b0ca
Removed extra print from tests.
marcoooo Nov 13, 2023
878d218
Merge pull request #45 from Ensembl/fix_related_assemblies_count
marcoooo Nov 14, 2023
9da703c
:bug: fix alternative_names containing None and add tests
bilalebi Nov 22, 2023
e3dbd0d
Merge pull request #46 from Ensembl/hotfix/alternative_names
bilalebi Nov 22, 2023
c103c83
updated dependencies to retrieve what's new from ensembl-py.
marcoooo Dec 5, 2023
d56e169
changed to version.
marcoooo Dec 5, 2023
ae650d9
Merge pull request #47 from Ensembl/bugfixes/lost-mysql-connection
marcoooo Dec 5, 2023
cd849c8
fix genome query
bilalebi Dec 12, 2023
a3570d8
fix broken tests
bilalebi Dec 12, 2023
0678f73
remove print statement
bilalebi Dec 12, 2023
69564c7
updated requirements on metadata-api version.
marcoooo Dec 13, 2023
7faab38
updated tests.
marcoooo Dec 13, 2023
8760894
Merge pull request #48 from Ensembl/hotfix/optimize_genome_query
bilalebi Dec 13, 2023
033ca68
updated deps to released.
marcoooo Dec 13, 2023
86ca999
Merge pull request #49 from Ensembl/features/api-1-3-3
marcoooo Dec 14, 2023
6193df1
Merged Conflicts from github repositories updates
marcoooo Jan 18, 2024
81e902b
updated test_grpc because of added dataset in tests data
marcoooo Jan 18, 2024
8784902
Removed extra backslash in VERSION file
marcoooo Jan 18, 2024
7d9b650
Merge branch 'main' into features/merge-services
marcoooo Jan 18, 2024
2444b4e
Added dockerignore standard file
marcoooo Jan 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,4 @@ dmypy.json

# Cython debug symbols
cython_debug/
.python-version
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.8.15-alpine
# Package
RUN apk update && apk add --no-cache git mariadb-dev build-base

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN mkdir -p /usr/src/app
RUN chown -R appuser:appgroup /usr/src/app/

USER appuser
WORKDIR /usr/src/app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PIP_ROOT_USER_ACTION=ignore

COPY --chown=appuser:appgroup . /usr/src/app/
ENV PATH="/usr/src/app/venv/bin:$PATH"

RUN python -m venv /usr/src/app/venv/
RUN pip install --upgrade pip
RUN pip install .
RUN pip uninstall -y ensembl-hive

CMD ["/usr/src/app/venv/bin/python", "/usr/src/app/src/ensembl/production/metadata/grpc/service.py"]
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include LICENSE
include NOTICE
include VERSION
recursive-include src/ensembl/production/metadata/api/sample/ *
recursive-include src/ensembl/production/metadata/api/sample/ *
include README.md
include requirements.txt
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ensembl Metadata API
Ensembl Metadata API/Services
Copyright [2018-2023] EMBL-European Bioinformatics Institute

This product includes software developed at:
Expand Down
81 changes: 74 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Ensembl Metadata API
<<<<<<< HEAD
# Ensembl Metadata API / GRPC API
# SQLAlchemy ORM for the Ensembl Metadata database.
# GRPC Service protofile to interact with metadata database through GRPC

[![Build Status](https://travis-ci.com/Ensembl/ensembl-metadata-api.svg?branch=main)](https://travis-ci.com/Ensembl/ensembl-metadata-api)

SQLAlchemy ORM for the Ensembl Metadata database.

## System Requirements

- Python 3.8+
Expand Down Expand Up @@ -32,10 +33,6 @@ pip install -r requirements.txt

[ensembl-metadata-admin](https://github.com/Ensembl/ensembl-metadata-admin): Django ORM for the Ensembl Metadata database

[ensembl-metadata-registry](https://github.com/Ensembl/ensembl-metadata-registry): GUI for the Ensembl Metadata database

[ensembl-metadata-service](https://github.com/Ensembl/ensembl-metadata-service): gRPC layer for the Ensembl Metadata database


## Development

Expand All @@ -59,6 +56,24 @@ pip install --upgrade pip
pip install -r requirements-dev.txt
```

=======
To generate client and server files
(Remember to run these after adding a new method in ensembl_metadata.proto)
```
python3 -m grpc_tools.protoc -Iprotos --python_out=src --grpc_python_out=src protos/ensembl/production/metadata/grpc/ensembl_metadata.proto
```

Start the server script

```
PYTHONPATH='src' python3 src/ensembl/production/metadata/grpc/service.py
```

Start the client script
```
PYTHONPATH='src' python3 src/ensembl/production/metadata/grpc/client_examples.py
```

### Testing

Run test suite:
Expand All @@ -78,6 +93,41 @@ To actually reformat all files contained in `src`:
```
cd ensembl-metadata-api
black src
PYTHONPATH='src' pytest
```

To run tests, calculate and display testing coverage stats:
```
cd ensembl-metadata-api
coverage run -m pytest
coverage report -m
```

#### Explore test DB content

As for now, some of the test DB sqlite content is different from what's in MySQL metadata DB (e.g. release `version` in `ensembl_release`)

> `test.db` created when running tests is deleted once tests are executed.

To take a look at the test data you can create a temporary `sampledb.db` importing `tables.sql` content using the command:

```
cat tables.sql | sqlite3 sampledb.db
```

You can then open `sampledb.db` using [DB Browser for SQLite](https://sqlitebrowser.org/dl/).

### Automatic Formatting
```
cd ensembl-metadata-api
black --check src tests
```
Use `--diff` to print a diff of what Black would change, without actually changing the files.

To actually reformat all files contained in `src` and `test`:
```
cd ensembl-metadata-api
black src tests
```

### Linting and type checking
Expand All @@ -88,3 +138,20 @@ mypy src
```
Pylint will check the code for syntax, name errors and formatting style.
Mypy will use type hints to statically type check the code.
=======
cd ensembl-metadata-service
pylint src tests
mypy src tests
```
Pylint will check the code for syntax, name errors and formatting style.
Mypy will use type hints to statically type check the code.

### To build docker image
```
docker build -t ensembl-metadata-service .
```

### To run docker container
```
docker run -t -i -e METADATA_URI=<URI> -e TAXONOMY_URI=<URI> -p 80:80 ensembl-metadata-service
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.4
2.0.0
29 changes: 27 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import logging
from pathlib import Path

import pytest
from _pytest.config import Config
import pytest
import sqlalchemy as db

from ensembl.production.metadata.grpc.adaptors.genome import GenomeAdaptor
from ensembl.production.metadata.grpc.adaptors.release import ReleaseAdaptor

pytest_plugins = ("ensembl.plugins.pytest_unittest",)


def pytest_configure(config: Config) -> None:
pytest.dbs_dir = Path(__file__).parent / 'src' / 'ensembl' / 'production' / 'metadata' / 'api' / 'sample'

@pytest.fixture(scope="class")
def engine(multi_dbs):
os.environ["METADATA_URI"] = multi_dbs["ensembl_metadata"].dbc.url
os.environ["TAXONOMY_URI"] = multi_dbs["ncbi_taxonomy"].dbc.url
yield db.create_engine(multi_dbs["ensembl_metadata"].dbc.url)


@pytest.fixture(scope="class")
def genome_db_conn(multi_dbs):
genome_conn = GenomeAdaptor(
metadata_uri=multi_dbs["ensembl_metadata"].dbc.url,
taxonomy_uri=multi_dbs["ncbi_taxonomy"].dbc.url
)
yield genome_conn


@pytest.fixture(scope="class")
def release_db_conn(multi_dbs):
release_conn = ReleaseAdaptor(
metadata_uri=multi_dbs["ensembl_metadata"].dbc.url
)
yield release_conn
Loading