From 511af07c4f7845c71c6559fd3c1d52dc0859a3bc Mon Sep 17 00:00:00 2001
From: David Landa Marban
Date: Thu, 5 Dec 2024 10:18:31 +0100
Subject: [PATCH] Fixing Python3.8 support
---
CONTRIBUTING.md | 3 ++-
docs/_sources/configuration_file.rst.txt | 5 +++--
docs/_sources/contributing.rst.txt | 6 ++++--
docs/_sources/examples.rst.txt | 2 +-
docs/configuration_file.html | 5 +++--
docs/contributing.html | 5 +++--
docs/examples.html | 2 +-
docs/searchindex.js | 2 +-
docs/text/configuration_file.rst | 5 +++--
docs/text/contributing.rst | 6 ++++--
docs/text/examples.rst | 2 +-
src/pyopmspe11/utils/inputvalues.py | 15 ++++++++++++++-
tests/test_0_input_format.py | 9 +++++++++
13 files changed, 49 insertions(+), 18 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cb45d43..f894367 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -9,6 +9,7 @@ Contributions are more than welcome using the fork and pull request approach
- We document our code
## Contribute to the software
+This requires a Python version of at least 3.11 (due to [_tomllib_](https://toml.io/en/)).
1. Work on your own fork of the main repo
1. In the main repo execute:
@@ -18,7 +19,7 @@ Contributions are more than welcome using the fork and pull request approach
1. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
1. **pytest --cov=pyopmspe11 --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then delete all content from the [_docs_](https://github.com/cssr-tools/pyopmspe11/tree/main/docs) folder except [_Makefile_](https://github.com/OPM/pyopmspe11/blob/main/docs/Makefile), [_text_](https://github.com/OPM/pyopmspe11/blob/main/docs/text), and [_.nojekyll_](https://github.com/OPM/pyopmspe11/blob/main/docs/.nojekyll), after copy all contents from the docs/_build/html/ folder, and finally paste them in the [_docs_](https://github.com/cssr-tools/pyopmspe11/tree/main/docs) folder)
- * Tip: See the [_CI.yml_](https://github.com/cssr-tools/pyopmspe11/blob/main/.github/workflows/CI.yml) script and the [_Actions_](https://github.com/cssr-tools/pyopmspe11/actions) for installation of pyopmspe11, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10.
+ * Tip: See the [_CI.yml_](https://github.com/cssr-tools/pyopmspe11/blob/main/.github/workflows/CI.yml) script and the [_Actions_](https://github.com/cssr-tools/pyopmspe11/actions) for installation of pyopmspe11, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10 using Python3.11.
1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this)
1. Push your commit and make a pull request
1. The maintainers will review the pull request, and if the contribution is accepted, then it will be merge to the main repo
diff --git a/docs/_sources/configuration_file.rst.txt b/docs/_sources/configuration_file.rst.txt
index bf6cac0..a627889 100644
--- a/docs/_sources/configuration_file.rst.txt
+++ b/docs/_sources/configuration_file.rst.txt
@@ -4,8 +4,9 @@ Configuration file
In the initial development of **pyopmspe11**, the adopted configuration file format was the
one described below, i.e., via :ref:`txt` files. The current development of **pyopmspe11** considers
-:ref:`toml` files. To keep compatibility with previous configuration files, then support for :ref:`txt` files
-will be kept, while new features will by added using :ref:`toml` configuration files.
+:ref:`toml` files. To keep compatibility with previous configuration files and Python versions of at least 3.8,
+then support for :ref:`txt` files will be kept, while new features will by added using :ref:`toml` configuration
+files (which requires at least Python3.11).
.. _txt:
diff --git a/docs/_sources/contributing.rst.txt b/docs/_sources/contributing.rst.txt
index 4df9c15..621a661 100644
--- a/docs/_sources/contributing.rst.txt
+++ b/docs/_sources/contributing.rst.txt
@@ -18,6 +18,8 @@ Ground Rules
Contribute to the software
==========================
+This requires a Python version of at least 3.11 (due to `tomllib `_).
+
#. Work on your own fork of the main repo
#. In the main repo execute:
@@ -25,11 +27,11 @@ Contribute to the software
#. **black src/ tests/** (this formats the code)
#. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
#. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
- #. **pytest --cov=pyopmspe11 --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request; to save the files, add the flag **--basetemp=test_outputs**)
+ #. **pytest --cov=pyopmspe11 --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then delete all content from the `docs `_ folder except `Makefile `_, `text `_, and `.nojekyll `_, after copy all contents from the docs/_build/html/ folder, and finally paste them in the `docs `_ folder)
.. tip::
- See the `CI.yml `_ script and the `Actions `_ for installation of pyopmspe11, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10.
+ See the `CI.yml `_ script and the `Actions `_ for installation of pyopmspe11, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10 using Python3.11.
#. Squash your commits into a single commit (see this `nice tutorial `_ if you are not familiar with this)
#. Push your commit and make a pull request
diff --git a/docs/_sources/examples.rst.txt b/docs/_sources/examples.rst.txt
index 92f8262..9b68ea2 100644
--- a/docs/_sources/examples.rst.txt
+++ b/docs/_sources/examples.rst.txt
@@ -19,7 +19,7 @@ compare your example results to this figure to evaluate if your example ran corr
.. figure:: figs/spe11b_tco2_2Dmaps.png
-Using the :ref:`toml` format, the previous run is equivalent to:
+Using the :ref:`toml` format, the previous run is equivalent to (this requires a Python version of at least 3.11 [due to `tomllib `_]):
.. code-block:: bash
diff --git a/docs/configuration_file.html b/docs/configuration_file.html
index 0c372ab..165f29e 100644
--- a/docs/configuration_file.html
+++ b/docs/configuration_file.html
@@ -94,8 +94,9 @@
Configuration file
In the initial development of pyopmspe11, the adopted configuration file format was the
one described below, i.e., via txt files. The current development of pyopmspe11 considers
-toml files. To keep compatibility with previous configuration files, then support for txt files
-will be kept, while new features will by added using toml configuration files.
+toml files. To keep compatibility with previous configuration files and Python versions of at least 3.8,
+then support for txt files will be kept, while new features will by added using toml configuration
+files (which requires at least Python3.11).
txt
The first input parameter in the configuration file is:
diff --git a/docs/contributing.html b/docs/contributing.html
index ab54a49..a8358cd 100644
--- a/docs/contributing.html
+++ b/docs/contributing.html
@@ -102,6 +102,7 @@ Ground Rules