diff --git a/.github/workflows/python_deploy_dev.yml b/.github/workflows/python_deploy_dev.yml index ee32a166..5c681284 100644 --- a/.github/workflows/python_deploy_dev.yml +++ b/.github/workflows/python_deploy_dev.yml @@ -21,7 +21,7 @@ jobs: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} call-workflow-pypi-publish: - name: Publish development pypi package (JFrog Artifactory and TestPyPI) + name: Publish development pypi package (JFrog Artifactory, TestPyPI) uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main with: package-manager: 'poetry' diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 27c73b97..7813ef40 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -33,7 +33,7 @@ jobs: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} call-workflow-pypi-release: - name: Publish production PyPI package (JFrog Artifactory and PyPI) + name: Publish production PyPI package (JFrog Artifactory, PyPI) if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }} uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main with: diff --git a/.idea/copyright/GMG.xml b/.idea/copyright/GMG.xml new file mode 100644 index 00000000..f32445b3 --- /dev/null +++ b/.idea/copyright/GMG.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/MiraGeoscience.xml b/.idea/copyright/MiraGeoscience.xml new file mode 100644 index 00000000..2d6a4985 --- /dev/null +++ b/.idea/copyright/MiraGeoscience.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..0313fd03 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/sources.xml b/.idea/scopes/sources.xml index ac2cbbb6..f4755295 100644 --- a/.idea/scopes/sources.xml +++ b/.idea/scopes/sources.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32c89854..4dc9ef07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,12 @@ repos: - id: poetry-check args: [--lock] - repo: https://github.com/hadialqattan/pycln - rev: v2.4.0 + rev: v2.5.0 hooks: - id: pycln args: [--config=pyproject.toml] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.9.0 hooks: - id: ruff args: @@ -31,7 +31,7 @@ repos: # - --unsafe-fixes - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.12.0 + rev: v1.14.1 hooks: - id: mypy additional_dependencies: [ @@ -39,21 +39,42 @@ repos: tomli, # to read config from pyproject.toml types-six, types-toml, + types-PyYAML ] files: ^(omf/fileio/geoh5\.py$|omf/scripts/|tests/) exclude: ^docs/ - repo: https://github.com/codingjoe/relint - rev: 3.2.0 + rev: 3.3.1 hooks: - id: relint args: [-W] # to fail on warnings files: ^(omf/fileio/geoh5\.py$|omf/scripts/|tests/) - repo: https://github.com/MiraGeoscience/pre-commit-hooks - rev: v1.0.1 + rev: v1.0.2 hooks: -# - id: check-copyright # no copyright nor license notice: differ to upstream repo -# files: ^(omf/fileio/geoh5\.py$|omf/scripts/|tests/) + - id: check-copyright + files: (^package\.rst|^LICENSE|^README(|-dev)\.rst|\.py|\.pyi)$ + # do not check sources from the original omf package + exclude: | + (?x)( + ^\..*| + ^docs/.*| + omf/( + fileio/__init__| + fileio/fileio| + fileio/utils| + base| + data| + lineset| + pointset| + serializers| + surface| + texture| + volume)\.py| + tests/doc_example_test\.py + )$ - id: prepare-commit-msg + - id: check-commit-msg - repo: local hooks: - id: pylint diff --git a/LICENSE b/LICENSE index 79729d2b..3833ab50 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2017 Global Mining Standards and Guidelines Group +Copyright (c) 2022-2025 Mira Geoscience Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.rst b/README.rst index 2c746f5b..fe854da0 100644 --- a/README.rst +++ b/README.rst @@ -63,7 +63,7 @@ This library makes use of the `properties `_. -Connection to the geoh5 format makes use of `geoh5py `_ +Connection to the geoh5 format makes use of `geoh5py `_ publicly supported by `Mira Geoscience `_ Installation @@ -89,7 +89,8 @@ License ^^^^^^^ MIT License -Copyright (c) 2024 Mira Geoscience +Copyright (c) 2017 Global Mining Standards and Guidelines Group +Copyright (c) 2022-2025 Mira Geoscience Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/meta.yaml b/meta.yaml index 4941be5c..6b3363e8 100644 --- a/meta.yaml +++ b/meta.yaml @@ -15,7 +15,7 @@ build: requirements: host: - - python >=3.10.0,<3.11 + - python >=3.10.0,<4.0.0 - poetry-core >=1.0.0 - setuptools - pip @@ -26,7 +26,7 @@ requirements: - pypng 0.20220715.* - six >=1.16.0 - vectormath >=0.2.0 - - geoh5py >=0.9.1a0.dev0,<0.11.0a0.dev0 + - geoh5py >=0.10.0b1,<0.11.0a.dev about: license: MIT diff --git a/omf/__init__.py b/omf/__init__.py index 804cfadf..9de0d1be 100644 --- a/omf/__init__.py +++ b/omf/__init__.py @@ -1,5 +1,19 @@ """omf: API library for Open Mining Format file interchange format""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2022-2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging import sys @@ -31,9 +45,12 @@ __version__ = "3.4.0-alpha.1" -__author__ = "Global Mining Standards and Guidelines Group" +__author__ = "Global Mining Standards and Guidelines Group, Mira Geoscience Ltd." __license__ = "MIT License" -__copyright__ = "Copyright 2017 Global Mining Standards and Guidelines Group" +__copyright__ = ( + "Copyright 2017 Global Mining Standards and Guidelines Group, " + "Copyright 2022-2025 Mira Geoscience Ltd." +) def _create_logger(): diff --git a/omf/base.py b/omf/base.py index 983da60c..b1a76611 100644 --- a/omf/base.py +++ b/omf/base.py @@ -1,5 +1,15 @@ """base.py: OMF Project and base classes for its components""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import datetime diff --git a/omf/data.py b/omf/data.py index 5d41a45f..3cd34a28 100644 --- a/omf/data.py +++ b/omf/data.py @@ -1,5 +1,15 @@ """data.py: different ProjectElementData classes""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/fileio/__init__.py b/omf/fileio/__init__.py index ac53c272..0e87312f 100644 --- a/omf/fileio/__init__.py +++ b/omf/fileio/__init__.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from .fileio import OMFReader, OMFWriter from .geoh5 import GeoH5Writer from .utils import compare_elements diff --git a/omf/fileio/fileio.py b/omf/fileio/fileio.py index 0ad7dd13..bd214e95 100644 --- a/omf/fileio/fileio.py +++ b/omf/fileio/fileio.py @@ -1,5 +1,15 @@ """fileio.py: OMF Writer and Reader for serializing to and from .omf files""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import json diff --git a/omf/fileio/geoh5.py b/omf/fileio/geoh5.py index 54d3bcc1..143525fa 100644 --- a/omf/fileio/geoh5.py +++ b/omf/fileio/geoh5.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2022-2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + # pylint: disable=too-many-lines from __future__ import annotations diff --git a/omf/fileio/utils.py b/omf/fileio/utils.py index 54f76d1e..c1128530 100644 --- a/omf/fileio/utils.py +++ b/omf/fileio/utils.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from numpy import testing diff --git a/omf/lineset.py b/omf/lineset.py index d40c81d9..eb90d340 100644 --- a/omf/lineset.py +++ b/omf/lineset.py @@ -1,5 +1,15 @@ """lineset.py: LineSet element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/pointset.py b/omf/pointset.py index 64f4c140..e957a5ee 100644 --- a/omf/pointset.py +++ b/omf/pointset.py @@ -1,5 +1,15 @@ """pointset.py: PointSet element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import properties from .base import ProjectElement, ProjectElementGeometry diff --git a/omf/scripts/__init__.py b/omf/scripts/__init__.py index e69de29b..d8b6fd73 100644 --- a/omf/scripts/__init__.py +++ b/omf/scripts/__init__.py @@ -0,0 +1,9 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/omf/scripts/geoh5_to_omf.py b/omf/scripts/geoh5_to_omf.py index c58bcb67..a9412926 100644 --- a/omf/scripts/geoh5_to_omf.py +++ b/omf/scripts/geoh5_to_omf.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import argparse import logging import sys diff --git a/omf/scripts/omf_to_geoh5.py b/omf/scripts/omf_to_geoh5.py index f710ed5b..a0e285df 100644 --- a/omf/scripts/omf_to_geoh5.py +++ b/omf/scripts/omf_to_geoh5.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import argparse import logging import sys diff --git a/omf/serializers.py b/omf/serializers.py index 99c9998d..3715d52d 100644 --- a/omf/serializers.py +++ b/omf/serializers.py @@ -1,5 +1,15 @@ """serializers.py: array and image serializers/deserializers for OMF file IO""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import zlib from io import BytesIO diff --git a/omf/surface.py b/omf/surface.py index 7f3e0aac..cea30fac 100644 --- a/omf/surface.py +++ b/omf/surface.py @@ -1,5 +1,15 @@ """surface.py: Surface element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/texture.py b/omf/texture.py index 631406c7..8f00c902 100644 --- a/omf/texture.py +++ b/omf/texture.py @@ -1,5 +1,15 @@ """texture.py: contains ImageTexture definition""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import properties from .base import ContentModel diff --git a/omf/volume.py b/omf/volume.py index d399e47e..8982fb14 100644 --- a/omf/volume.py +++ b/omf/volume.py @@ -1,5 +1,15 @@ """volume.py: Volume element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/poetry.lock b/poetry.lock index 87bf87a7..86251087 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "alabaster" @@ -919,6 +919,68 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] +[[package]] +name = "pyyaml" +version = "6.0.2" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, +] + [[package]] name = "requests" version = "2.32.3" @@ -1156,4 +1218,4 @@ numpy = ">=1.7" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "799fb8b1f078ae5eba2babf02b8900c7f593f23cebb0a1955e48c4b338e72eb4" +content-hash = "51b1b5d74a9096d0305d6f60b97be9ed3989d7f2f827d8fae2ed9143e466850e" diff --git a/pyproject.toml b/pyproject.toml index f09e7646..a894e33e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,12 +32,12 @@ packages = [ ] include = [ - { path = "COPYING", format = ["sdist", "wheel"] }, - { path = "COPYING.LESSER", format = ["sdist", "wheel"] }, - { path = "LICENSE", format = ["sdist", "wheel"] }, - { path = "README.rst", format = ["sdist", "wheel"] }, - { path = "THIRD_PARTY_SOFTWARE.rst", format = ["sdist", "wheel"] }, - { path = "docs/**/THIRD_PARTY_SOFTWARE.rst", format = ["sdist", "wheel"] }, + { path = "COPYING" }, + { path = "COPYING.LESSER" }, + { path = "LICENSE" }, + { path = "README.rst" }, + { path = "THIRD_PARTY_SOFTWARE.rst" }, + { path = "docs/**/THIRD_PARTY_SOFTWARE.rst" }, ] [tool.poetry.scripts] @@ -48,10 +48,10 @@ omf_to_geoh5 = 'omf.scripts.omf_to_geoh5:main' python = "^3.10" numpy = "~1.26.0" # also in geoh5py -properties = "~0.6.0" +properties = "0.6.*" pypng = "^0.20220715" six = "^1.16" -vectormath = "~0.2.0" +vectormath = "0.2.*" ## dependencies from Git repositories #------------------------------------ @@ -65,6 +65,9 @@ pylint = "*" pytest = "*" pytest-cov = "*" sphinx = "^5.3" +pyyaml = '*' +jinja2 = '*' +packaging = '*' tomli = "*" # for tests only [tool.ruff] diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..d8b6fd73 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,9 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/tests/conftest.py b/tests/conftest.py index 088d863b..4d71bdda 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_curve_test.py b/tests/convert_curve_test.py index bba8f5a3..4094a1c3 100644 --- a/tests/convert_curve_test.py +++ b/tests/convert_curve_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_grid2d_test.py b/tests/convert_grid2d_test.py index 0975ba14..219eff30 100644 --- a/tests/convert_grid2d_test.py +++ b/tests/convert_grid2d_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging from pathlib import Path diff --git a/tests/convert_pointset_test.py b/tests/convert_pointset_test.py index bbc259bc..3ca2cb98 100644 --- a/tests/convert_pointset_test.py +++ b/tests/convert_pointset_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_project_test.py b/tests/convert_project_test.py index 586d12f7..2feca2fc 100644 --- a/tests/convert_project_test.py +++ b/tests/convert_project_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging import os from pathlib import Path diff --git a/tests/convert_surface_test.py b/tests/convert_surface_test.py index 0b33e6eb..407df7c9 100644 --- a/tests/convert_surface_test.py +++ b/tests/convert_surface_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_volume_test.py b/tests/convert_volume_test.py index 913e9323..b0a887d4 100644 --- a/tests/convert_volume_test.py +++ b/tests/convert_volume_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/doc_example_test.py b/tests/doc_example_test.py index 4374b72f..6131451f 100644 --- a/tests/doc_example_test.py +++ b/tests/doc_example_test.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import omf diff --git a/tests/script_geoh5_to_omf_test.py b/tests/script_geoh5_to_omf_test.py index e21705fb..8c6c200f 100644 --- a/tests/script_geoh5_to_omf_test.py +++ b/tests/script_geoh5_to_omf_test.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path from unittest.mock import patch diff --git a/tests/script_omf_to_geoh5_test.py b/tests/script_omf_to_geoh5_test.py index 8ea40236..159607cf 100644 --- a/tests/script_omf_to_geoh5_test.py +++ b/tests/script_omf_to_geoh5_test.py @@ -1,3 +1,14 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +import re from pathlib import Path from unittest.mock import patch @@ -144,7 +155,4 @@ def test_omf_to_geoh5_with_gzip_level_too_high(capsys, tmp_path: Path): assert not output_path.exists() assert captured_exception.value.code == 2 captured_err = capsys.readouterr().err - assert any( - "error: argument --gzip: invalid choice: 10" in line - for line in captured_err.splitlines() - ) + assert re.search(r"error: argument --gzip: invalid choice:", captured_err) diff --git a/tests/version_test.py b/tests/version_test.py index fef69d24..571408d8 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -1,16 +1,29 @@ """Test the version follows SemVer and is consistent across files.""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import re from pathlib import Path import tomli as toml +import yaml +from jinja2 import Template +from packaging.version import Version import omf -def get_version(): +def get_pyproject_version(): path = Path(__file__).resolve().parents[1] / "pyproject.toml" with open(str(path), encoding="utf-8") as file: @@ -19,6 +32,20 @@ def get_version(): return pyproject["tool"]["poetry"]["version"] +def get_conda_recipe_version(): + path = Path(__file__).resolve().parents[1] / "meta.yaml" + + with open(str(path), encoding="utf-8") as file: + content = file.read() + + template = Template(content) + rendered_yaml = template.render() + + recipe = yaml.safe_load(rendered_yaml) + + return recipe["package"]["version"] + + def get_version_in_readme() -> str | None: path = Path(__file__).resolve().parents[1] / "README.rst" @@ -32,7 +59,10 @@ def get_version_in_readme() -> str | None: def test_version_is_consistent(): - assert omf.__version__ == get_version() + assert omf.__version__ == get_pyproject_version() + normalized_conda_version = Version(get_conda_recipe_version()) + normalized_version = Version(omf.__version__) + assert normalized_conda_version == normalized_version def version_base_and_pre() -> tuple[str, str]: