Skip to content

Commit 1b7c16e

Browse files
authored
Merge pull request #547 from MiraGeoscience/release/0.9.0
GEOPY-1489: merge Release/0.9.0 to main
2 parents 6b8bcf6 + b4d03b9 commit 1b7c16e

File tree

142 files changed

+9345
-2887
lines changed

Some content is hidden

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

142 files changed

+9345
-2887
lines changed

.codespellignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ba
2+
nd

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "monthly"
12+
target-branch: "develop"

.github/workflows/issue_to_jira.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# Additional fields in JSON format
2929
fields: '{"components": [{"name": "geoh5py"}]}'
3030
- name: Post JIRA link
31-
uses: peter-evans/create-or-update-comment@v3
31+
uses: peter-evans/create-or-update-comment@v4
3232
with:
3333
# The number of the issue or pull request in which to create a comment.
3434
issue-number: ${{ github.event.issue.number }}

.github/workflows/pr_add_jira_summary.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ jobs:
1919
PR_TITLE: ${{ github.event.pull_request.title }}
2020
run: >
2121
echo $HEAD_REF $PR_TITLE
22-
| echo "issue_key=$(grep -os "\b\(GA\|GEOPY\)-[0-9]\+" | head -n1)" >> $GITHUB_OUTPUT
22+
| echo "issue_key=$(
23+
grep -osi "\b\(GA\|GEOPY\|DEVOPS\)[ #-]*[0-9]\+"
24+
| head -n1
25+
| sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i"
26+
| tr [:lower:] [:upper:]
27+
)"
28+
>> $GITHUB_OUTPUT
2329
- name: Get JIRA summary
2430
id: get_jira_summary
2531
if: ${{ steps.find_jira_key.outputs.issue_key }}
@@ -31,18 +37,26 @@ jobs:
3137
-H "Authorization: Basic $JIRA_BASIC_AUTH"
3238
-H "Content-Type: application/json"
3339
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}"
34-
| echo "summary=$(jq -r '.fields.summary')" >> $GITHUB_OUTPUT
40+
| echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT
41+
- name: Extract PR title
42+
id: get_pr_title
43+
env:
44+
PR_TITLE: ${{ github.event.pull_request.title }}
45+
run: |
46+
echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT
3547
- name: Add comment
3648
if: ${{ steps.find_jira_key.outputs.issue_key }}
3749
env:
3850
ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }}
51+
TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }}
3952
PR_BODY: ${{ github.event.pull_request.body }}
4053
run: >
4154
jq
4255
--arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}"
4356
--arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)"
57+
--arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})"
4458
--arg PR_BODY "$(cat <<< $PR_BODY)"
45-
-c '."body"="**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY' <<< {}
59+
-c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {}
4660
| curl -sS -X POST -d @-
4761
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
4862
-H "Content-Type: application/json"

.github/workflows/pytest-unix-os.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ name: pytest on Unix OS
22

