Skip to content

Commit

Permalink
Pyproject toml config (#259)
Browse files Browse the repository at this point in the history
* remove redundant gitignore
* move content from setup.py to pyproject.toml
* move version export to Explorer __init__
* update docs: uploader has been moved
* workflows use python 3.10
* use sphinx-build
* remove old requirements txt files
* update readthedocs python build config
  • Loading branch information
equinor-ruaj authored Nov 21, 2023
1 parent 114ccbf commit 8164d5f
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 213 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8.17"]
python-version: ["3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install and build docs
run: |
pip install pip -U && pip install wheel -U
pip install .[docs]
python setup.py build_sphinx
sphinx-build docs build/sphinx/html
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.10"

- name: build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ jobs:
access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv)
export ACCESS_TOKEN=$access_token
pip install -r requirements/requirements_test.txt
pip install pytest>=6.1.1 pytest-timeout
pytest -s --timeout=300
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
11 changes: 6 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
version: 2

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.10"

python:
version: "3.8"
install:
- requirements: requirements/requirements_docs.txt
- method: setuptools
- method: pip
path: .
system_packages: true
extra_requirements:
- docs

sphinx:
configuration: docs/conf.py
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"sumo",
"xtgeo",
"pandas",
"yaml",
"azure",
]

os.environ[
Expand All @@ -44,7 +42,7 @@

apidoc_module_dir = "../src/fmu"
apidoc_output_dir = "apiref"
apidoc_excluded_paths = ["version.py", "hook_implementations"]
apidoc_excluded_paths = ["_version.py", "hook_implementations"]
apidoc_separate_modules = True
apidoc_module_first = True
apidoc_extra_args = ["-H", "API reference for fmu.sumo"]
Expand Down
8 changes: 5 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ Sumo provides a data-backend for services for e.g post-processing.
For documentation of Sumo in the FMU context, see the `Sumo front-end for FMU <https://fmu-sumo.app.radix.equinor.com>`_

``fmu-sumo`` is a Python library for interaction with Sumo in the FMU context. It contains
two modules: The **Uploader** for *writing* data to Sumo during FMU runs, and the
**Explorer** for *reading* data from Sumo in the FMU context.
multiple modules:

* **Explorer** (This module) for *reading* data from Sumo in the FMU context.
* `Uploader <https://github.com/equinor/fmu-sumo-uploader>`_ for *writing* data to Sumo during FMU runs.
* `Sim2sumo <https://github.com/equinor/fmu-sumo-sim2sumo>`_ for making reservoir simulator (Eclipse, OPM) results available through Sumo.

.. toctree::
:maxdepth: 2
:hidden:

self
uploader
explorer
71 changes: 0 additions & 71 deletions docs/uploader.rst

This file was deleted.

53 changes: 45 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_file = "src/fmu/sumo/explorer/_version.py"

[tool.isort]
profile = "black"

[build-system]
requires = [
"pip>=19.1.1",
"setuptools>=28",
"setuptools_scm>=3.2.0",
"wheel",
[tool.black]
line-length = 79

[project]
name = "fmu-sumo-explorer"
description = "Python package for interacting with Sumo in an FMU setting"
requires-python = ">=3.8"
dynamic = ["version"]
license = { file = "LICENSE" }
readme = { file = "README.md", content-type = "text/markdown" }
authors = [{ name = "Equinor" }]
classifiers = ["Programming Language :: Python"]
dependencies = [
"pandas>=1.1.3",
"sumo-wrapper-python",
"xtgeo",
"pyarrow; python_version > '3.6.1'",
"OpenVDS; sys_platform != 'darwin'",
]

[tool.black]
line-length = 79
[project.urls]
Repository = "https://github.com/equinor/fmu-sumo"

[project.optional-dependencies]
dev = ["black", "flake8", "pytest"]
docs = [
"sphinx==6.2.1",
"sphinx-rtd-theme",
"autoapi",
"sphinx-autodoc-typehints",
"sphinxcontrib-apidoc",
]

[tool.setuptools]
package-dir = { "" = "src" }
include-package-data = true
platforms = ["any"]

[tool.setuptools.packages.find]
where = ["src"]
9 changes: 0 additions & 9 deletions requirements/requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/requirements_docs.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/requirements_setup.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/requirements_test.txt

This file was deleted.

86 changes: 0 additions & 86 deletions setup.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions src/fmu/sumo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
try:
from .version import version

__version__ = version
except ImportError:
__version__ = "0.0.0"
7 changes: 7 additions & 0 deletions src/fmu/sumo/explorer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
"""Top-level package for fmu.sumo.explorer"""
try:
from ._version import version

__version__ = version
except ImportError:
__version__ = "0.0.0"


from fmu.sumo.explorer.explorer import Explorer
from fmu.sumo.explorer.timefilter import TimeType, TimeFilter
Expand Down

0 comments on commit 8164d5f

Please sign in to comment.