From b2c40cf77828cb67d7afcb5be324fc330fa2074c Mon Sep 17 00:00:00 2001 From: musasizivictoria <141638023+musasizivictoria@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:54:49 +0300 Subject: [PATCH 1/2] Add positive unit test for is_input_header in CompoundIdentifier (#1320) * Add positive test for is_input_header in CompoundIdentifier * refactor * refactor * proper error reporting --------- Co-authored-by: Dhanshree Arora --- test/test_compound_identifier.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/test_compound_identifier.py diff --git a/test/test_compound_identifier.py b/test/test_compound_identifier.py new file mode 100644 index 000000000..4eebad4ce --- /dev/null +++ b/test/test_compound_identifier.py @@ -0,0 +1,11 @@ +import pytest +from ersilia.utils.identifiers.compound import CompoundIdentifier + +@pytest.fixture +def compound_identifier(): + return CompoundIdentifier() + +@pytest.mark.parametrize("header", ["smiles", "input", "SMILES", "INPUT"]) +def test_is_input_header_positive(compound_identifier, header): + """Test that valid input headers return True.""" + assert compound_identifier.is_input_header(header) is True From be2a3f654a710e96bca06c9b1c1ad2dbd01d4bce Mon Sep 17 00:00:00 2001 From: Olawumi Salaam Date: Thu, 17 Oct 2024 12:59:47 +0100 Subject: [PATCH 2/2] Update release date (#1322) * Update release date field in CITATION.cff * update release date in the CITATION.cff * Update publish.yaml for readability --------- Co-authored-by: Dhanshree Arora --- .github/workflows/publish.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1faf4e3f5..ba8226894 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -39,19 +39,26 @@ jobs: git tag -a "v${{ steps.version.outputs.VERSION }}" -m "v${{ steps.version.outputs.VERSION }}" # Tagging happens implicitly; no need to push explicitly - - name: Update version in CITATION.cff + - name: Update version and release date in CITATION.cff id: update-citation env: VERSION: ${{ steps.version.outputs.VERSION }} - run: | + RELEASE_DATE: ${{ github.run_started_at }} # This captures the timestamp when the workflow run was triggered/started + + run: | pip install PyYAML python -c " import os import yaml + + release_date = os.environ['RELEASE_DATE'].split('T')[0] + with open('CITATION.cff', 'r') as file: - content = file.read() - citation = yaml.safe_load(content) + citation = yaml.safe_load(file) + citation['version'] = os.environ['VERSION'] + citation['date-released'] = release_date + with open('CITATION.cff', 'w') as file: yaml.dump(citation, file, default_flow_style=False, sort_keys=False) " @@ -72,7 +79,7 @@ jobs: with: author_name: "ersilia-bot" author_email: "ersilia-bot@users.noreply.github.com" - message: "update version [skip ci]" + message: "update version and release date [skip ci]" repository: "ersilia-os/${{ github.event.repository.name }}" github_token: ${{ secrets.GITHUB_TOKEN }} amend: true