Skip to content

Commit

Permalink
resolve merge conflict when merging dev into sem view
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthero1 committed Mar 11, 2024
2 parents 9f4da77 + 1871170 commit b0c4f46
Show file tree
Hide file tree
Showing 96 changed files with 451 additions and 547 deletions.
21 changes: 0 additions & 21 deletions .coveragerc

This file was deleted.

41 changes: 12 additions & 29 deletions .github/workflows/bump-version-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,31 @@ jobs:
name: Bump version
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Set env variables
run: |
# The next line is very important, otherwise the line after triggers
# git to track the permission change, which breaks bump2version API (needs clean git folder)
git config core.filemode false
chmod +x .github/workflows/utils.sh
echo "VERSION_FILE=porespy/__version__.py" >> $GITHUB_ENV
echo "SETUP_CFG_FILE=setup.cfg" >> $GITHUB_ENV
echo "${{ github.event.head_commit.message }}"
- name: Install dependencies
run: |
pip install bump2version
pip install -e .[build]
- name: Bump version (build)
- name: Bump version (dev)
run: |
source .github/workflows/utils.sh
bump_version build $VERSION_FILE
# Note that we don't want to create a new tag for "builds"
# - name: Commit files
# run: |
# REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
# remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PUSH_ACTION_TOKEN }}@github.com/${REPOSITORY}.git"

# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"

# # Commit version bump to dev ([no ci] to avoid infinite loop)
# git commit -m "Bump version number (build) [no ci]" -a
# git push "${remote_repo}" dev
hatch version dev
- name: Commit files
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Bump version number (build part)
commit_author: Author <actions@github.com>
commit_message: Bump version number (dev segment)
commit_author: GitHub Actions <actions@github.com>
39 changes: 13 additions & 26 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,44 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

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

- name: Set env variables
run: |
# The next line is very important, otherwise the line after triggers
# git to track the permission change, which breaks bump2version API (needs clean git folder)
git config core.filemode false
chmod +x .github/workflows/utils.sh
echo "VERSION_FILE=porespy/__version__.py" >> $GITHUB_ENV
echo "SETUP_CFG_FILE=setup.cfg" >> $GITHUB_ENV
echo "${{ github.event.head_commit.message }}"
- name: Install dependencies
run: |
pip install bump2version
pip install -e .[build]
- name: Bump version (patch)
if: contains(github.event.head_commit.message, '#patch')
run: |
source .github/workflows/utils.sh
bump_version patch $VERSION_FILE
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
hatch version patch
echo "TAG_NEW=v$(hatch version)" >> $GITHUB_ENV
- name: Bump version (minor)
if: contains(github.event.head_commit.message, '#minor')
run: |
source .github/workflows/utils.sh
bump_version minor $VERSION_FILE
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
hatch version minor
echo "TAG_NEW=v$(hatch version)" >> $GITHUB_ENV
- name: Bump version (major)
if: contains(github.event.head_commit.message, '#major')
run: |
source .github/workflows/utils.sh
bump_version major $VERSION_FILE
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
hatch version major
echo "TAG_NEW=v$(hatch version)" >> $GITHUB_ENV
- name: Commit files
if:
if: |
contains(github.event.head_commit.message, '#patch') ||
contains(github.event.head_commit.message, '#minor') ||
contains(github.event.head_commit.message, '#major')
Expand All @@ -68,7 +59,7 @@ jobs:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# commit version bump to release
# Commit version bump to release
git commit -m "Bump version number" -a
git push "${remote_repo}" release
Expand All @@ -77,18 +68,14 @@ jobs:
with:
source_branch: "release" # If blank, default: triggered branch
destination_branch: "dev" # If blank, default: master
pr_title: "Don't forget to merge release back into dev!"
pr_title: "Merge release -> dev to propagate version number bump"
pr_body: "Changes made to the release branch (e.g. hotfixes), plus the version bump."
pr_assignee: "jgostick,ma-sadeghi" # Comma-separated list (no spaces)
pr_label: "high priority" # Comma-separated list (no spaces)
pr_draft: false # Creates pull request as draft
pr_allow_empty: true # Creates pull request even if there are no changes
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Trim the 4th digit from the tag
run:
echo "TAG_NEW=${TAG_NEW%.dev?}" >> $GITHUB_ENV

