Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue562 python312 #564

Merged
merged 5 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/buildandtestpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: [3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions isatools/database/models/relationships.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy import Column, ForeignKey

from isatools.database.utils import Base, Table

Expand Down Expand Up @@ -250,4 +250,4 @@
Column("person_id", ForeignKey("person.person_id"), primary_key=True),
Column("role_id", ForeignKey("ontology_annotation.ontology_annotation_id"), primary_key=True),
comment="Many to many relationship between Persons and Roles (Ontology Annotations)"
)
)
2 changes: 1 addition & 1 deletion isatools/isatab/validate/rules/rules_10xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def check_unit_value(cell_value, unit_value, cfield, filename):
if cell_has_value(cell_value) or cell_has_value(unit_value):
local_spl = "Field '{}' has a unit but not a value in the file '{}'".format(cfield.header, filename)
validator.add_warning(message="Cell found has unit but no value", supplemental=local_spl, code=4999)
log.warning("(W) {}".format(spl))
log.warning("(W) {}".format(local_spl))
return False
return True

Expand Down
6 changes: 2 additions & 4 deletions isatools/isatab/validate/rules/rules_40xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ def add_error(index, column, value_index):
if index > 0:
spl = "A property value in {}.{} of investigation file at column {} is required"
spl = spl.format(column, index + 1, value_index + 1)
validator.add_error(message=message, supplemental=spl, code=code)
log.error("(E) {}".format(spl))
else:
spl = "A property value in {} of investigation file at column {} is required"
spl = spl.format(column, value_index + 1)
validator.add_error(message=message, supplemental=spl, code=code)
log.error("(E) {}".format(spl))
validator.add_error(message=message, supplemental=spl, code=code)
log.error("(E) {}".format(spl))

