Skip to content

Commit cb50a8a

Browse files
committed
Merge branch 'test-cite-workflow' into main
2 parents 5d59e94 + 9a8cc6b commit cb50a8a

File tree

3 files changed

+98
-4
lines changed

3 files changed

+98
-4
lines changed

.github/workflows/gen-citation.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
push:
3+
branches: [ develop, main, test-cite-workflow ]
4+
pull_request:
5+
types:
6+
- closed
7+
branches: [ develop, main ]
8+
9+
jobs:
10+
gen-citation:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
# Give the default GITHUB_TOKEN write permission to commit and push the
14+
# added or changed files to the repository.
15+
contents: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python 3.10
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install cff-from-621
29+
30+
- name: Generate citation based on pyproject.toml
31+
run: |
32+
cff-from-621
33+
# Check that citation file has been generated
34+
if [ ! -f *.cff ]; then
35+
echo "No citation file generated"
36+
exit 1
37+
fi
38+
39+
- name: Commit and push changes
40+
env:
41+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
42+
run: |
43+
# Check if there are changes to be committed
44+
if [ -z "$(git status --porcelain)" ]; then
45+
echo "No changes to commit"
46+
else
47+
git config --local user.email "{{ github.actor }}@users.noreply.github.com"
48+
git config --local user.name "GitHub Action"
49+
git add *.cff
50+
git commit -m "Auto commit after successful merge"
51+
git push
52+
fi

CITATION.cff

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
message: If you use this software, please cite it as below.
3+
cff-version: 1.2.0
4+
title: pymurtree
5+
abstract: Python bindings for MurTree C++ library
6+
version: 0.0.1
7+
date-released: '2022-09-18'
8+
authors:
9+
- name: Yasel Quintero
10+
- name: Jose Urra
11+
keywords:
12+
- MurTree
13+
- Optimal decision tree
14+
- Python bindings
15+
type: software
16+
license: MIT
17+
url: https://github.com/MurTree/pymurtree.git
18+
...

pyproject.toml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,26 @@ target-version = "py37"
2727
[project]
2828
name = "pymurtree"
2929
version = "0.0.1"
30+
description = "Python bindings for MurTree C++ library"
31+
readme = "README.md"
32+
license = "MIT"
33+
keywords = ["MurTree", "Optimal decision tree", "Python bindings"]
34+
35+
authors = [
36+
{name = "Yasel Quintero", orcid = "0000-0000-0000-0001"},
37+
{name = "Jose Urra", orcid = "0000-0000-0000-0002"},
38+
]
39+
3040
dependencies =[
3141
"pandas>=1.0.0",
3242
"numpy>=1.18.0",
3343
]
3444

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

3951
classifiers = [
4052
"Programming Language :: Python :: 3",
@@ -46,10 +58,22 @@ dev = [
4658
"pytest>=5.3.0",
4759
"pytest-cov>=2.8.0",
4860
]
61+
publishing = [
62+
"cff-from-621",
63+
]
4964

5065
[tool.pytest.ini_options]
5166
pythonpath = [
5267
".", "src/pymurtree",
5368
]
5469

55-
[project.urls]
70+
71+
[tool.cff-from-621]
72+
order = ["message", "cff-version", "title", "abstract", "version", "date-released", "authors", "keywords"]
73+
74+
[tool.cff-from-621.static]
75+
date-released = "2022-09-18"
76+
message = "If you use this software, please cite it as below."
77+
78+
[tool.setuptools.dynamic]
79+
version = {attr = "cff_from_621.version.VERSION"}

0 commit comments

Comments
 (0)