Skip to content

Commit

Permalink
Merge pull request #678 from MiraGeoscience/GEOPY-1468
Browse files Browse the repository at this point in the history
Geopy 1468
  • Loading branch information
domfournier authored Apr 23, 2024
2 parents 30d8ff0 + 3e69082 commit 508ed99
Show file tree
Hide file tree
Showing 277 changed files with 6,806 additions and 23,135 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/pr_add_jira_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}
run: >
echo $HEAD_REF $PR_TITLE
| echo "issue_key=$(grep -os "\b\(GA\|GEOPY\)-[0-9]\+" | head -n1)" >> $GITHUB_OUTPUT
| echo "issue_key=$(
grep -osi "\b\(GA\|GEOPY\)[ #-]*[0-9]\+"
| head -n1
| sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i"
| tr [:lower:] [:upper:]
)"
>> $GITHUB_OUTPUT
- name: Get JIRA summary
id: get_jira_summary
if: ${{ steps.find_jira_key.outputs.issue_key }}
Expand All @@ -31,18 +37,26 @@ jobs:
-H "Authorization: Basic $JIRA_BASIC_AUTH"
-H "Content-Type: application/json"
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}"
| echo "summary=$(jq -r '.fields.summary')" >> $GITHUB_OUTPUT
| echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT
- name: Extract PR title
id: get_pr_title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT
- name: Add comment
if: ${{ steps.find_jira_key.outputs.issue_key }}
env:
ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }}
TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }}
PR_BODY: ${{ github.event.pull_request.body }}
run: >
jq
--arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}"
--arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)"
--arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})"
--arg PR_BODY "$(cat <<< $PR_BODY)"
-c '."body"="**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY' <<< {}
-c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {}
| curl -sS -X POST -d @-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
-H "Content-Type: application/json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python_ver: ['3.9', '3.10']
python_ver: ['3.10']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
env:
PYTHONUTF8: 1
CONDA_LOCK_ENV_FILE: environments/conda-py-${{ matrix.python_ver }}-${{ startsWith(matrix.os, 'macos') && 'osx' || 'linux' }}-64-dev.lock.yml
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
CONDA_CHANNEL_PRIORITY: strict
PIP_NO_DEPS: 1 # all dependencies are installed from conda
CONDA_LOCK_ENV_FILE: environments/py-${{ matrix.python_ver }}-${{ startsWith(matrix.os, 'macos') && 'osx' || 'linux' }}-64-dev.conda.lock.yml
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -50,5 +51,4 @@ jobs:
environment-name: test_env
cache-downloads: true
- name: pytest
run: |
pytest --cov=${source_dir} --cov-report=xml --cov-branch
run: pytest --cov --cov-report=xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python_ver: ['3.9', '3.10']
python_ver: ['3.10']
defaults:
run:
shell: powershell
runs-on: windows-latest
env:
PYTHONUTF8: 1
CONDA_LOCK_ENV_FILE: environments/conda-py-${{ matrix.python_ver }}-win-64-dev.lock.yml
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
CONDA_CHANNEL_PRIORITY: strict
PIP_NO_DEPS: 1 # all dependencies are installed from conda
CONDA_LOCK_ENV_FILE: environments/py-${{ matrix.python_ver }}-win-64-dev.conda.lock.yml
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -50,10 +51,10 @@ jobs:
init-shell: powershell
cache-downloads: true
- name: pytest
run: |
pytest --cov=${source_dir} --cov-report=xml --cov-branch
run: pytest --cov --cov-report=xml
- name: Codecov
if: ${{ success() && matrix.python_ver == '3.9' }}
if: ${{ success() && matrix.python_ver == '3.10' }}
uses: codecov/codecov-action@v3
with:
name: GitHub
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
5 changes: 3 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
shell: bash -l {0}
env:
PYTHONUTF8: 1
CONDA_LOCK_ENV_FILE: environments/conda-py-3.9-linux-64-dev.lock.yml
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
CONDA_CHANNEL_PRIORITY: strict
PIP_NO_DEPS: 1 # all dependencies are installed from conda
CONDA_LOCK_ENV_FILE: environments/py-3.10-linux-64-dev.conda.lock.yml
steps:
- uses: actions/checkout@v4
- name: Setup conda env
Expand Down
6 changes: 4 additions & 2 deletions .idea/copyright/Mira_Geoscience___MIT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/scopes/mira_sources.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .idea/scopes/sources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.6.1
# hooks:
Expand Down Expand Up @@ -92,8 +92,9 @@ repos:
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
exclude: \.mdj$
exclude: (^\.idea/.*\.xml|\.mdj)$
- id: mixed-line-ending
exclude: ^\.idea/.*\.xml$
- id: name-tests-test
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
Expand Down
7 changes: 4 additions & 3 deletions Install_or_Update.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ set ENV_NAME=geoapps
set MY_CONDA=!MY_CONDA_EXE:"=!
cd %~dp0
set PYTHONUTF8=1
set CONDA_CHANNEL_PRIORITY=strict

:: all dependencies are installed from conda
set PIP_NO_DEPS=1

set MY_CONDA_ENV_FILE=environments\conda-py-%PY_VER%-win-64.lock.yml
set MY_CONDA_ENV_FILE=environments\py-%PY_VER%-win-64.conda.lock.yml
if not exist %MY_CONDA_ENV_FILE% (
echo "** ERROR: Could not find the conda environment specification file '%MY_CONDA_ENV_FILE%' **"
pause
exit /B 0
)

call "!MY_CONDA!" activate base ^
&& call "!MY_CONDA!" env create --force -n %ENV_NAME% --file %MY_CONDA_ENV_FILE% ^
&& call "!MY_CONDA!" run -n %ENV_NAME% pip install -e .[core,apps]
&& call "!MY_CONDA!" env create -y --solver libmamba -n %ENV_NAME% --file %MY_CONDA_ENV_FILE% ^
&& call "!MY_CONDA!" run -n %ENV_NAME% pip install --upgrade --force-reinstall .[core,apps]

if !errorlevel! neq 0 (
echo "** ERROR: Installation failed **"
Expand Down
Loading

0 comments on commit 508ed99

Please sign in to comment.