33
on:
44
pull_request:
5-
branches:
6-
- develop
7-
- main
8-
- release/**
9-
- feature/**
10-
- hotfix/**
5+
types: [opened, synchronize, reopened, ready_for_review]
116
push:
127
branches:
138
- develop
@@ -20,16 +15,14 @@ concurrency:
2015
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2116
cancel-in-progress: true
2217

23-
env:
24-
source_dir: geoh5py
25-
2618
jobs:
2719
pytest:
2820
name: pytest
21+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2922
strategy:
3023
fail-fast: false
3124
matrix:
32-
python_ver: ['3.8', '3.9', '3.10']
25+
python_ver: ['3.9', '3.10']
3326
os: [ubuntu-latest, macos-latest]
3427
runs-on: ${{ matrix.os }}
3528
defaults:
@@ -39,9 +32,9 @@ jobs:
3932
POETRY_VIRTUALENVS_CREATE: true
4033
POETRY_VIRTUALENVS_IN_PROJECT: true
4134
steps:
42-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
4336
- name: Set up Python version
44-
uses: actions/setup-python@v4
37+
uses: actions/setup-python@v5
4538
with:
4639
python-version: ${{ matrix.python_ver }}
4740
- name: Get full Python version
@@ -52,7 +45,7 @@ jobs:
5245
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python -
5346
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
5447
- name: Set up cache
55-
uses: actions/cache@v3
48+
uses: actions/cache@v4
5649
id: cache
5750
env:
5851
# Increase this value to reset cache if poetry.lock has not changed

.github/workflows/pytest-windows.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ name: pytest on Windows
22

33
on:
44
pull_request:
5-
branches:
6-
- develop
7-
- main
8-
- release/**
9-
- feature/**
10-
- hotfix/**
5+
types: [opened, synchronize, reopened, ready_for_review]
116
push:
127
branches:
138
- develop
@@ -20,16 +15,14 @@ concurrency:
2015
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2116
cancel-in-progress: true
2217

23-
env:
24-
source_dir: geoh5py
25-
2618
jobs:
2719
pytest:
2820
name: pytest (Windows)
21+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2922
strategy:
3023
fail-fast: false
3124
matrix:
32-
python_ver: ['3.8', '3.9', '3.10']
25+
python_ver: ['3.9', '3.10']
3326
defaults:
3427
run:
3528
shell: bash
@@ -38,9 +31,9 @@ jobs:
3831
POETRY_VIRTUALENVS_CREATE: true
3932
POETRY_VIRTUALENVS_IN_PROJECT: true
4033
steps:
41-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
4235
- name: Set up Python version
43-
uses: actions/setup-python@v4
36+
uses: actions/setup-python@v5
4437
with:
4538
python-version: ${{ matrix.python_ver }}
4639
- name: Get full Python version
@@ -51,7 +44,7 @@ jobs:
5144
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python -
5245
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
5346
- name: Set up cache
54-
uses: actions/cache@v3
47+
uses: actions/cache@v4
5548
id: cache
5649
env:
5750
# Increase this value to reset cache if poetry.lock has not changed
@@ -68,6 +61,8 @@ jobs:
6861
run: poetry run pytest --cov --cov-report=xml
6962
- name: Codecov
7063
if: ${{ success() && matrix.python_ver == '3.10' }}
71-
uses: codecov/codecov-action@v3
64+
uses: codecov/codecov-action@v4
7265
with:
7366
name: GitHub
67+
fail_ci_if_error: true
68+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: static analysis
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -26,6 +27,7 @@ env:
2627
jobs:
2728
pylint:
2829
name: pylint
30+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2931
runs-on: ubuntu-latest
3032
defaults:
3133
run:
@@ -34,9 +36,9 @@ jobs:
3436
POETRY_VIRTUALENVS_CREATE: true
3537
POETRY_VIRTUALENVS_IN_PROJECT: true
3638
steps:
37-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
3840
- name: Set up Python version
39-
uses: actions/setup-python@v4
41+
uses: actions/setup-python@v5
4042
with:
4143
python-version: 3.9
4244
- name: Get full Python version
@@ -48,7 +50,7 @@ jobs:
4850
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python -
4951
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
5052
- name: Set up cache
51-
uses: actions/cache@v3
53+
uses: actions/cache@v4
5254
id: cache
5355
env:
5456
# Increase this value to reset cache if poetry.lock has not changed

.pre-commit-config.yaml

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11

22
default_language_version:
33
python: python3
4-
exclude: docs/(conf.py|_ext/)
4+
exclude: ^docs/(conf.py|_ext/)
55
default_stages: [commit,push]
66
fail_fast: false
77

88
ci:
99
skip: [pylint]
10+
autoupdate_branch: develop
11+
autoupdate_schedule: monthly
1012

1113
repos:
12-
- repo: https://github.com/psf/black
13-
rev: 23.7.0
14+
- repo: https://github.com/python-poetry/poetry
15+
rev: 1.8.0
1416
hooks:
15-
- id: black
16-
types: [text]
17-
types_or: [python, pyi]
17+
- id: poetry-check
18+
args: [--lock]
19+
- repo: https://github.com/hadialqattan/pycln
20+
rev: v2.4.0
21+
hooks:
22+
- id: pycln
23+
args: [--config=pyproject.toml]
1824
- repo: https://github.com/PyCQA/isort
19-
rev: 5.12.0
25+
rev: 5.13.2
2026
hooks:
2127
- id: isort
2228
additional_dependencies: [tomli] # to read config from pyproject.toml
23-
types: [text]
24-
types_or: [python, pyi]
25-
exclude: geoh5py/objects/__init__\.py
26-
- repo: https://github.com/humitos/mirrors-autoflake
27-
rev: v1.1
29+
- repo: https://github.com/psf/black
30+
rev: 24.4.2
2831
hooks:
29-
- id: autoflake
30-
types: [text]
31-
types_or: [python, pyi]
32+
- id: black
3233
- repo: https://github.com/PyCQA/flake8
33-
rev: 6.1.0
34+
rev: 7.0.0
3435
hooks:
3536
- id: flake8
3637
types: [text]
3738
types_or: [python, pyi]
3839
- repo: https://github.com/asottile/pyupgrade
39-
rev: v3.10.1
40+
rev: v3.15.2
4041
hooks:
4142
- id: pyupgrade
42-
args: [--py37-plus]
43+
args: [--py39-plus]
4344
types: [text]
4445
types_or: [python, pyi]
4546
- repo: https://github.com/pre-commit/mirrors-mypy
46-
rev: v1.5.1
47+
rev: v1.10.0
4748
hooks:
4849
- id: mypy
4950
additional_dependencies: [
50-
types-toml,
51+
# numpy==1.26.*, # TODO: fix mypy errors related to numpy
5152
tomli, # to read config from pyproject.toml
52-
# 'numpy>=1.23.5,<1.24.0'
53+
types-toml,
5354
]
5455
exclude: (geoh5py/interfaces/__init__\.py|geoh5py/handlers/__init__\.py|geoh5py/interfaces|geoh5py/handlers|tests)
5556
- repo: https://github.com/codingjoe/relint
56-
rev: 3.1.0
57+
rev: 3.1.1
5758
hooks:
5859
- id: relint
5960
args: [-W] # to fail on warnings
60-
exclude: ^setup.py$
6161
- repo: local
6262
hooks:
6363
- id: pylint
@@ -67,26 +67,37 @@ repos:
6767
require_serial: true # pylint does its own parallelism
6868
types: [text]
6969
types_or: [python, pyi]
70-
exclude: ^(setup.py$|(devtools|docs|geoh5py/interfaces|geoh5py/handlers)/)
70+
exclude: ^(devtools|docs|geoh5py/interfaces|geoh5py/handlers)/
7171
- id: check-copyright
7272
name: Check copyright
7373
entry: python devtools/check-copyright.py
7474
language: python
7575
types: [text]
76-
types_or: [python, pyi]
77-
exclude: ^(devtools/|docs/|setup.py)
76+
files: (^LICENSE|^README(|-dev).rst|\.py|\.pyi)$
77+
exclude: (^\.|^docs/)
78+
- id: prepare-commit-msg
79+
stages: [prepare-commit-msg]
80+
name: Prepare commit message
81+
entry: python devtools/git_message_hook.py --prepare
82+
language: python
83+
- id: check-commit-msg
84+
stages: [commit-msg]
85+
name: Check commit message
86+
entry: python devtools/git_message_hook.py --check
87+
language: python
7888
- repo: https://github.com/codespell-project/codespell
79-
rev: v2.2.5
89+
rev: v2.2.6
8090
hooks:
8191
- id: codespell
82-
exclude: (\.ipynb$|^\.github/workflows/issue_to_jira.yml$)
83-
types: [text]
84-
types_or: [python, pyi]
92+
exclude: (\.lock|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
93+
entry: codespell -I .codespellignore
8594
- repo: https://github.com/pre-commit/pre-commit-hooks
86-
rev: v4.4.0
95+
rev: v4.6.0
8796
hooks:
8897
- id: trailing-whitespace
8998
exclude: \.mdj$
99+
- id: check-json
100+
exclude_types: [jupyter]
90101
- id: check-toml
91102
- id: check-yaml
92103
# - id: check-added-large-files # crashing on some configuration. To be investigated
@@ -95,13 +106,24 @@ repos:
95106
- id: debug-statements
96107
- id: detect-private-key
97108
- id: end-of-file-fixer
98-
exclude: \.mdj$
109+
exclude: (^\.idea/.*\.xml|\.mdj)$
99110
- id: mixed-line-ending
111+
exclude: ^\.idea/.*\.xml$
100112
- id: name-tests-test
113+
- id: pretty-format-json
114+
args:
115+
- --autofix
116+
- --indent=4
117+
- --no-sort-keys
118+
- --top-keys
119+
- version,title,icon,documentation,conda_environment,run_command,geoh5,monitoring_directory,workspace_geoh5
120+
exclude_types: [jupyter]
121+
exclude: ^docs/(.*/)?images/
101122
- repo: https://github.com/rstcheck/rstcheck
102-
rev: v6.1.2
123+
rev: v6.2.0
103124
hooks:
104125
- id: rstcheck
126+
exclude: ^THIRD_PARTY_SOFTWARE.rst$
105127
additional_dependencies: [sphinx]
106128
- repo: https://github.com/pre-commit/pygrep-hooks
107129
rev: v1.10.0

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Installation
5757
**geoh5py** is currently written for Python 3.7 or higher, and depends on `NumPy <https://numpy.org/>`_ and
5858
`h5py <https://www.h5py.org/>`_. Users will likely want to also make use of advanced processing
5959
techniques made available under the python ecosystem. We therefore recommend installing
60-
Anaconda to handle the various packages.
60+
`Miniforge <https://github.com/conda-forge/miniforge#download>`_ `(Windows x86_64) <https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe>`_ to handle the various packages.
6161

6262
Install **geoh5py** from PyPI::
6363

0 commit comments

Comments
 (0)