From 8ce64954423c6119c4e8cd9b5999edda053a82e4 Mon Sep 17 00:00:00 2001 From: Sofiane HADDAD Date: Thu, 3 Apr 2025 14:38:26 +0200 Subject: [PATCH 1/2] Update readme : build_sphinx has been dropped --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 0ba3b0a..ab6742f 100644 --- a/README.rst +++ b/README.rst @@ -45,17 +45,17 @@ To run the tests: $ pytest -Finally to build the documentation, you should invoke the `build_sphinx` option: +Finally to build the documentation, one of the following option could be used : .. code-block:: shell - $ python setup.py build_sphinx + $ sphinx-build doc doc/_build + #$ python -m sphinx doc doc_build + $ make html -C doc -This builds the documentation in the `build` folder. Another option is to launch the `make` command: -.. code-block:: shell +This generate the documentation in the `doc/_build` folder. - $ make html -C doc Help pages ========== From 8f3bebf6464009c78c627be8baea9139784b62f6 Mon Sep 17 00:00:00 2001 From: Sofiane HADDAD Date: Thu, 3 Apr 2025 14:39:22 +0200 Subject: [PATCH 2/2] Update setup process: - Add pyproject.toml (minimal) --> pip install . allows to checks dependencies and make it easy - update setup.py --> use setuptools - Doc : update link (openturns), copyright - update github actions --- .github/workflows/build.yml | 2 +- README.rst | 2 +- doc/conf.py | 2 +- pyproject.toml | 9 +++++++ setup.py | 48 ++++++++++--------------------------- 5 files changed, 24 insertions(+), 39 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7c0190..0fda387 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Build shell: bash -l {0} run: | - conda install -y openturns numpy pytest numpydoc sphinx sphinx-gallery sphinx_rtd_theme pandoc flake8 matplotlib + conda install -y setuptools openturns numpy pytest numpydoc sphinx sphinx-gallery sphinx_rtd_theme pandoc flake8 matplotlib flake8 --max-line-length=120 python setup.py install pytest diff --git a/README.rst b/README.rst index ab6742f..91e0be9 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ Get source: .. code-block:: shell - $ git clone https://www.github.com/sofianehaddad/ottemplatepython.git + $ git clone https://www.github.com/openturns/ottemplatepython.git The install procedure is performed as follows: diff --git a/doc/conf.py b/doc/conf.py index 535bde2..4bbe93c 100755 --- a/doc/conf.py +++ b/doc/conf.py @@ -81,7 +81,7 @@ # General information about the project. project = u"ottemplate" -copyright = u"2005-2024 Airbus-EDF-IMACS-ONERA-Phimeca" +copyright = u"2005-2025 Airbus-EDF-IMACS-ONERA-Phimeca" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..36d8da5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[build-system] +requires = [ "setuptools"] + +[project] +name = "ottemplate-python" +version = "0.1" +description = "Template" +readme = "README.rst" +dependencies = [ "numpydoc","sphinx_gallery", "sphinx", "matplotlib", "openturns",] diff --git a/setup.py b/setup.py index 52d59b4..fa57943 100755 --- a/setup.py +++ b/setup.py @@ -11,50 +11,26 @@ pip install . """ -import re -import os -from distutils.core import setup +from setuptools import setup, find_packages -from setuptools import find_packages - -# Get the version from __init__.py -path = os.path.join(os.path.dirname(__file__), 'ottemplate', '__init__.py') -with open(path) as f: - version_file = f.read() - -version = re.search(r"^\s*__version__\s*=\s*['\"]([^'\"]+)['\"]", - version_file, re.M) -if version: - version = version.group(1) -else: - raise RuntimeError("Unable to find version string.") - -# Long description -with open("README.rst", "r") as fh: - long_description = fh.read() setup( - # library name name='ottemplate', - # code version - version=version, - + version="0.1", # list libraries to be imported packages=find_packages(), - # Descriptions - description="ottemplate", - long_description=long_description, - - # List of dependancies - setup_requires=['pytest-runner'], + description="template for python modules utilizing openturns", install_requires=['numpy>=1.13', - 'openturns'], - tests_require=['pytest'], - - # Enable to take into account MANIFEST.in - # include_package_data=True, - license="LGPL" + 'openturns', + 'matplotlib >= 1.5.1', + "numpydoc", + "sphinx_gallery", + "sphinx", + "matplotlib", + "openturns", + "pytest", + "pytest-runner"], )