Skip to content

Commit

Permalink
Fix Indigo CI (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliaksandrDziarkach authored Oct 10, 2024
1 parent 85ecc4c commit cf95cf8
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 57 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/indigo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,16 @@ jobs:
name: indigo-python
path: dist/
- name: Install Pillow
run: python3 -m pip install Pillow==9.5.0
run: python3 -m pip install Pillow --break-system-packages
- name: Install wrappers Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: python3 -m pip install dist/*manylinux1_x86_64*.whl
run: python3 -m pip install dist/*manylinux1_x86_64*.whl --break-system-packages
- name: Install wrappers Windows
if: ${{ startsWith(matrix.os, 'windows') }}
run: Get-ChildItem dist -Filter *win_amd64*.whl -Recurse | % { python3 -m pip install $_.FullName }
- name: Install wrappers macOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: python3 -m pip install dist/*macosx_10_7_intel*.whl
run: python3 -m pip install dist/*macosx_10_7_intel*.whl --break-system-packages
- name: Test
run: python3 -Wignore api/tests/integration/test.py -t 1 -j junit_report.xml
- name: Publish Test Report
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
run: |
apt update
apt install -y --no-install-recommends python3 python3-pip
python3 -m pip install Pillow==9.5.0
apt install -y python3-pil
python3 -m pip install dist/*manylinux2014_aarch64*.whl
python3 api/tests/integration/test.py -p basic/basic.py -t 1 -j junit_report.xml
- name: Publish Test Report
Expand Down Expand Up @@ -361,13 +361,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.9'
architecture: x86
- name: Install Pillow
run: python -m pip install Pillow==9.5.0
run: python -m pip install Pillow
- name: Install wrappers Windows
if: ${{ startsWith(matrix.os, 'windows') }}
run: Get-ChildItem dist -Filter *win32*.whl -Recurse | % { python -m pip install $_.FullName }
run: Get-ChildItem dist -Filter *win32*.whl -Recurse | % { python -m pip install $_.FullName --break-system-packages }
- name: Test
run: python api/tests/integration/test.py -t 1 -p basic/basic.py -j junit_report.xml
- name: Publish Test Report
Expand Down Expand Up @@ -516,7 +516,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-13, ubuntu-latest, windows-latest ]
# os: [ macos-13, ubuntu-latest, windows-latest ]
os: [ macos-13, windows-latest ]
runs-on: ${{ matrix.os }}
needs: build_indigo_wrappers
steps:
Expand Down Expand Up @@ -649,7 +650,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.10' ]
python-version: [ '3.9', '3.10' ]
needs: build_indigo_wrappers
steps:
- uses: actions/checkout@v3
Expand All @@ -667,10 +668,10 @@ jobs:
name: indigo-python
path: dist/
- name: Install latest indigo version
run: pip install ${GITHUB_WORKSPACE}/dist/epam.indigo-*manylinux1_x86_64.whl
run: pip install ${GITHUB_WORKSPACE}/dist/epam.indigo-*manylinux1_x86_64.whl --break-system-packages
working-directory: bingo/bingo-elastic/python
- name: Install dev dependencies
run: pip install ".[dev]"
run: pip install ".[dev]" --break-system-packages
working-directory: bingo/bingo-elastic/python
- name: Setup elasticsearch
run: docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "indices.query.bool.max_clause_count=4096" docker.elastic.co/elasticsearch/elasticsearch:7.16.2
Expand All @@ -679,7 +680,7 @@ jobs:
- name: Build wheel
working-directory: bingo/bingo-elastic/python
run: |
pip install ".[async]"
pip install ".[async]" --break-system-packages
python setup.py bdist_wheel
cp dist/*.whl ${GITHUB_WORKSPACE}/dist/
- name: Run pylint
Expand Down Expand Up @@ -1000,7 +1001,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.9'
- name: Git fetch tags
run: |
git config --global --add safe.directory '*'
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/common/rendering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def average_hash_and_sizes(self):
self.image = Image.open(self.image_path)
width, height = self.image.size
image = self.image.resize(
(self.hash_size, self.hash_size), Image.ANTIALIAS
(self.hash_size, self.hash_size), Image.LANCZOS
)
# image.show()
allchannelpixels = [
Expand Down
4 changes: 2 additions & 2 deletions bingo/bingo-elastic/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"Source Code": "https://github.com/epam/indigo/",
},
download_url="https://pypi.org/project/bingo_elastic",
python_requires=">=3.7",
python_requires=">=3.9",
packages=["bingo_elastic", "bingo_elastic.model"],
install_requires=["epam.indigo==1.25.0.rc1", "elasticsearch==7.16.2"],
extras_require={
"async": ["elasticsearch[async]==7.16.2"],
"dev": [
'pylint==2.17.7; python_version=="3.7"',
'pylint==2.17.7; python_version=="3.9"',
'pylint==3.1.0; python_version>="3.10"',
"pytest",
"wheel",
Expand Down
6 changes: 3 additions & 3 deletions utils/indigo-service/backend/service/tests/api/indigo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def test_headers_wrong(self):
"ValidationError: {'input_format': ['Must be one of: %s']}"
% formats
)
self.assertEquals(
self.assertEqual(
expected_text,
result.text,
)
Expand All @@ -502,7 +502,7 @@ def test_headers_wrong(self):
"ValidationError: {'output_format': ['Must be one of: %s']}"
% formats
)
self.assertEquals(
self.assertEqual(
expected_text,
result.text,
)
Expand Down Expand Up @@ -2163,7 +2163,7 @@ def test_calculate(self):
# )
self.assertEqual(200, result.status_code)
result_data = json.loads(result.text)
self.assertEquals("16.0424604", result_data["molecular-weight"])
self.assertEqual("16.0424604", result_data["molecular-weight"])

def test_calculate_components_mol(self):
headers, data = self.get_headers(
Expand Down
76 changes: 38 additions & 38 deletions utils/indigo-service/backend/service/v2/bingo_ql/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,88 +9,88 @@ def setUp(self):

def testQueryByPropName(self):
query = self.builder.build_query('"monoisotopic_weight"')
self.assertEquals("(elems->>'y' = %(property_term_0)s)", query)
self.assertEquals(
self.assertEqual("(elems->>'y' = %(property_term_0)s)", query)
self.assertEqual(
{"property_term_0": "monoisotopic_weight"},
self.builder.bind_params,
)

query = self.builder.build_query('"BBB log([brain]:[blood])"')
self.assertEquals("(elems->>'y' = %(property_term_0)s)", query)
self.assertEquals(
self.assertEqual("(elems->>'y' = %(property_term_0)s)", query)
self.assertEqual(
{"property_term_0": "bbb log([brain]:[blood])"},
self.builder.bind_params,
)

query = self.builder.build_query('~"count"')
self.assertEquals("(elems->>'y' LIKE %(property_term_0)s)", query)
self.assertEquals(
self.assertEqual("(elems->>'y' LIKE %(property_term_0)s)", query)
self.assertEqual(
{"property_term_0": "%count%"}, self.builder.bind_params
)

query = self.builder.build_query("count")
self.assertEquals("(elems->>'y' LIKE %(property_term_0)s)", query)
self.assertEquals(
self.assertEqual("(elems->>'y' LIKE %(property_term_0)s)", query)
self.assertEqual(
{"property_term_0": "%count%"}, self.builder.bind_params
)

def testQueryPropWithValue(self):
query = self.builder.build_query('"atom_count" != 30')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND jsonb_typeof(elems->'y') = 'number' AND (elems->>'y')::float != %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{"property_term_0": "atom_count", "property_value_0": "30"},
self.builder.bind_params,
)

query = self.builder.build_query('"weight" > 0.537')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND jsonb_typeof(elems->'y') = 'number' AND (elems->>'y')::float > %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{"property_term_0": "weight", "property_value_0": "0.537"},
self.builder.bind_params,
)

query = self.builder.build_query("count > 25")
self.assertEquals(
self.assertEqual(
"(elems->>'x' LIKE %(property_term_0)s AND jsonb_typeof(elems->'y') = 'number' AND (elems->>'y')::float > %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{"property_term_0": "%count%", "property_value_0": "25"},
self.builder.bind_params,
)

query = self.builder.build_query('"formula" = "C14H21N3O2"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' = %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{"property_term_0": "formula", "property_value_0": "c14h21n3o2"},
self.builder.bind_params,
)

query = self.builder.build_query("'formula' != " + '"C14H21N3O2"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' != %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{"property_term_0": "formula", "property_value_0": "c14h21n3o2"},
self.builder.bind_params,
)

query = self.builder.build_query('~"molecular formula" = "C14H21N3O2"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' LIKE %(property_term_0)s AND elems->>'y' = %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "%molecular formula%",
"property_value_0": "c14h21n3o2",
Expand All @@ -99,11 +99,11 @@ def testQueryPropWithValue(self):
)

query = self.builder.build_query('formula = "C14H21N3O2"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' LIKE %(property_term_0)s AND elems->>'y' = %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "%formula%",
"property_value_0": "c14h21n3o2",
Expand All @@ -112,11 +112,11 @@ def testQueryPropWithValue(self):
)

query = self.builder.build_query("'formula' ~ 'C14H21N3O2'")
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' LIKE %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "formula",
"property_value_0": "%c14h21n3o2%",
Expand All @@ -125,11 +125,11 @@ def testQueryPropWithValue(self):
)

query = self.builder.build_query("formula !~ C14H21N3O2")
self.assertEquals(
self.assertEqual(
"(elems->>'x' LIKE %(property_term_0)s AND elems->>'y' NOT LIKE %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "%formula%",
"property_value_0": "%c14h21n3o2%",
Expand All @@ -138,11 +138,11 @@ def testQueryPropWithValue(self):
)

query = self.builder.build_query('"P-gp category_Probability" ~ "no"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' LIKE %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "p-gp category_probability",
"property_value_0": "%no%",
Expand All @@ -153,11 +153,11 @@ def testQueryPropWithValue(self):
query = self.builder.build_query(
'"PPB90 category_Probability" ~ "high = 0.18;"'
)
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' LIKE %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "ppb90 category_probability",
"property_value_0": "%high = 0.18;%",
Expand All @@ -166,11 +166,11 @@ def testQueryPropWithValue(self):
)

query = self.builder.build_query('"molecular_formula" !~ "C14H21N3O2"')
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND elems->>'y' NOT LIKE %(property_value_0)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "molecular_formula",
"property_value_0": "%c14h21n3o2%",
Expand All @@ -182,11 +182,11 @@ def testQueryCompound(self):
query = self.builder.build_query(
'"mass" > 30 OR ~"probability" !~ "LOW"'
)
self.assertEquals(
self.assertEqual(
"(elems->>'x' = %(property_term_0)s AND jsonb_typeof(elems->'y') = 'number' AND (elems->>'y')::float > %(property_value_0)s) OR (elems->>'x' LIKE %(property_term_1)s AND elems->>'y' NOT LIKE %(property_value_1)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "mass",
"property_value_0": "30",
Expand All @@ -197,11 +197,11 @@ def testQueryCompound(self):
)

query = self.builder.build_query('"STATUS" or ~"NAME" or "CODE"')
self.assertEquals(
self.assertEqual(
"(elems->>'y' = %(property_term_0)s) OR (elems->>'y' LIKE %(property_term_1)s) OR (elems->>'y' = %(property_term_2)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "status",
"property_term_1": "%name%",
Expand All @@ -211,11 +211,11 @@ def testQueryCompound(self):
)

query = self.builder.build_query("logP > 2 and StdDev < 0.5")
self.assertEquals(
self.assertEqual(
"(elems->>'x' LIKE %(property_term_0)s AND jsonb_typeof(elems->'y') = 'number' AND (elems->>'y')::float > %(property_value_0)s))\n inner join {1} t1 on str.s = t1.s\n inner join jsonb_array_elements(t1.p) elems_t1 on ((elems_t1->>'x' LIKE %(property_term_1)s AND jsonb_typeof(elems_t1->'y') = 'number' AND (elems_t1->>'y')::float < %(property_value_1)s)",
query,
)
self.assertEquals(
self.assertEqual(
{
"property_term_0": "%logp%",
"property_term_1": "%stddev%",
Expand Down

0 comments on commit cf95cf8

Please sign in to comment.