- name: Create new tag
run: |
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Clean up tags
run: |
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,39 @@ jobs:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.8']
python-version: ['3.10']
operating-system: [ubuntu-latest]
# Next line should be [1, 2, ..., max-parallel)
test_group: [1, 2, 3, 4, 5]

steps:
- uses: actions/checkout@v2
- uses: FedericoCarboni/setup-ffmpeg@v2
- uses: actions/checkout@v4
- uses: FedericoCarboni/setup-ffmpeg@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies (pip)
run: |
pip install -r requirements.txt
pip install -r requirements/tests.txt
pip install -r requirements/examples.txt
pip install -e .[test,extras]
- name: Running tests
# Make sure to pass max-parallel to --splits
run: |
pytest examples/ \
pytest \
-p no:python \
--nbval-lax \
--splits ${{ strategy.max-parallel}} \
--group ${{ matrix.test_group }} \
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,27 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'

- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies (conda)
run: |
pip install -r requirements.txt
pip install -r requirements/docs.txt
pip install -e .[docs,interactive]
# Build the documentation
- name: Build the documentation
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/logger.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,23 @@ function filter_commits_by_label {
temp=$(echo "${commits}" | grep -E --ignore-case "$exclude_labels")
# Strip empty lines (that might include tabs, spaces, etc.)
temp=$(echo "${temp}" | sed -r '/^\s*$/d')
# Make each line a bullet point by appending "- " to lines
temp=$(echo "${temp}" | sed -e 's/^/- /')
# Make each line a bullet point by appending "- " to lines if not already present
temp=$(echo "${temp}" | sed -e 's/^\(\s*\)\(\-\s\)\?/\1- /')
# Remove the specific tag at the end of each line
temp=$(echo "${temp}" | sed -r "s/\s$exclude_labels\b//g")
echo "$temp"
}

function filter_commits_exclude_label {
local temp
local commits=$1 # fetch the first argument
local exclude_labels=$2 # fetch the second argument
# Reverse filter commits by the given labels (i.e. exclude labels)
# Reverse filter commits by the given labels (i.e., exclude labels)
temp=$(echo "$commits" | grep -v -E --ignore-case "$exclude_labels")
# Strip empty lines (that might include tabs, spaces, etc.)
temp=$(echo "${temp}" | sed -r '/^\s*$/d')
# Make each line a bullet point by appending "- " to lines
temp=$(echo "${temp}" | sed -e 's/^/- /')
# Make each line a bullet point by appending "- " to lines if not already present
temp=$(echo "${temp}" | sed -e 's/^\(\s*\)\(\-\s\)\?/\1- /')
echo "$temp"
}

Expand All @@ -53,9 +55,7 @@ function filter_commits_by_tag_interval {

function append_to_entry_with_label {
if [ "$(is_empty "$1")" == "false" ]; then
echo "### $3" >> $2
echo "${1}" >> $2
echo "" >> $2
printf "### %s\n\n%s\n\n" "$3" "$1" >> $2
fi
}

Expand Down Expand Up @@ -93,7 +93,7 @@ if test -f CHANGELOG.md; then
fi

# Compile change log
echo -e "## ${tag_new}\n" >> entry
printf "## %s\n\n" "${tag_new}" >> entry
append_to_entry_with_label "$features" entry ":rocket: New features"
append_to_entry_with_label "$enhancements" entry ":cake: Enhancements"
append_to_entry_with_label "$maintenance" entry ":wrench: Maintenace"
Expand All @@ -102,9 +102,9 @@ append_to_entry_with_label "$fixes" entry ":bug: Bugfixes"
append_to_entry_with_label "$documentation" entry ":green_book: Documentation"
append_to_entry_with_label "$uncategorized" entry ":question: Uncategorized"

echo "$(<entry)"
cat entry

# Modify CHANGELOG.md to reflect new changes
echo -e "# Change log\n" >> CHANGELOG.md
echo "$(<entry)" >> CHANGELOG.md
printf "# Change log\n\n" >> CHANGELOG.md
cat entry >> CHANGELOG.md
rm entry
Loading

0 comments on commit b0c4f46

Please sign in to comment.