When running tests you get a lot of these messages:
PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
Use @pytest.fixture instead; they are the same.
It should be easily fixable!
Now that I look there are a number of deprecation messages: Perhaps create a new issue by type of deprecation. let's start with this.
I'll give it a shot.
/opt/hostedtoolcache/Python/3.6.14/x64/lib/python3.6/site-packages/scout/server/blueprints/cases/views.py:264: DeprecationWarning: The 'cache_timeout' parameter has been renamed to 'max_age'./opt/hostedtoolcache/Python/3.6.14/x64/lib/python3.6/site-packages/scout/server/blueprints/cases/views.py:264: DeprecationWarning: The 'attachment_filename' parameter has been renamed to 'download_name'. The old name will be removed in Flask 2.1./home/runner/work/scout/scout/tests/server/blueprints/cases/test_cases_controllers.py:80: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead./opt/hostedtoolcache/Python/3.6.14/x64/lib/python3.6/site-packages/flask_ldap3_login/forms.py:27: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired/opt/hostedtoolcache/Python/3.6.14/x64/lib/python3.6/site-packages/flask_ldap3_login/forms.py:26: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequiredAnd further more…
This seems to be fixed already:
PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
Use @pytest.fixture instead; they are the same.
To remove Flask's deprecation warnings we need to update Flask to >2.0. The options marked as deprecated are not supported in our current running 1.0.2.
1, 2, 4, 5 above are all related to us running an old version of Flask.
The majority of the deprecation warnings are related to Flask and it's downstream dependencies such as Jinja and Wtforms. I locally tested 2.0.2 at a glance, and it seemed to work.
Another to issue of deprecation warnings is Weasyprint. Used in Scout to create pdf:s. This is bound to the rather old version 0.42.3. Latest stable I 52.5. However, when updating the pdf:s generated overlapping text.
I suggest this issue is closed. When Scout in the future updates its dependencies most will be solved. Updating Weasyprint to a modern version could be a standalone PR.
Weasyprint problems will be hopefully solved when we change the report pages (@elevu and @moedarrah) are looking into it at the moment. I would leave the issue open, so we remember that there are libraries in Scout that are deprecated and need updating. Would be nice to pinpoint which ones. Here is my warnings log pytest fails locally:
./../../../miniconda3/envs/py38/lib/python3.8/site-packages/jinja2/environment.py:362
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/jinja2/environment.py:362: DeprecationWarning: The ‘with’ extension is deprecated and will be removed in Jinja 3.1. This is built in now.
self.extensions = load_extensions(self, extensions)
../../../../miniconda3/envs/py38/lib/python3.8/site-packages/flask_ldap3_login/forms.py:26
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/flask_ldap3_login/forms.py:26: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired
username = wtforms.StringField(‘Username’, validators=[validators.Required()])
../../../../miniconda3/envs/py38/lib/python3.8/site-packages/flask_ldap3_login/forms.py:27
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/flask_ldap3_login/forms.py:27: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired
password = wtforms.PasswordField(‘Password’, validators=[validators.Required()])
../../../../miniconda3/envs/py38/lib/python3.8/site-packages/alchy/utils.py:9
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/alchy/utils.py:9: DeprecationWarning: Using or importing the ABCs from ‘collections’ instead of from ‘collections.abc’ is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Iterable
../../../../miniconda3/envs/py38/lib/python3.8/site-packages/werkzeug/local.py:206
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/werkzeug/local.py:206: DeprecationWarning: ‘__ident_func__’ is deprecated and will be removed in Werkzeug 2.1. It should not be used in Python 3.7+.
return self._local.__ident_func__
tests/adapter/mongo/test_adapter_variant_caseid.py: 9348 warnings
tests/adapter/mongo/test_evaluated_variants.py: 13290 warnings
tests/adapter/mongo/test_load_adapter_case.py: 9234 warnings
tests/adapter/mongo/test_query.py: 9834 warnings
tests/adapter/mongo/test_sanger_validation.py: 4080 warnings
tests/adapter/mongo/test_variant_handling.py: 13734 warnings
tests/build/test_build_variant.py: 8274 warnings
tests/commands/test_setup_cmd.py: 4674 warnings
tests/commands/delete/test_delete_cmd.py: 396 warnings
tests/commands/export/test_export_mt_report_cmd.py: 198 warnings
tests/commands/export/test_export_variant_cmd.py: 396 warnings
tests/commands/load/test_load_case_cmd.py: 4674 warnings
tests/commands/load/test_load_region_cmd.py: 2034 warnings
tests/commands/load/test_load_research_cmd.py: 72 warnings
tests/commands/load/test_load_variants_cmd.py: 852 warnings
tests/commands/update/test_update_case_cmd.py: 24 warnings
tests/commands/view/test_view_cases.py: 198 warnings
tests/commands/view/test_view_cases_cmd.py: 198 warnings
tests/export/test_export_variants.py: 396 warnings
tests/load/test_load_variant.py: 8682 warnings
tests/load/test_setup_scout.py: 4674 warnings
tests/parse/test_parse_genotype.py: 8160 warnings
tests/parse/test_parse_matchmaker.py: 1842 warnings
tests/server/blueprints/alignviewers/test_alignviewers_controllers.py: 5526 warnings
tests/server/blueprints/alignviewers/test_alignviewers_views.py: 3684 warnings
tests/server/blueprints/cases/test_cases_controllers.py: 7368 warnings
tests/server/blueprints/cases/test_cases_templates.py: 5526 warnings
tests/server/blueprints/cases/test_cases_utils.py: 1842 warnings
tests/server/blueprints/cases/test_cases_views.py: 55260 warnings
tests/server/blueprints/cases/test_matchmaker_controllers.py: 12894 warnings
tests/server/blueprints/dashboard/test_dashboard_controllers.py: 5526 warnings
tests/server/blueprints/dashboard/test_dashboard_views.py: 1842 warnings
tests/server/blueprints/diagnoses/test_diagnoses_views.py: 3684 warnings
tests/server/blueprints/genes/test_genes_views.py: 7368 warnings
tests/server/blueprints/institutes/test_institute_api.py: 3684 warnings
tests/server/blueprints/institutes/test_institute_controllers.py: 1842 warnings
tests/server/blueprints/institutes/test_institute_views.py: 46050 warnings
tests/server/blueprints/login/test_views.py: 3684 warnings
tests/server/blueprints/managed_variants/test_managed_variants_views.py: 3684 warnings
tests/server/blueprints/panels/test_panels_views.py: 11052 warnings
tests/server/blueprints/phenotypes/test_phenotypes_views.py: 3684 warnings
tests/server/blueprints/public/test_public_views.py: 3684 warnings
tests/server/blueprints/variant/test_variant_controllers.py: 14736 warnings
tests/server/blueprints/variant/test_variant_utils.py: 3684 warnings
tests/server/blueprints/variant/test_variant_verification_controllers.py: 3684 warnings
tests/server/blueprints/variant/test_variant_views.py: 16578 warnings
tests/server/blueprints/variants/test_variants_controllers.py: 14736 warnings
tests/server/blueprints/variants/test_variants_utils.py: 1842 warnings
tests/server/blueprints/variants/test_variants_views.py: 23946 warnings
tests/update/test_update_compounds.py: 4080 warnings
/Users/chiararasi/Documents/work/GITs/scout/scout/parse/variant/genotype.py:219: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
alt_frequency = float(variant.gt_alt_freqs[pos])
tests/server/blueprints/cases/test_cases_controllers.py::test_phenotype_genes_matching_phenotypes
/Users/chiararasi/Documents/work/GITs/scout/tests/server/blueprints/cases/test_cases_controllers.py:80: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead.
assert adapter.hpo_term_collection.insert([hpo_term, hpo_term2])
tests/server/blueprints/cases/test_cases_views.py::test_mt_report
/Users/chiararasi/Documents/work/GITs/scout/scout/server/blueprints/cases/views.py:259: DeprecationWarning: The ‘attachment_filename’ parameter has been renamed to ‘download_name’. The old name will be removed in Flask 2.1.
return send_file(
tests/server/blueprints/cases/test_cases_views.py::test_mt_report
/Users/chiararasi/Documents/work/GITs/scout/scout/server/blueprints/cases/views.py:259: DeprecationWarning: The ‘cache_timeout’ parameter has been renamed to ‘max_age’. The old name will be removed in Flask 2.1.
return send_file(
tests/server/blueprints/dashboard/test_dashboard_controllers.py: 1 warning
tests/server/blueprints/dashboard/test_dashboard_views.py: 1 warning
tests/server/blueprints/institutes/test_institute_api.py: 1 warning
tests/server/blueprints/institutes/test_institute_views.py: 36 warnings
tests/server/blueprints/managed_variants/test_managed_variants_views.py: 13 warnings
tests/server/blueprints/panels/test_panels_views.py: 3 warnings
tests/server/blueprints/variants/test_variants_views.py: 8 warnings
/Users/chiararasi/miniconda3/envs/py38/lib/python3.8/site-packages/wtforms/fields/core.py:376: DeprecationWarning: The TextField alias for StringField has been deprecated and will be removed in WTForms 3.0
return self.field_class(*self.args, **kw)
Ok, we can leave this open.
One PR has created today :) #2799
Deprecation messages
np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.