def check_section_against_required_fields_one_value(section, required, i=0):
fields_required = [i for i in section.columns if i in required]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"measurementType": "transcription profiling",
"technologyType": "DNA microarray",
"protocols": [
Expand Down
52 changes: 26 additions & 26 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
graphene==3.1.1
graphql-core==3.2.3
wheel~=0.36.2
setuptools~=57.1.0
numpy~=1.23.3
jsonschema~=4.18.4
wheel~=0.43.0
setuptools~=71.0.4
numpy~=1.26
jsonschema~=4.23.0
pandas==1.5.0
openpyxl>=2.5.0
networkx~=2.5.1
lxml~=4.9.1
requests~=2.25.1
iso8601~=0.1.14
chardet~=4.0.0
jinja2~=3.0.1
beautifulsoup4~=4.9.3
openpyxl>=3.1.5
networkx~=3.2.1
lxml~=5.2.2
requests~=2.32.3
iso8601~=2.1.0
chardet~=5.2.0
jinja2~=3.1.4
beautifulsoup4~=4.12.3
mzml2isa==1.1.1
biopython~=1.79
progressbar2~=3.53.1
deepdiff~=5.5.0
biopython~=1.84
progressbar2~=4.4.2
deepdiff~=7.0.1
PyYAML~=6.0.1
bokeh~=2.3.2
certifi==2021.5.30
flake8==3.9.2
ddt==1.4.2
bokeh~=3.4.2
certifi==2024.7.4
flake8==7.1.0
ddt==1.7.2
behave==1.2.6
httpretty==1.1.3
sure==2.0.0
coveralls~=3.1.0
rdflib~=6.0.2
SQLAlchemy~=1.4.42
python-dateutil~=2.8.1
Flask~=2.2.2
httpretty==1.1.4
sure==2.0.1
coveralls~=4.0.1
rdflib~=7.0.0
SQLAlchemy~=1.4.52 #2.0.31
python-dateutil~=2.9.0.post0
Flask~=3.0.3
flask_sqlalchemy~=3.0.2
52 changes: 28 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,42 @@ def read(f_name):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
install_requires=[
'graphene==3.1.1',
'graphql-core==3.2.3',
'wheel~=0.36.2',
'setuptools~=57.1.0',
'numpy~=1.23.3',
'jsonschema~=4.18.4',
'wheel~=0.43.0',
'setuptools~=71.0.4',
'numpy~=1.26',
'jsonschema~=4.23.0',
'pandas==1.5.0',
'openpyxl>=2.5.0',
'networkx~=2.5.1',
'lxml~=4.9.1',
'requests~=2.25.1',
'iso8601~=0.1.14',
'chardet~=4.0.0',
'jinja2~=3.0.1',
'beautifulsoup4~=4.9.3',
'openpyxl>=3.1.5',
'networkx~=3.2.1',
'lxml~=5.2.2',
'requests~=2.32.3',
'iso8601~=2.1.0',
'chardet~=5.2.0',
'jinja2~=3.1.4',
'beautifulsoup4~=4.12.3',
'mzml2isa==1.1.1',
'biopython~=1.79',
'progressbar2~=3.53.1',
'deepdiff~=5.5.0',
'biopython~=1.84',
'progressbar2~=4.4.2',
'deepdiff~=7.0.1',
'PyYAML~=6.0.1',
'bokeh~=2.3.2',
'certifi==2021.5.30',
'flake8==3.9.2',
'ddt==1.4.2',
'bokeh~=3.4.2',
'certifi==2024.7.4',
'flake8==7.1.0',
'ddt==1.7.2',
'behave==1.2.6',
'httpretty==1.1.3',
'sure==2.0.0',
'coveralls~=3.1.0',
'rdflib~=6.0.2',
'Flask~=2.2.2',
'httpretty==1.1.4',
'sure==2.0.1',
'coveralls~=4.0.1',
'rdflib~=7.0.0',
'SQLAlchemy~=1.4.52',
'python-dateutil~=2.9.0.post0',
'Flask~=3.0.3',
'flask_sqlalchemy~=3.0.2'
],
test_suite='tests'
Expand Down
2 changes: 0 additions & 2 deletions tests/convert/test_mzml2isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_mzml2isa_convert_investigation(self):
study_id = 'MTBLS267'
report = mzml2isa.convert(os.path.join(self._mzml_data_dir, study_id + '-partial'), self._tmp_dir, study_id,
validate_output=True)
# self.assertTrue(report['validation_finished'])
self.assertEqual(len(report['warnings']), 8)
self.assertEqual(len(report['errors']), 3)

Expand All @@ -43,7 +42,6 @@ def test_mzml2isa_convert_study_table(self):
study_id = 'MTBLS267'
report = mzml2isa.convert(os.path.join(self._mzml_data_dir, study_id + '-partial'), self._tmp_dir, study_id,
validate_output=True)
# self.assertTrue(report['validation_finished'])
self.assertEqual(len(report['warnings']), 8)
self.assertEqual(len(report['errors']), 3)
with open(os.path.join(self._tmp_dir, 's_{}.txt'.format(study_id))) as out_fp:
Expand Down
2 changes: 0 additions & 2 deletions tests/isatab/validate/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def test_b_ii_s_3(self):
r = validate(fp=data_file, config_dir=self.default_conf, origin="")
self.assertEqual(len(r['warnings']), 2)


def test_mtbls267(self):
data_path = path.join(path.dirname(path.abspath(__file__)), '..', '..', 'data', 'tab', 'MTBLS267-partial')
with open(path.join(data_path, 'i_Investigation.txt'), 'r') as data_file:
Expand Down Expand Up @@ -85,7 +84,6 @@ def is_investigation(investigation_df):
r = validate(data_file, rules=rules)
self.assertEqual(len(r['warnings']), 2)


rule = '12000'
expected_error = {
'message': 'Unknown/System Error',
Expand Down
7 changes: 4 additions & 3 deletions tests/test_clients/test_mw2isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def test_conversion_ms(self):
with open(os.path.join(self._tmp_dir, study_id, 'i_investigation.txt')) as fp:
report = isatab.validate(fp)
# print(report)
# for error in report['errors']:
for error in report['errors']:
# print("ERROR:", error)
# self.assertEqual(error['code'], 4014)
# self.assertIn(error['code'], [4003, 4014])
self.assertTrue(len(report['errors']) > 0)
# self.assertTrue(len(report['errors']) > 0)
self.assertIn(error['code'], [4003, 4014])

else:
self.fail("conversion failed, validation was not invoked")

Expand Down
2 changes: 1 addition & 1 deletion tests/validators/test_validate_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_validate_testdata_bii_i_1_isatab(self):
with open(os.path.join(utils.TAB_DATA_DIR, test_case, 'i_investigation.txt')) as test_case_fp:
report = isatab.validate(fp=test_case_fp, config_dir=utils.DEFAULT2015_XML_CONFIGS_DATA_DIR,
log_level=self._reporting_level)
if len(report['errors']) > 0:
if len(report['errors']) > 2:
# self.fail("Error found when validating ISA tab: {}".format(report['errors']))
self.assertTrue("Error found when validating ISA tab: {}".format(report['errors']))

Expand Down
Loading