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

458-Add question for citation files #471

Merged
merged 23 commits into from
Aug 21, 2024
Merged

458-Add question for citation files #471

merged 23 commits into from
Aug 21, 2024

Conversation

fdiblen
Copy link
Member

@fdiblen fdiblen commented Aug 20, 2024

Checks

Description
This PR adds a question about citation. If the user decides to add citation,

  • CITATION.cff is created
  • cffconvert workflow, which validates the CITATION.cff file, is added
  • a Github issue about citation is created by next_steps_citation.yml. next_steps_citation.yml then removes itself.
  • fixes escape character issues in next_steps*yml workflows (see here)
  • adds CITATION.cff to pyproject.toml
  • adds cffconvert badge to README.md
  • adds CITATION.cff to MANIFEST.in
  • adds citation-related text to README.md, README.dev.md, CONTRIBUTING.md, project_setup.md

Related issues:

Instructions to review the pull request

Install the requirements

cd $(mktemp -d --tmpdir py-tmpl-XXXXXX)
pip install pipx
pipx install copier

Test 1:
Run the command below and say 'yes' to citation question

copier copy --vcs-ref 458_citation https://github.com/nlesc/python-template test_yes

Test 2:
Run the command below and say 'no' to citation question

copier copy --vcs-ref 458_citation https://github.com/nlesc/python-template test_no

What to check in Test 1 and Test 2:
You should see the files below only when you say 'yes':

  • .github/workflows/next_steps_citation.yml
  • .github/workflows/cffconvert.yml
  • .github/next_steps/02_citation.md
  • CITATION.cff

The text related to citation (any sentence includes the words citation, cite) will only be present when you say 'yes'.

Test 3:

  • Push the generated package to a GitHub repository
  • Check if cffconvert workflow runs
  • Check if a Github issue about citation is created

Example test repository:
https://github.com/fdiblen/test_citation

@fdiblen fdiblen marked this pull request as ready for review August 20, 2024 15:18
@fdiblen fdiblen requested review from lyashevska and sjvrijn August 20, 2024 15:18
@fdiblen fdiblen changed the title Add question for citation files 458-Add question for citation files Aug 20, 2024
Copy link
Contributor

@sjvrijn sjvrijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except for the action failing on the echo command because of a missing single quote.
I'm a bit confused why the Citation issue has shown up twice in your demo repo though. I haven't been able to reproduce that, but would prefer to avoid duplicates if possible.

id: citation
- name: List created issues
run: |
echo 'Created issues that must be completed to have fully working Python package:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ' at the end of the line

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run echo 'Created issues that must be completed to have fully working Python package:
/home/runner/work/_temp/9d06e288-374f-4dd9-b641-81ec33ef6439.sh: line 1: unexpected EOF while looking for matching `''
Error: Process completed with exit code 2.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@lyashevska lyashevska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @fdiblen I have tested all steps, it looks good but there is one typo which I highlighted.

@fdiblen fdiblen marked this pull request as draft August 21, 2024 10:05
@fdiblen fdiblen marked this pull request as ready for review August 21, 2024 12:09
Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On

- Instructions how to make package [citable](template/.github/next_steps/02_citation.md.jinja)
the link is kaput. it should be '.github/next_steps/%7B%25%20if%20AddCitation%20%25%7D02_citation.md%7B%25%20endif%20%25%7D.jinja'

git config --global user.name 'NLeSC Python template'
git config --global user.email '[email protected]'
git rm .github/workflows/next_steps_citation.yml
git rm -r .github/next_steps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a problem for jobs running in parallel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a 'Next step: Citation data' issue and cffconvert ran in new repo.

@fdiblen
Copy link
Member Author

fdiblen commented Aug 21, 2024

Thank you for the review @sverhoeven!

1. Update the <CHANGELOG.md> (don't forget to update links at bottom of page)
{%- endif %}
{% if AddChangeLog -%}1. Update the <CHANGELOG.md> (don't forget to update links at bottom of page).{%- endif %}
{% if AddCitation -%}1. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.{%- endif %}
1. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a duplicate. Should be removed.

Copy link
Member

@lyashevska lyashevska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great @fdiblen! Ready to go 🥇

@fdiblen fdiblen merged commit aa7326f into main Aug 21, 2024
16 checks passed
@fdiblen fdiblen deleted the 458_citation branch August 21, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants