From 86c6c4e30f24f07f7e817be09bc96fc55fb635e6 Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Fri, 30 Apr 2021 09:37:40 +0200 Subject: [PATCH 1/4] cleanup --- .github/workflows/test.yml | 1 + docs/conf.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c4c873..0d09f06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,6 +46,7 @@ jobs: pypi: runs-on: ubuntu-latest + needs: [lint, py_test] name: Deploy release to Pypi steps: - name: Checkout diff --git a/docs/conf.py b/docs/conf.py index 69bbba3..ca65367 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,6 +5,8 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'chado')) +project = "Python-chado" + extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] master_doc = 'index' From 6f3106fa56bf69ff98a71d6f15f44415b6f781d4 Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Fri, 30 Apr 2021 09:41:42 +0200 Subject: [PATCH 2/4] fix has_table for recent sqlalchemy versions --- chado/load/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chado/load/__init__.py b/chado/load/__init__.py index e0b1c0a..8f0906a 100644 --- a/chado/load/__init__.py +++ b/chado/load/__init__.py @@ -21,7 +21,7 @@ from future import standard_library -from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table +from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table, inspect from sqlalchemy import exc as sa_exc standard_library.install_aliases() @@ -824,7 +824,7 @@ def _setup_tables(self, module): self.ci.create_cvterm(term='analysis_blast_output_iteration_hits', term_definition='Hits of a blast', cv_name='tripal', db_name='tripal') # Tables for blast added_table = False - if not self.engine.dialect.has_table(self.engine, 'tripal_analysis_blast', schema='public'): + if not inspect(self.engine).has_table(self.engine, 'tripal_analysis_blast', schema='public'): tripal_analysis_blast_table = Table( 'tripal_analysis_blast', self.metadata, Column('db_id', Integer, primary_key=True, nullable=False, default=0, index=True), @@ -839,7 +839,7 @@ def _setup_tables(self, module): tripal_analysis_blast_table.create(self.engine) added_table = True - if not self.engine.dialect.has_table(self.engine, 'blast_organisms', schema=self.ci.dbschema): + if not inspect(self.engine).has_table(self.engine, 'blast_organisms', schema=self.ci.dbschema): blast_organisms_table = Table( 'blast_organisms', self.metadata, Column('blast_org_id', Integer, primary_key=True, nullable=False), @@ -855,7 +855,7 @@ def _setup_tables(self, module): self.ci._reflect_tables() self.model = self.ci.model - if not self.engine.dialect.has_table(self.engine, 'blast_hit_data', schema=self.ci.dbschema): + if not inspect(self.engine).has_table(self.engine, 'blast_hit_data', schema=self.ci.dbschema): blast_hit_data_table = Table( 'blast_hit_data', self.metadata, Column('analysisfeature_id', Integer, ForeignKey(self.model.analysisfeature.analysisfeature_id, ondelete="CASCADE"), nullable=False, index=True, primary_key=True), From 8cafd2e812e0df964a57fc49a2bafe2226b896dc Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Fri, 30 Apr 2021 09:45:32 +0200 Subject: [PATCH 3/4] fix --- chado/load/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chado/load/__init__.py b/chado/load/__init__.py index 8f0906a..53bf28e 100644 --- a/chado/load/__init__.py +++ b/chado/load/__init__.py @@ -824,7 +824,7 @@ def _setup_tables(self, module): self.ci.create_cvterm(term='analysis_blast_output_iteration_hits', term_definition='Hits of a blast', cv_name='tripal', db_name='tripal') # Tables for blast added_table = False - if not inspect(self.engine).has_table(self.engine, 'tripal_analysis_blast', schema='public'): + if not inspect(self.engine).has_table('tripal_analysis_blast', schema='public'): tripal_analysis_blast_table = Table( 'tripal_analysis_blast', self.metadata, Column('db_id', Integer, primary_key=True, nullable=False, default=0, index=True), @@ -839,7 +839,7 @@ def _setup_tables(self, module): tripal_analysis_blast_table.create(self.engine) added_table = True - if not inspect(self.engine).has_table(self.engine, 'blast_organisms', schema=self.ci.dbschema): + if not inspect(self.engine).has_table('blast_organisms', schema=self.ci.dbschema): blast_organisms_table = Table( 'blast_organisms', self.metadata, Column('blast_org_id', Integer, primary_key=True, nullable=False), @@ -855,7 +855,7 @@ def _setup_tables(self, module): self.ci._reflect_tables() self.model = self.ci.model - if not inspect(self.engine).has_table(self.engine, 'blast_hit_data', schema=self.ci.dbschema): + if not inspect(self.engine).has_table('blast_hit_data', schema=self.ci.dbschema): blast_hit_data_table = Table( 'blast_hit_data', self.metadata, Column('analysisfeature_id', Integer, ForeignKey(self.model.analysisfeature.analysisfeature_id, ondelete="CASCADE"), nullable=False, index=True, primary_key=True), From 7b0d08acd23b69cea7b717d09cfba5db3919c1ab Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Fri, 30 Apr 2021 09:50:01 +0200 Subject: [PATCH 4/4] prepare 2.3.5 --- README.md | 3 +++ setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bec590..8502d12 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,9 @@ $ chakin feature load_fasta \ ## History +- 2.3.5 + - Fix has_table() calls with recent sqlalchemy versions + - 2.3.4 - Now requires biopython >=1.78 - Fixes biopython sequence usage in recent biopython diff --git a/setup.py b/setup.py index cbb9a02..ffa02d1 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="chado", - version='2.3.4', + version='2.3.5', description="Chado library", author="Anthony Bretaudeau", author_email="anthony.bretaudeau@inrae.fr",