Skip to content

Commit 70b8ef1

Browse files
Merge pull request #244 from PolicyEngine/maria/microdf_housekeeping
Microdf housekeeping
2 parents 78cfacb + 662cf69 commit 70b8ef1

62 files changed

Lines changed: 5557 additions & 1134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Updating the code
2+
3+
Please make sure that introduced changes are consistent with the testing api and add additional tests if relevant.
4+
5+
## Updating the versioning
6+
7+
Please add to `changelog.yaml` and then run `make changelog` before committing the results ONCE in this PR.

.github/changelog_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
5+
6+
{{changelog}}

.github/get-changelog-diff.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
last_tagged_commit=`git describe --tags --abbrev=0 --first-parent`
2+
git --no-pager diff $last_tagged_commit -- CHANGELOG.md

.github/has-functional-changes.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#! /usr/bin/env bash
2+
3+
IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile docs/* .gitignore LICENSE* .github/* data/*"
4+
5+
last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit
6+
7+
if git diff-index --name-only --exit-code $last_tagged_commit -- . `echo " $IGNORE_DIFF_ON" | sed 's/ / :(exclude)/g'` # Check if any file that has not be listed in IGNORE_DIFF_ON has changed since the last tag was published.
8+
then
9+
echo "No functional changes detected."
10+
exit 1
11+
else echo "The functional files above were changed."
12+
fi
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env bash
2+
3+
if [[ ${GITHUB_REF#refs/heads/} == master ]]
4+
then
5+
echo "No need for a version check on master."
6+
exit 0
7+
fi
8+
9+
if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh
10+
then
11+
echo "No need for a version update."
12+
exit 0
13+
fi
14+
15+
current_version=`python .github/fetch_version.py`
16+
17+
if git rev-parse --verify --quiet $current_version
18+
then
19+
echo "Version $current_version already exists in commit:"
20+
git --no-pager log -1 $current_version
21+
echo
22+
echo "Update the version number in setup.py before merging this branch into master."
23+
echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated."
24+
exit 1
25+
fi
26+
27+
if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh | grep --quiet CHANGELOG.md
28+
then
29+
echo "CHANGELOG.md has not been modified, while functional changes were made."
30+
echo "Explain what you changed before merging this branch into master."
31+
echo "Look at the CONTRIBUTING.md file to learn how to write the changelog."
32+
exit 2
33+
fi

.github/publish-git-tag.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/env bash
2+
3+
git tag `python .github/fetch_version.py` # create a new tag
4+
git push --tags || true # update the repository version

.github/workflows/build_and_test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Versioning
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
check-changelog-entry:
9+
name: Changelog entry check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Check for changelog entry
15+
run: |
16+
if [ ! -f "changelog_entry.yaml" ]; then
17+
echo "Error: changelog_entry.yaml file is missing."
18+
echo "Please add a changelog_entry.yaml file at the root of the repository."
19+
exit 1
20+
fi
21+
22+
# Check if the file is empty
23+
if [ ! -s "changelog_entry.yaml" ]; then
24+
echo "Error: changelog_entry.yaml file is empty."
25+
echo "Please add content to the changelog_entry.yaml file."
26+
exit 1
27+
fi
28+
29+
echo "Changelog entry found and is not empty."

.github/workflows/check_jupyterbook.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/codecov.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)