From be3a11e9145ca5a77fdfa245fe6671925e146724 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:14:39 +0200 Subject: [PATCH 01/23] Attempting to switch to poetry --- project.toml | 21 -------- pyproject.toml | 29 +++++++++++ setup.cfg | 2 - setup.py | 127 ------------------------------------------------- 4 files changed, 29 insertions(+), 150 deletions(-) delete mode 100644 project.toml create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/project.toml b/project.toml deleted file mode 100644 index c69c209..0000000 --- a/project.toml +++ /dev/null @@ -1,21 +0,0 @@ -[build-system] -build-backend = "setuptools.build_meta" -requires = ["setuptools >= 40.8", "wheel"] - -[tool.ruff] -select = [ - "E", "F", # the default rules - "T201", # disallow print statements - "B" # pass bugbear -] - #"I001", # isort - #"D"] # pydocstyle -ignore = [ - "B905", # `zip()` without an explicit `strict=` - "B904", # `raise ... from err` seems a bit silly - "B018" # useless expression ideally ignore only on `tests` -] -line-length = 90 - -[tool.ruff.pydocstyle] -convention = "numpy" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5c94d59 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[tool.poetry] +name = "welleng" +version = "0.7.3" +description = "A collection of Well Engineering tools" +authors = ["Jonathan Corcutt "] +license = "Apache 2.0" + +[tool.poetry.dependencies] +python = "^3.9" +numpy = "^1.24.2" +scipy = "^1.10.1" +Pint = "^0.20.1" +PyYAML = "^6.0" +vtk = "^9.2.6" + +[tool.poetry.dev-dependencies] +magnetic-field-calculator = "^1.0.2" +networkx = "^3.0" +openpyxl = "^3.1.2" +pandas = "^1.5.3" +tabulate = "^0.9.0" +trimesh = "^3.21.3" +utm = "^0.7.0" +vedo = "^2023.4.4" +python-fcl = "^0.7.0" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 224a779..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index cb52d9d..0000000 --- a/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -""" -The different setup versions method is shamelessly copied from mikedh's trimesh -Python library - thank you! -""" - -import os -import sys -from setuptools import setup, find_packages - -# load __version__ without importing anything -version_file = os.path.join( - os.path.dirname(__file__), - 'welleng/version.py') -with open(version_file, 'r') as f: - # use eval to get a clean string of version from file - __version__ = eval(f.read().strip().split('=')[-1]) - -with open("README.md", "r") as f: - long_description = f.read() - -# with open("requirements.txt") as f: -# required = f.read().splitlines() - -download_url = f'https://github.com/jonnymaserati/welleng/archive/v{__version__}.tar.gz' - -# If you only want to generate surveys and errors, these are all that's -# required -requirements_default = set([ - 'numpy', - 'scipy', - 'pint', - 'PyYAML', - 'setuptools', - 'vtk' -]) - -# these can be installed without compiling required -requirements_easy = set([ - 'magnetic_field_calculator', # used to get default mag data for survey - 'networkx', - 'openpyxl', - 'pandas', - 'tabulate', - 'trimesh', - 'utm', - 'vedo', -]) - -# this is the troublesome requirement that needs C dependencies -requirements_all = requirements_easy.union([ - 'python-fcl', -]) - -# if someone wants to output a requirements file -# `python setup.py --list-all > requirements.txt` -if '--list-all' in sys.argv: - # will not include default requirements (numpy) - print('\n'.join(requirements_all)) - exit() -elif '--list-easy' in sys.argv: - # again will not include numpy+setuptools - print('\n'.join(requirements_easy)) - exit() - -# if sys.platform == 'win32': -# requirements_all.append('python-fcl-win32') -# else: -# requirements_all.append('python-fcl') - -setup( - name='welleng', - version=__version__, - description='A collection of Well Engineering tools', - long_description=long_description, - long_description_content_type="text/markdown", - url='https://github.com/jonnymaserati/welleng', - download_url=download_url, - keywords=[ - 'well', - 'trajectory', - 'wellpath', - 'wellbore', - 'drilling', - 'drill', - 'error', - 'separation', - 'minimum curvature', - 'iscwsa', - 'owsg', - 'well engineering', - 'wells', - 'drilling engineering', - 'directional drilling', - 'mwd', - 'survey', - 'covariance', - 'digitalization', - 'automation', - 'volve', - 'witsml', - ], - author='Jonathan Corcutt', - author_email='jonnycorcutt@gmail.com', - license='Apache 2.0', - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Natural Language :: English', - 'Topic :: Scientific/Engineering', - ], - # python_requires='>=3.9', - packages=find_packages(exclude=["tests"]), - package_data={ - 'welleng': [ - 'errors/*.yaml', - 'errors/tool_codes/*.yaml', - 'exchange/*.yaml' - ] - }, - install_requires=list(requirements_default), - extras_require={ - 'easy': list(requirements_easy), - 'all': list(requirements_all) - } -) From a4ab8a69c6142de4a95d622404aedb82e7a5dae6 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:18:36 +0200 Subject: [PATCH 02/23] Add numba to dev-dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 5c94d59..68359c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ vtk = "^9.2.6" [tool.poetry.dev-dependencies] magnetic-field-calculator = "^1.0.2" networkx = "^3.0" +numba = "^0.56.4" openpyxl = "^3.1.2" pandas = "^1.5.3" tabulate = "^0.9.0" From 3589c883f7f26d2b69539094edbc49997ce07c5a Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:19:40 +0200 Subject: [PATCH 03/23] Remove requirements.txt --- requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 945c9b4..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file From 72a9847a6e00e4fd855ad74166db922307b9674a Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:36:18 +0200 Subject: [PATCH 04/23] Add extras to project.toml --- pyproject.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 68359c0..0c73a1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,18 +12,18 @@ scipy = "^1.10.1" Pint = "^0.20.1" PyYAML = "^6.0" vtk = "^9.2.6" +magnetic-field-calculator = {version="^1.0.2", extras=["easy", "all"]} +networkx = {version="^3.0", extras=["easy", "all"]} +numba = {version="^0.56.4", extras=["all"]} +openpyxl = {version="^3.1.2", extras=["easy", "all"]} +pandas = {version="^1.5.3", extras=["easy", "all"]} +tabulate = {version="^0.9.0", extras=["easy", "all"]} +trimesh = {version="^3.21.3", extras=["easy", "all"]} +utm = {version="^0.7.0", extras=["easy", "all"]} +vedo = {version="^2023.4.4", extras=["easy", "all"]} +python-fcl = {version="^0.7.0", extras=["all"]} [tool.poetry.dev-dependencies] -magnetic-field-calculator = "^1.0.2" -networkx = "^3.0" -numba = "^0.56.4" -openpyxl = "^3.1.2" -pandas = "^1.5.3" -tabulate = "^0.9.0" -trimesh = "^3.21.3" -utm = "^0.7.0" -vedo = "^2023.4.4" -python-fcl = "^0.7.0" [build-system] requires = ["poetry-core>=1.0.0"] From b4f23b43dc8decc6bb3dd6dd066d5b11cac1c87f Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:44:49 +0200 Subject: [PATCH 05/23] Add extras to project.toml --- pyproject.toml | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0c73a1b..312a730 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,19 +12,42 @@ scipy = "^1.10.1" Pint = "^0.20.1" PyYAML = "^6.0" vtk = "^9.2.6" -magnetic-field-calculator = {version="^1.0.2", extras=["easy", "all"]} -networkx = {version="^3.0", extras=["easy", "all"]} -numba = {version="^0.56.4", extras=["all"]} -openpyxl = {version="^3.1.2", extras=["easy", "all"]} -pandas = {version="^1.5.3", extras=["easy", "all"]} -tabulate = {version="^0.9.0", extras=["easy", "all"]} -trimesh = {version="^3.21.3", extras=["easy", "all"]} -utm = {version="^0.7.0", extras=["easy", "all"]} -vedo = {version="^2023.4.4", extras=["easy", "all"]} -python-fcl = {version="^0.7.0", extras=["all"]} +magnetic-field-calculator = {version="^1.0.2", optional=true} +networkx = {version="^3.0", optional=true} +numba = {version="^0.56.4", optional=true} +openpyxl = {version="^3.1.2", optional=true} +pandas = {version="^1.5.3", optional=true} +tabulate = {version="^0.9.0", optional=true} +trimesh = {version="^3.21.3", optional=true} +utm = {version="^0.7.0", optional=true} +vedo = {version="^2023.4.4", extroptional=true} +python-fcl = {version="^0.7.0", optional=true} [tool.poetry.dev-dependencies] +[tool.poetry.extras] +easy = [ + "magnetic-field-calculator", + "networkx", + "openpyxl", + "pandas", + "tabulate", + "trimesh", + "utm", + "vedo" +] +advanced = [ + "magnetic-field-calculator", + "networkx", + "openpyxl", + "pandas", + "tabulate", + "trimesh", + "utm", + "vedo", + "python-fcl" +] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From b63925283b3ec81e71c66aef42c05b172ae7c7ee Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:55:12 +0200 Subject: [PATCH 06/23] Add extras to project.toml --- pyproject.toml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 312a730..8d0435f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,27 +26,10 @@ python-fcl = {version="^0.7.0", optional=true} [tool.poetry.dev-dependencies] [tool.poetry.extras] -easy = [ - "magnetic-field-calculator", - "networkx", - "openpyxl", - "pandas", - "tabulate", - "trimesh", - "utm", - "vedo" -] -advanced = [ - "magnetic-field-calculator", - "networkx", - "openpyxl", - "pandas", - "tabulate", - "trimesh", - "utm", - "vedo", - "python-fcl" -] +easy = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", + "tabulate", "trimesh", "utm", "vedo"] +advanced = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", + "tabulate", "trimesh", "utm", "vedo", "python-fcl"] [build-system] requires = ["poetry-core>=1.0.0"] From 20e60c0b50193fb54c4e0245aba2cfc766767888 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:56:01 +0200 Subject: [PATCH 07/23] Add extras to project.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d0435f..8638fa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ utm = {version="^0.7.0", optional=true} vedo = {version="^2023.4.4", extroptional=true} python-fcl = {version="^0.7.0", optional=true} -[tool.poetry.dev-dependencies] +# [tool.poetry.dev-dependencies] [tool.poetry.extras] easy = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", From b8c038583ef4f2639e90aa78e96de06e0f770537 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:57:57 +0200 Subject: [PATCH 08/23] Add extras to project.toml --- pyproject.toml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8638fa1..f108d4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,24 +12,6 @@ scipy = "^1.10.1" Pint = "^0.20.1" PyYAML = "^6.0" vtk = "^9.2.6" -magnetic-field-calculator = {version="^1.0.2", optional=true} -networkx = {version="^3.0", optional=true} -numba = {version="^0.56.4", optional=true} -openpyxl = {version="^3.1.2", optional=true} -pandas = {version="^1.5.3", optional=true} -tabulate = {version="^0.9.0", optional=true} -trimesh = {version="^3.21.3", optional=true} -utm = {version="^0.7.0", optional=true} -vedo = {version="^2023.4.4", extroptional=true} -python-fcl = {version="^0.7.0", optional=true} - -# [tool.poetry.dev-dependencies] - -[tool.poetry.extras] -easy = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", - "tabulate", "trimesh", "utm", "vedo"] -advanced = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", - "tabulate", "trimesh", "utm", "vedo", "python-fcl"] [build-system] requires = ["poetry-core>=1.0.0"] From d72789db732235b15950db7e57bdfaee36874159 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:58:46 +0200 Subject: [PATCH 09/23] Add extras to project.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f108d4b..cb6db37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ scipy = "^1.10.1" Pint = "^0.20.1" PyYAML = "^6.0" vtk = "^9.2.6" +magnetic-field-calculator = {version="^1.0.2", optional=true} [build-system] requires = ["poetry-core>=1.0.0"] From d76c96458fba21183bfba2fcc02f92fa6b4f3daf Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 14:59:54 +0200 Subject: [PATCH 10/23] Add extras to project.toml --- pyproject.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cb6db37..663c88a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,15 @@ Pint = "^0.20.1" PyYAML = "^6.0" vtk = "^9.2.6" magnetic-field-calculator = {version="^1.0.2", optional=true} +networkx = {version="^3.0", optional=true} +numba = {version="^0.56.4", optional=true} +openpyxl = {version="^3.1.2", optional=true} +pandas = {version="^1.5.3", optional=true} +tabulate = {version="^0.9.0", optional=true} +trimesh = {version="^3.21.3", optional=true} +utm = {version="^0.7.0", optional=true} +vedo = {version="^2023.4.4", optional=true} +python-fcl = {version="^0.7.0", optional=true} [build-system] requires = ["poetry-core>=1.0.0"] From 8d197e935a9af3633602b6765b3c9845f587bfb3 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 15:03:05 +0200 Subject: [PATCH 11/23] Add extras to project.toml --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 663c88a..38de2e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ PyYAML = "^6.0" vtk = "^9.2.6" magnetic-field-calculator = {version="^1.0.2", optional=true} networkx = {version="^3.0", optional=true} -numba = {version="^0.56.4", optional=true} openpyxl = {version="^3.1.2", optional=true} pandas = {version="^1.5.3", optional=true} tabulate = {version="^0.9.0", optional=true} @@ -23,6 +22,15 @@ utm = {version="^0.7.0", optional=true} vedo = {version="^2023.4.4", optional=true} python-fcl = {version="^0.7.0", optional=true} +[tool.poetry.dev-dependencies] +numba = {version="^0.56.4", optional=true} + +[tool.poetry.extras] +easy = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", + "tabulate", "trimesh", "utm", "vedo"] +advanced = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", + "tabulate", "trimesh", "utm", "vedo", "python-fcl"] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 774d37b6041176d7fd9d1785b5dccc1a6901a45a Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 15:34:38 +0200 Subject: [PATCH 12/23] Add details to project.toml --- pyproject.toml | 44 +++++++++++++++++++++++++++++++++++++++++++- welleng/survey.py | 7 +++++-- welleng/version.py | 4 +++- welleng/visual.py | 5 ++++- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 38de2e8..26c1bdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,49 @@ name = "welleng" version = "0.7.3" description = "A collection of Well Engineering tools" authors = ["Jonathan Corcutt "] -license = "Apache 2.0" +license = "Apache-2.0" +readme = "README.md" +homepage = "https://github.com/jonnymaserati/welleng" +repository = "https://github.com/python-poetry/poetry" +documentation = "https://jonnymaserati.github.io/welleng/build/html/index.html" +keywords = [ + "well", + "trajectory", + "wellpath", + "wellbore", + "drilling", + "drill", + "error", + "separation", + "minimum curvature", + "iscwsa", + "owsg", + "well engineering", + "wells", + "drilling engineering", + "directional drilling", + "mwd", + "survey", + "covariance", + "digitalization", + "automation", + "volve", + "witsml", +] +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Natural Language :: English", + "Topic :: Scientific/Engineering", +] +include = [ + {path = "errors/*.yaml"}, + {path = "errors/tool_codes/*.yaml"}, + {path = "exchange/*.yaml"} +] +exclude = ["tests"] [tool.poetry.dependencies] python = "^3.9" diff --git a/welleng/survey.py b/welleng/survey.py index 52f8f8f..1ada792 100644 --- a/welleng/survey.py +++ b/welleng/survey.py @@ -10,7 +10,10 @@ from scipy.optimize import minimize from scipy.spatial.transform import Rotation as R -from .version import __version__ +import importlib.metadata +VERSION = importlib.metadata.version('ProjectName') + +# from .version import __version__ from .utils import ( MinCurve, get_nev, @@ -1930,7 +1933,7 @@ def export_csv( author = kwargs.get('author', 'Jonny Corcutt') comments = [ - f"welleng, version: {__version__}\n" + f"welleng, version: {VERSION}\n" f"author, {author}\n" ] comments.extend([ diff --git a/welleng/version.py b/welleng/version.py index 1ef1319..2f8d81e 100644 --- a/welleng/version.py +++ b/welleng/version.py @@ -1 +1,3 @@ -__version__ = '0.7.3' +import importlib.metadata + +__version__ = importlib.metadata.version('ProjectName') # in case I missed one diff --git a/welleng/visual.py b/welleng/visual.py index e7fde1b..baed0db 100644 --- a/welleng/visual.py +++ b/welleng/visual.py @@ -24,7 +24,10 @@ vtkRenderWindow, vtkRenderWindowInteractor, vtkRenderer ) -from .version import __version__ as VERSION +import importlib.metadata +VERSION = importlib.metadata.version('ProjectName') + +# from .version import __version__ as VERSION # VEDO = False From 47cfdccaed748e8be40fc9462c4b74e7ec1c9a93 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 15:51:50 +0200 Subject: [PATCH 13/23] Update GitHub workflow for poetry --- .github/workflows/python-package.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0a3b023..b291f66 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,7 +37,12 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test a minimal install run: | - pip install . + python -m pip install -U pip poetry + poetry --version + poetry check --no-interaction + poetry config virtualenvs.in-project true + poetry install --no-interaction + # pip install . python tests/test_minimal.py - name: Install APT and dependencies On Linux run: | From 82685956b057d9da2c599c53ccb4d9d46b117c5f Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 15:55:05 +0200 Subject: [PATCH 14/23] Remove numba dependency - causing conflicts and it's not necessary --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 26c1bdb..3e8b7eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ vedo = {version="^2023.4.4", optional=true} python-fcl = {version="^0.7.0", optional=true} [tool.poetry.dev-dependencies] -numba = {version="^0.56.4", optional=true} +# numba = {version="^0.56.4", optional=true} [tool.poetry.extras] easy = ["magnetic-field-calculator", "networkx", "openpyxl", "pandas", From 1d8e3c1e6a73882b77b006ea537056bd166c0f8e Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 16:00:33 +0200 Subject: [PATCH 15/23] Python version issues with dependencies --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b291f66..b7fdc7c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10'] + python-version: ['3.9'] steps: - uses: actions/checkout@v3 From 73871b9f943db15aa7eba274fbbeae59804d631e Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 16:05:53 +0200 Subject: [PATCH 16/23] Python version issues with dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e8b7eb..864be26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ include = [ exclude = ["tests"] [tool.poetry.dependencies] -python = "^3.9" +python = ">=3.9, <3.12" numpy = "^1.24.2" scipy = "^1.10.1" Pint = "^0.20.1" From 66122a1e911ebb739a9a0173f2ffc73a0aabb407 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 16:49:59 +0200 Subject: [PATCH 17/23] Figured out how to import metadata --- .gitignore | 3 +++ welleng/survey.py | 5 +---- welleng/version.py | 2 +- welleng/visual.py | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c11384c..8d11dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,7 @@ key.asc .~* VERSION* +*.lock +setup.py + test/test_data/*.xlsx \ No newline at end of file diff --git a/welleng/survey.py b/welleng/survey.py index 1ada792..786e31d 100644 --- a/welleng/survey.py +++ b/welleng/survey.py @@ -10,10 +10,7 @@ from scipy.optimize import minimize from scipy.spatial.transform import Rotation as R -import importlib.metadata -VERSION = importlib.metadata.version('ProjectName') - -# from .version import __version__ +from .version import __version__ from .utils import ( MinCurve, get_nev, diff --git a/welleng/version.py b/welleng/version.py index 2f8d81e..c4f01ad 100644 --- a/welleng/version.py +++ b/welleng/version.py @@ -1,3 +1,3 @@ import importlib.metadata -__version__ = importlib.metadata.version('ProjectName') # in case I missed one +__version__ = importlib.metadata.version('welleng') # in case I missed one diff --git a/welleng/visual.py b/welleng/visual.py index baed0db..e7fde1b 100644 --- a/welleng/visual.py +++ b/welleng/visual.py @@ -24,10 +24,7 @@ vtkRenderWindow, vtkRenderWindowInteractor, vtkRenderer ) -import importlib.metadata -VERSION = importlib.metadata.version('ProjectName') - -# from .version import __version__ as VERSION +from .version import __version__ as VERSION # VEDO = False From 47e8ec6155820c808197e244224e27c622945c0e Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 16:59:32 +0200 Subject: [PATCH 18/23] Fixing numpy dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 864be26..8d3edfd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ exclude = ["tests"] [tool.poetry.dependencies] python = ">=3.9, <3.12" -numpy = "^1.24.2" +numpy = "^1.18" scipy = "^1.10.1" Pint = "^0.20.1" PyYAML = "^6.0" From bdffd9f5c187bca70d0ec66346161d54de70ac49 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 17:05:21 +0200 Subject: [PATCH 19/23] Bad variable name --- welleng/survey.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/welleng/survey.py b/welleng/survey.py index 786e31d..7d763f7 100644 --- a/welleng/survey.py +++ b/welleng/survey.py @@ -10,7 +10,8 @@ from scipy.optimize import minimize from scipy.spatial.transform import Rotation as R -from .version import __version__ +from .version import __version__ as VERSION + from .utils import ( MinCurve, get_nev, From 0f499d0d755e54da0bdb935740f41f169bc16e6a Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 17:10:19 +0200 Subject: [PATCH 20/23] Trying to exclude the tests folder --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d3edfd..c6d016e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,9 @@ include = [ {path = "errors/tool_codes/*.yaml"}, {path = "exchange/*.yaml"} ] -exclude = ["tests"] +exclude = [ + {path = "tests"} +] [tool.poetry.dependencies] python = ">=3.9, <3.12" From a29a2ca05d2abdcc3ee66204c6575a6ecf440434 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 17:13:08 +0200 Subject: [PATCH 21/23] Trying to exclude the tests folder --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c6d016e..3fa20b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ include = [ {path = "exchange/*.yaml"} ] exclude = [ - {path = "tests"} + "tests/*" ] [tool.poetry.dependencies] From 9bf4e153f469a3ea81d7270f1940b0c71af329c6 Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 17:15:38 +0200 Subject: [PATCH 22/23] Trying to exclude the tests folder --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3fa20b8..0789fdc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ include = [ {path = "exchange/*.yaml"} ] exclude = [ - "tests/*" + "tests/*.py" ] [tool.poetry.dependencies] From f728f38e957e2837aa93b4cbaeffcabf8db13dfc Mon Sep 17 00:00:00 2001 From: jonnymaserati Date: Sat, 1 Apr 2023 17:21:59 +0200 Subject: [PATCH 23/23] Update GitHub workflow --- .github/workflows/python-package.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b7fdc7c..cace778 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -23,7 +23,13 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - + - id: cache-dependencies + name: Cache dependencies + uses: actions/cache@v2.1.7 + with: + path: ${{ github.workspace }}/.venv + key: dependencies-${{ hashFiles('**/poetry.lock') }} + restore-keys: dependencies- - name: Install dependencies run: | python -m pip install --upgrade pip