Skip to content

Commit

Permalink
Merge branch 'test-cite-workflow' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jurra committed Sep 19, 2023
2 parents 5d59e94 + 9a8cc6b commit cb50a8a
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 4 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/gen-citation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
branches: [ develop, main, test-cite-workflow ]
pull_request:
types:
- closed
branches: [ develop, main ]

jobs:
gen-citation:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cff-from-621
- name: Generate citation based on pyproject.toml
run: |
cff-from-621
# Check that citation file has been generated
if [ ! -f *.cff ]; then
echo "No citation file generated"
exit 1
fi
- name: Commit and push changes
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
# Check if there are changes to be committed
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
else
git config --local user.email "{{ github.actor }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add *.cff
git commit -m "Auto commit after successful merge"
git push
fi
18 changes: 18 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
message: If you use this software, please cite it as below.
cff-version: 1.2.0
title: pymurtree
abstract: Python bindings for MurTree C++ library
version: 0.0.1
date-released: '2022-09-18'
authors:
- name: Yasel Quintero
- name: Jose Urra
keywords:
- MurTree
- Optimal decision tree
- Python bindings
type: software
license: MIT
url: https://github.com/MurTree/pymurtree.git
...
32 changes: 28 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,26 @@ target-version = "py37"
[project]
name = "pymurtree"
version = "0.0.1"
description = "Python bindings for MurTree C++ library"
readme = "README.md"
license = "MIT"
keywords = ["MurTree", "Optimal decision tree", "Python bindings"]

authors = [
{name = "Yasel Quintero", orcid = "0000-0000-0000-0001"},
{name = "Jose Urra", orcid = "0000-0000-0000-0002"},
]

dependencies =[
"pandas>=1.0.0",
"numpy>=1.18.0",
]

# [project.dynamic]
# description = 'Python wrapper for the MurTree project'
# authors = 'Jose Urra and Yasel Quintero'
[project.urls]
homepage = "https://github.com/MurTree/pymurtree.git"
MurTreeCpp = "https://github.com/MurTree/murtree"
sample_data = "https://github.com/MurTree/murtree-data"
journal = "https://doi.org/10.48550/arXiv.2007.12652"

classifiers = [
"Programming Language :: Python :: 3",
Expand All @@ -46,10 +58,22 @@ dev = [
"pytest>=5.3.0",
"pytest-cov>=2.8.0",
]
publishing = [
"cff-from-621",
]

[tool.pytest.ini_options]
pythonpath = [
".", "src/pymurtree",
]

[project.urls]

[tool.cff-from-621]
order = ["message", "cff-version", "title", "abstract", "version", "date-released", "authors", "keywords"]

[tool.cff-from-621.static]
date-released = "2022-09-18"
message = "If you use this software, please cite it as below."

[tool.setuptools.dynamic]
version = {attr = "cff_from_621.version.VERSION"}

0 comments on commit cb50a8a

Please sign in to comment.