From a9a3d45e77130eceab5126124bc2058f3d281133 Mon Sep 17 00:00:00 2001 From: Lev Levitsky Date: Tue, 8 Oct 2024 12:01:24 +0200 Subject: [PATCH 01/10] Fix ValueError on enzyme validation --- sdrf_pipelines/sdrf/sdrf_schema.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdrf_pipelines/sdrf/sdrf_schema.py b/sdrf_pipelines/sdrf/sdrf_schema.py index 9d85918..a467ca4 100644 --- a/sdrf_pipelines/sdrf/sdrf_schema.py +++ b/sdrf_pipelines/sdrf/sdrf_schema.py @@ -56,13 +56,15 @@ def ontology_term_parser(cell_value: str = None): term[TERM_NAME] = values[0].lower() else: for name in values: - value_terms = name.split("=") - if len(value_terms) == 2: - term[value_terms[0].strip().upper()] = value_terms[1].strip().lower() - else: + value_terms = name.split("=", 1) + if len(value_terms) == 1: + raise ValueError("Not a key-value pair: " + name) + if "=" in value_terms[1] and value_terms[0].lower() != 'cs': raise ValueError( f"Invalid term: {name} after splitting by '=', please check the prefix (e.g. AC, NT, " f"TA..)" ) + term[value_terms[0].strip().upper()] = value_terms[1].strip().lower() + return term From 5aa8c42ab4e696a8b2f850921bfbb5ecb7b5bfaa Mon Sep 17 00:00:00 2001 From: Lev Levitsky Date: Tue, 8 Oct 2024 12:07:34 +0200 Subject: [PATCH 02/10] Fix quotes --- sdrf_pipelines/sdrf/sdrf_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrf_pipelines/sdrf/sdrf_schema.py b/sdrf_pipelines/sdrf/sdrf_schema.py index a467ca4..c0a4c2a 100644 --- a/sdrf_pipelines/sdrf/sdrf_schema.py +++ b/sdrf_pipelines/sdrf/sdrf_schema.py @@ -59,7 +59,7 @@ def ontology_term_parser(cell_value: str = None): value_terms = name.split("=", 1) if len(value_terms) == 1: raise ValueError("Not a key-value pair: " + name) - if "=" in value_terms[1] and value_terms[0].lower() != 'cs': + if "=" in value_terms[1] and value_terms[0].lower() != "cs": raise ValueError( f"Invalid term: {name} after splitting by '=', please check the prefix (e.g. AC, NT, " f"TA..)" ) From d101b847fc5c9df061c03a4db89231dd2b262d2a Mon Sep 17 00:00:00 2001 From: Lev Levitsky Date: Tue, 8 Oct 2024 14:02:21 +0200 Subject: [PATCH 03/10] Add setuptools dependency --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index dcbaf19..da88c12 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ def get_version(rel_path): "pyarrow", "duckdb", "rdflib", + "setuptools" ], entry_points={"console_scripts": ["parse_sdrf = sdrf_pipelines.parse_sdrf:main"]}, platforms=["any"], From a8fc4273a4db5e995c548b19949043d3f98bf131 Mon Sep 17 00:00:00 2001 From: Lev Levitsky Date: Tue, 8 Oct 2024 15:12:10 +0200 Subject: [PATCH 04/10] Trigger checks From e3066aed39815d1d40655b510dbf2f8c3653cbb5 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:01:04 +0100 Subject: [PATCH 05/10] small update --- recipe/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4d46474..fb24875 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,7 @@ # recipe/meta.yaml package: name: sdrf-pipelines - version: "0.0.29" + version: "0.0.30" source: path: ../ @@ -29,6 +29,7 @@ requirements: - duckdb - rdflib - pyarrow + - setuptools test: imports: From 161150413cfc41d7a7f68d213b7a0d37937b4e1a Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:08:57 +0100 Subject: [PATCH 06/10] setuptools added --- requirements-dev.txt | 3 ++- requirements.txt | 3 ++- setup.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2b8d687..ed7bd53 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,4 +2,5 @@ black isort pre-commit pytest -pytest-datadir \ No newline at end of file +pytest-datadir +setuptools \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index ca30a5e..9ee7f80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,5 @@ numpy defusedxml pyarrow duckdb -rdflib \ No newline at end of file +rdflib +setuptools \ No newline at end of file diff --git a/setup.py b/setup.py index dcbaf19..d7f758f 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ def get_version(rel_path): "pyarrow", "duckdb", "rdflib", + "setuptools", ], entry_points={"console_scripts": ["parse_sdrf = sdrf_pipelines.parse_sdrf:main"]}, platforms=["any"], From b2c6e80f44dd573c82f37988c7235451cd3bb3e1 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:31:40 +0100 Subject: [PATCH 07/10] small update --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab2afc5..9954088 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: - name: Check code lints with Black uses: psf/black@stable + with: + use_pyproject: true # If the above check failed, post a comment on the PR explaining the failure - name: Post PR comment From ed9b13c82c6bbf0e6736b8fab1b815ec08f2bfa2 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:36:20 +0100 Subject: [PATCH 08/10] small update --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9954088..fa55102 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,21 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Check code lints with Black - uses: psf/black@stable + # Set up the specific Python version for Black + - name: Set up Python 3.12 + uses: actions/setup-python@v2 with: - use_pyproject: true + python-version: 3.12 # Set your desired Python version here + + # Install Black and dependencies if necessary + - name: Install Black + run: | + python -m pip install --upgrade pip + pip install black + + # Run Black linting + - name: Check code lints with Black + run: black . --check # If the above check failed, post a comment on the PR explaining the failure - name: Post PR comment From a05af088eb6191d09a8c16f8e2b63f8a7ae228ae Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:39:32 +0100 Subject: [PATCH 09/10] small update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index da88c12..d7f758f 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def get_version(rel_path): "pyarrow", "duckdb", "rdflib", - "setuptools" + "setuptools", ], entry_points={"console_scripts": ["parse_sdrf = sdrf_pipelines.parse_sdrf:main"]}, platforms=["any"], From 27ae46ebfda6c0f11bc65d99df4d69a4a2e99a70 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 8 Oct 2024 16:54:48 +0100 Subject: [PATCH 10/10] small update in recipe --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fb24875..eaf4f9c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -17,6 +17,7 @@ requirements: host: - pip - python >=3.5 + - setuptools run: - click - requests @@ -29,7 +30,6 @@ requirements: - duckdb - rdflib - pyarrow - - setuptools test: imports: