Skip to content

Commit df39be7

Browse files
authored
Merge pull request #59 from MiraGeoscience/release/3.2.0
GEOPY-1489: merge Release/3.2.0 to main
2 parents 2139ba3 + 562db4b commit df39be7

26 files changed

Lines changed: 852 additions & 388 deletions

.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": "OMF"}]}'
3030
- name: Post JIRA link
31-
uses: peter-evans/create-or-update-comment@v2
31+
uses: peter-evans/create-or-update-comment@v3
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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: pytest on Unix OS
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -16,16 +17,14 @@ on:
1617
- feature/**
1718
- hotfix/**
1819

19-
env:
20-
source_dir: omf
21-
2220
jobs:
2321
pytest:
2422
name: pytest (Unix)
23+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2524
strategy:
2625
fail-fast: false
2726
matrix:
28-
python_ver: ['3.8', '3.9', '3.10']
27+
python_ver: ['3.9', '3.10']
2928
os: [ubuntu-latest]
3029
runs-on: ${{ matrix.os }}
3130
defaults:
@@ -62,4 +61,4 @@ jobs:
6261
- name: Install dependencies
6362
run: poetry install -vvv
6463
- name: pytest
65-
run: poetry run pytest --cov-report=xml --cov=${source_dir} --cov-branch --cov-fail-under=79
64+
run: poetry run pytest --cov --cov-report=xml

.github/workflows/pytest-windows.yml

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

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -16,16 +17,14 @@ on:
1617
- feature/**
1718
- hotfix/**
1819

19-
env:
20-
source_dir: omf
21-
2220
jobs:
2321
pytest:
2422
name: pytest (Windows)
23+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2524
strategy:
2625
fail-fast: false
2726
matrix:
28-
python_ver: ['3.8', '3.9', '3.10']
27+
python_ver: ['3.9', '3.10']
2928
defaults:
3029
run:
3130
shell: bash
@@ -61,9 +60,11 @@ jobs:
6160
- name: Install dependencies
6261
run: poetry install -vvv
6362
- name: pytest
64-
run: poetry run pytest --cov-report=xml --cov=${source_dir} --cov-branch --cov-fail-under=79
63+
run: poetry run pytest --cov --cov-report=xml
6564
- name: Codecov
6665
if: ${{ success() && matrix.python_ver == '3.10' }}
67-
uses: codecov/codecov-action@v3
66+
uses: codecov/codecov-action@v4
6867
with:
6968
name: GitHub
69+
fail_ci_if_error: true
70+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 0 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
@@ -22,6 +23,7 @@ env:
2223
jobs:
2324
pylint:
2425
name: pylint
26+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2527
runs-on: ubuntu-latest
2628
defaults:
2729
run:

.pre-commit-config.yaml

Lines changed: 71 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,102 @@
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.3.0
14+
- repo: https://github.com/python-poetry/poetry
15+
rev: 1.8.0
1416
hooks:
15-
- id: black
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]
1624
- repo: https://github.com/PyCQA/isort
17-
rev: 5.12.0
25+
rev: 5.13.2
1826
hooks:
1927
- id: isort
2028
additional_dependencies: [tomli] # to read config from pyproject.toml
21-
- repo: https://github.com/humitos/mirrors-autoflake
22-
rev: v1.1
29+
- repo: https://github.com/psf/black
30+
rev: 24.4.2
2331
hooks:
24-
- id: autoflake
32+
- id: black
2533
- repo: https://github.com/PyCQA/flake8
26-
rev: 6.0.0
34+
rev: 7.0.0
2735
hooks:
2836
- id: flake8
29-
files: ^omf/fileio/geoh5*
37+
files: ^(omf/fileio/geoh5|tests/)
3038
- repo: https://github.com/asottile/pyupgrade
31-
rev: v3.4.0
39+
rev: v3.15.2
3240
hooks:
3341
- id: pyupgrade
34-
args: [--py38-plus]
42+
args: [--py39-plus]
3543
- repo: https://github.com/pre-commit/mirrors-mypy
36-
rev: v1.3.0
44+
rev: v1.10.0
3745
hooks:
3846
- id: mypy
39-
additional_dependencies: [types-six]
40-
args: [--ignore-missing-imports, --scripts-are-modules, --show-error-context,
41-
--show-column-numbers]
42-
files: ^omf/fileio/geoh5*
47+
files: ^(omf/fileio/geoh5|tests/)
48+
additional_dependencies: [
49+
# numpy==1.26.*, # TODO: fix mypy errors related to numpy
50+
tomli, # to read config from pyproject.toml
51+
types-six,
52+
types-toml,
53+
]
54+
exclude: ^docs/
55+
- repo: https://github.com/codingjoe/relint
56+
rev: 3.1.1
57+
hooks:
58+
- id: relint
59+
args: [-W] # to fail on warnings
60+
files: ^omf/fileio/geoh5/
4361
- repo: local
4462
hooks:
4563
- id: pylint
4664
name: pylint
4765
entry: poetry run pylint
4866
language: system
4967
require_serial: true # pylint does its own parallelism
50-
types: [text]
51-
types_or: [python, pyi]
52-
exclude: (devtools|docs)/
68+
types: [python]
5369
files: ^(omf/fileio/geoh5|tests/)
70+
# - id: check-copyright # TODO: add missing copyright statements in source files
71+
# name: Check copyright
72+
# entry: python devtools/check-copyright.py
73+
# language: python
74+
# types: [text]
75+
# exclude: (^\.|^docs/)
76+
# files: ^(LICENSE|README(-dev)?.rst|((devtools|omf/fileio/geoh5|tests)/.*\.pyi?))$
77+
- id: prepare-commit-msg
78+
stages: [prepare-commit-msg]
79+
name: Prepare commit message
80+
entry: python devtools/git_message_hook.py --prepare
81+
language: python
82+
- id: check-commit-msg
83+
stages: [commit-msg]
84+
name: Check commit message
85+
entry: python devtools/git_message_hook.py --check
86+
language: python
5487
- repo: https://github.com/codespell-project/codespell
55-
rev: v2.2.4
88+
rev: v2.2.6
5689
hooks:
5790
- id: codespell
58-
exclude: (\.ipynb$|^poetry.lock$)
91+
exclude: (\.lock|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
5992
entry: codespell -I .codespellignore
6093
- repo: https://github.com/pre-commit/pre-commit-hooks
61-
rev: v4.4.0
94+
rev: v4.6.0
6295
hooks:
6396
- id: trailing-whitespace
6497
exclude: \.mdj$
98+
- id: check-json
99+
exclude_types: [jupyter]
65100
- id: check-toml
66101
- id: check-yaml
67102
# - id: check-added-large-files # crashing on some configuration. To be investigated
@@ -70,13 +105,24 @@ repos:
70105
- id: debug-statements
71106
- id: detect-private-key
72107
- id: end-of-file-fixer
73-
exclude: \.mdj$
108+
exclude: (^\.idea/.*\.xml|\.mdj)$
74109
- id: mixed-line-ending
110+
exclude: ^\.idea/.*\.xml$
75111
- id: name-tests-test
112+
- id: pretty-format-json
113+
args:
114+
- --autofix
115+
- --indent=4
116+
- --no-sort-keys
117+
- --top-keys
118+
- version,title,icon,documentation,conda_environment,run_command,geoh5,monitoring_directory,workspace_geoh5
119+
exclude_types: [jupyter]
120+
exclude: ^docs/(.*/)?images/
76121
- repo: https://github.com/rstcheck/rstcheck
77-
rev: v6.1.2
122+
rev: v6.2.0
78123
hooks:
79124
- id: rstcheck
125+
exclude: ^THIRD_PARTY_SOFTWARE.rst$
80126
additional_dependencies: [sphinx]
81127
- repo: https://github.com/pre-commit/pygrep-hooks
82128
rev: v1.10.0

.relint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- name: No import os.path
2+
pattern: 'from os import\b.*\bpath\b'
3+
hint: Use from pathlib import Path
4+
filePattern: .*\.pyi?
5+
error: false
6+
- name: No os.path
7+
pattern: '\bos\.path\b'
8+
hint: Use pathlib.Path
9+
filePattern: .*\.pyi?
10+
error: false

README.rst

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,13 @@ omf
1818
:alt: pytest
1919

2020

21-
Version: 3.1.0
21+
Version: 3.2.0
2222

2323
API library for Open Mining Format, a new standard for mining data backed by
2424
the `Global Mining Standards & Guidelines Group <https://gmggroup.org/>`_.
2525

26-
.. warning::
27-
**Pre-Release Notice**
28-
29-
This is a Beta release of the Open Mining Format (OMF) and the associated
30-
Python API. The storage format and libraries might be changed in
31-
backward-incompatible ways and are not subject to any SLA or deprecation
32-
policy.
3326

3427
.. warning::
35-
**Alpha-Release Notice**
3628

3729
This is a fork created by Mira Geoscience for interoperability with the
3830
geoh5 file format.
@@ -91,3 +83,39 @@ Or from `github <https://github.com/GMSGDataExchange/omf>`_:
9183
git clone https://github.com/GMSGDataExchange/omf.git
9284
cd omf
9385
pip install -e .
86+
87+
88+
License
89+
^^^^^^^
90+
MIT License
91+
92+
Copyright (c) 2024 Mira Geoscience
93+
94+
Permission is hereby granted, free of charge, to any person obtaining a copy
95+
of this software and associated documentation files (the "Software"), to deal
96+
in the Software without restriction, including without limitation the rights
97+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98+
copies of the Software, and to permit persons to whom the Software is
99+
furnished to do so, subject to the following conditions:
100+
101+
The above copyright notice and this permission notice shall be included in all
102+
copies or substantial portions of the Software.
103+
104+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110+
SOFTWARE.
111+
112+
113+
Third Party Software
114+
^^^^^^^^^^^^^^^^^^^^
115+
The mira-omf Software may provide links to third party libraries or code (collectively “Third Party Software”)
116+
to implement various functions. Third Party Software does not comprise part of the Software.
117+
The use of Third Party Software is governed by the terms of such software license(s).
118+
Third Party Software notices and/or additional terms and conditions are located in the
119+
`THIRD_PARTY_SOFTWARE.rst`_ file.
120+
121+
.. _THIRD_PARTY_SOFTWARE.rst: THIRD_PARTY_SOFTWARE.rst

0 commit comments

Comments
 (0)