From a9ad52ce153b0d963d60dbddbeac0a7c5f276c87 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 14:22:53 +0200 Subject: [PATCH 01/33] Mv PyAnsys folder to src/pyansys and remove build folder --- pyansys/__init__.py | 2 -- pyansys/_version.py | 11 ----------- {build/lib => src}/pyansys/__init__.py | 0 {build/lib => src}/pyansys/_version.py | 0 4 files changed, 13 deletions(-) delete mode 100644 pyansys/__init__.py delete mode 100644 pyansys/_version.py rename {build/lib => src}/pyansys/__init__.py (100%) rename {build/lib => src}/pyansys/_version.py (100%) diff --git a/pyansys/__init__.py b/pyansys/__init__.py deleted file mode 100644 index d0a427ad..00000000 --- a/pyansys/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ - -# raise NotImplementedError(NOTIMPLEMENTED) diff --git a/pyansys/_version.py b/pyansys/_version.py deleted file mode 100644 index f034c671..00000000 --- a/pyansys/_version.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Version for pyansys landing package - -This needs to be incremented to build new notes on the PyPi page. - -""" - -# major, minor, patch -version_info = 0, 63, 'dev0' - -# Nice string for the version -__version__ = '.'.join(map(str, version_info)) diff --git a/build/lib/pyansys/__init__.py b/src/pyansys/__init__.py similarity index 100% rename from build/lib/pyansys/__init__.py rename to src/pyansys/__init__.py diff --git a/build/lib/pyansys/_version.py b/src/pyansys/_version.py similarity index 100% rename from build/lib/pyansys/_version.py rename to src/pyansys/_version.py From c8a2621470797e5d8c9a7f844c48312919964e39 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 14:25:02 +0200 Subject: [PATCH 02/33] Adapt gitignore --- .gitignore | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 165 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4f548b17..86e810f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,165 @@ -*~ -*.egg-info -dist/* -doc/build/* -.mypy_cache/* \ No newline at end of file +# Created by https://www.toptal.com/developers/gitignore/api/python +# Edit at https://www.toptal.com/developers/gitignore?templates=python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +wheelhouse/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +.cov + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +doc/_build/ +doc/**/_autosummary +doc/source/examples/* + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +#VSCode +.vscode + +# PyCharm +# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# End of https://www.toptal.com/developers/gitignore/api/python From 17cb8d9a9a0097f760a95a186c6a40808ae9908a Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 14:54:00 +0200 Subject: [PATCH 03/33] Point docs to proper folder --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 60167183..a5f20b89 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -12,7 +12,7 @@ # Get version from version info: execute file from raw string __version__ = None this_file = os.path.dirname(__file__) -version_file = os.path.join(this_file, '..', '..', 'pyansys', '_version.py') +version_file = os.path.join(this_file, '..', '..', 'src', 'pyansys', '_version.py') with io_open(version_file, mode='r') as fd: exec(fd.read()) From 2ee426de120c56483207d146516a098dc0d7b363 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 16:15:31 +0200 Subject: [PATCH 04/33] Adapt to pyproject.toml and create install configs --- pyproject.toml | 72 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 2 -- setup.py | 66 ------------------------------------- src/pyansys/_version.py | 17 +++++++--- 4 files changed, 84 insertions(+), 73 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7dc31153 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,72 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections +name = "pyansys" +version = "2023.1.0dev" +description = "Pythonic interfaces to Ansys products" +readme = "README.rst" +requires-python = ">=3.7" +license = {file = "LICENSE"} +authors = [ + {name = "ANSYS, Inc.", email = "pyansys.support@ansys.com"}, +] +maintainers = [ + {name = "PyAnsys developers", email = "pyansys.maintainers@ansys.com"}, +] + +classifiers = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Science/Research', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'License :: OSI Approved :: MIT License', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Operating System :: MacOS', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', +] +dependencies = [ + "importlib-metadata>=4.0", + "ansys-mapdl-core==0.63.0", + "ansys-dpf-core==0.4.2", + "ansys-dpf-post==0.2.2", + "ansys-fluent-core==0.10.1", + "pyaedt==0.5.11", + "ansys-platform-instancemanagement==1.0.2", + "ansys-grantami-bomanalytics==1.0.1", + "ansys-openapi-common==1.1.1" +] + +[project.optional-dependencies] +all = [ + "pyansys[mapdl-all]", + "pyansys[fluent-all]", +] +mapdl-all = [ + "ansys-mapdl-reader==0.51.14", +] +fluent-all = [ + "ansys-fluent-visualization==0.4.0", + "ansys-fluent-parametric==0.4.1", +] + +[tool.flit.module] +name = "pyansys" + +[project.urls] +Source = "https://github.com/pyansys/pyansys_landing" + +[tool.black] +line-length = 100 + +[tool.isort] +profile = "black" +force_sort_within_sections = true +line_length = 100 +default_section = "THIRDPARTY" +src_paths = ["doc", "src"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4e51572e..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[build_ext] -debug = 1 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1a909e9e..00000000 --- a/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Installation file for ansys-mapdl-core""" -import sys -import os -from io import open as io_open - -from setuptools import setup - -# Get version from version info: execute file from raw string -__version__ = None -this_file = os.path.dirname(__file__) -version_file = os.path.join(this_file, 'pyansys', '_version.py') -with io_open(version_file, mode='r') as fd: - exec(fd.read()) - -NOTIMPLEMENTED = """ -*** PyAnsys has moved (and expanded!) *** - -To use PyAnsys you need to install the applicable packages for your -product: - -MAPDL: - -- ``pip install ansys-mapdl-core`` - -MAPDL Post-Processing: - -- ``pip install ansys-mapdl-reader`` -- ``pip install ansys-dpf-core`` -- ``pip install ansys-dpf-reader`` - -PyAEDT - -- ``pip install pyaedt`` - -""" - -# raise an error when installing but not building -if 'sdist' not in sys.argv: - sys.exit(NOTIMPLEMENTED) - - -setup( - name='pyansys', - packages=['pyansys'], - author='Ansys', - maintainer_email='pyansys.maintainers@ansys.com', - version=__version__, - description='Pythonic interfaces to Ansys products', - long_description=open('README.rst').read(), - long_description_content_type='text/x-rst', - license='MIT', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Science/Research', - 'Topic :: Scientific/Engineering :: Information Analysis', - 'License :: OSI Approved :: MIT License', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Operating System :: MacOS', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], - url='https://github.com/pyansys', - keywords='Ansys PyAnsys', -) diff --git a/src/pyansys/_version.py b/src/pyansys/_version.py index f034c671..7cab8557 100644 --- a/src/pyansys/_version.py +++ b/src/pyansys/_version.py @@ -1,11 +1,18 @@ -"""Version for pyansys landing package +"""Version of pyansys module. -This needs to be incremented to build new notes on the PyPi page. +On the ``main`` branch, use 'dev0' to denote a development version. +For example: + +__version__ = 0, 58, 'dev0' """ +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: # pragma: no cover + import importlib_metadata + +# Read from the pyproject.toml # major, minor, patch -version_info = 0, 63, 'dev0' +__version__ = importlib_metadata.version("pyansys") -# Nice string for the version -__version__ = '.'.join(map(str, version_info)) From 55c443ce66565f26917c364ac7a9157cf9ee3b3f Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 16:17:37 +0200 Subject: [PATCH 05/33] Import version in __init__ file --- src/pyansys/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyansys/__init__.py b/src/pyansys/__init__.py index d0a427ad..022d2c73 100644 --- a/src/pyansys/__init__.py +++ b/src/pyansys/__init__.py @@ -1,2 +1,3 @@ +from pyansys._version import __version__ # raise NotImplementedError(NOTIMPLEMENTED) From d515f7999d0235a8d1a050a9380b87a5badc4d0f Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 16:45:30 +0200 Subject: [PATCH 06/33] "all" dependencies should be explicitly mentioned --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7dc31153..85c0783c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,10 +43,6 @@ dependencies = [ ] [project.optional-dependencies] -all = [ - "pyansys[mapdl-all]", - "pyansys[fluent-all]", -] mapdl-all = [ "ansys-mapdl-reader==0.51.14", ] @@ -54,6 +50,11 @@ fluent-all = [ "ansys-fluent-visualization==0.4.0", "ansys-fluent-parametric==0.4.1", ] +all = [ + "ansys-mapdl-reader==0.51.14", + "ansys-fluent-visualization==0.4.0", + "ansys-fluent-parametric==0.4.1", +] [tool.flit.module] name = "pyansys" From 858b92d349f0d10e28a00aba69715672c9625be9 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Fri, 29 Jul 2022 17:44:10 +0200 Subject: [PATCH 07/33] WIP on poetry --- pyproject.toml | 65 ++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 85c0783c..a0e8ed18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,22 +1,23 @@ [build-system] -requires = ["flit_core >=3.2,<4"] -build-backend = "flit_core.buildapi" +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" -[project] +[tool.poetry] # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections name = "pyansys" version = "2023.1.0dev" description = "Pythonic interfaces to Ansys products" readme = "README.rst" -requires-python = ">=3.7" license = {file = "LICENSE"} +homepage = "https://github.com/pyansys" +repository = "https://github.com/pyansys/pyansys_landing" +documentation = "https://docs.pyansys.com/" authors = [ - {name = "ANSYS, Inc.", email = "pyansys.support@ansys.com"}, + "ANSYS, Inc. ", ] maintainers = [ - {name = "PyAnsys developers", email = "pyansys.maintainers@ansys.com"}, + "PyAnsys developers ", ] - classifiers = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', @@ -30,37 +31,33 @@ classifiers = [ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', ] -dependencies = [ - "importlib-metadata>=4.0", - "ansys-mapdl-core==0.63.0", - "ansys-dpf-core==0.4.2", - "ansys-dpf-post==0.2.2", - "ansys-fluent-core==0.10.1", - "pyaedt==0.5.11", - "ansys-platform-instancemanagement==1.0.2", - "ansys-grantami-bomanalytics==1.0.1", - "ansys-openapi-common==1.1.1" -] -[project.optional-dependencies] -mapdl-all = [ - "ansys-mapdl-reader==0.51.14", -] -fluent-all = [ - "ansys-fluent-visualization==0.4.0", - "ansys-fluent-parametric==0.4.1", -] -all = [ - "ansys-mapdl-reader==0.51.14", - "ansys-fluent-visualization==0.4.0", - "ansys-fluent-parametric==0.4.1", +packages = [ + { include = "pyansys", from = "src" }, ] -[tool.flit.module] -name = "pyansys" +[tool.poetry.dependencies] +python = ">=3.7" +importlib-metadata = {version = "^4.0", python = "<3.8"} +ansys-mapdl-core = "==0.63.0" +ansys-dpf-core = "==0.4.2" +ansys-dpf-post = "==0.2.2" +ansys-fluent-core = "==0.10.1" +pyaedt = "==0.5.11" +ansys-platform-instancemanagement = "==1.0.2" +ansys-grantami-bomanalytics = "==1.0.1" +ansys-openapi-common = "==1.1.1" + +# Optional dependencies +ansys-mapdl-reader = {version = "==0.51.14", optional = true} +ansys-fluent-visualization = {version = "==0.4.0", optional = true} +ansys-fluent-parametric = {version = "==0.4.1", optional = true} + +[tool.poetry.extras] +mapdl-all = ["ansys-mapdl-reader"] +fluent-all = ["ansys-fluent-visualization","ansys-fluent-parametric",] +all = ["ansys-mapdl-reader","ansys-fluent-visualization","ansys-fluent-parametric"] -[project.urls] -Source = "https://github.com/pyansys/pyansys_landing" [tool.black] line-length = 100 From 6d144227a669f2e3b92b27d4217820d52e12eb6b Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 13:09:35 +0200 Subject: [PATCH 08/33] Implementing pre-commit + cleaning reqs --- .pre-commit-config.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ Makefile | 11 ----------- doc/source/conf.py | 14 +++++++------- pyproject.toml | 7 +++++-- requirements_docs.txt | 2 -- src/pyansys/__init__.py | 4 +++- src/pyansys/_version.py | 1 - 7 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 .pre-commit-config.yaml delete mode 100644 Makefile delete mode 100644 requirements_docs.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..6a235058 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,41 @@ +repos: + +- repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + +- repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + +- repo: https://gitlab.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + +- repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + args: ["--ignore-words=ignore_words.txt"] + +- repo: https://github.com/pycqa/pydocstyle + rev: 6.1.1 + hooks: + - id: pydocstyle + additional_dependencies: [toml] + exclude: "tests/" + +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-merge-conflict + - id: debug-statements + +# this validates our github workflow files +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.14.0 + hooks: + - id: check-github-workflows \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 9608732f..00000000 --- a/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# Simple makefile to simplify repetitive build env management tasks under posix - -CODESPELL_DIRS ?= ./ -CODESPELL_SKIP ?= "*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./docs/build/*,./docs/images/*,./dist/*,*~,.hypothesis*,./docs/source/examples/*,*cover,*.dat,*.mac,\#*,build,*.mypy_cache/*" -CODESPELL_IGNORE ?= "ignore_words.txt" - -all: codespell - -codespell: - @echo "Running codespell" - @codespell $(CODESPELL_DIRS) -S $(CODESPELL_SKIP) -I $(CODESPELL_IGNORE) diff --git a/doc/source/conf.py b/doc/source/conf.py index a5f20b89..e084f24c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -5,22 +5,22 @@ from ansys_sphinx_theme import pyansys_logo_black -project = 'pyansys-landing' +project = "pyansys-landing" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" -author = 'ANSYS Inc.' +author = "ANSYS Inc." # Get version from version info: execute file from raw string __version__ = None this_file = os.path.dirname(__file__) -version_file = os.path.join(this_file, '..', '..', 'src', 'pyansys', '_version.py') -with io_open(version_file, mode='r') as fd: +ver_file = os.path.join(this_file, "..", "..", "src", "pyansys", "_version.py") +with io_open(ver_file, mode="r") as fd: exec(fd.read()) release = version = __version__ # use the default pyansys logo html_logo = pyansys_logo_black -html_theme = 'ansys_sphinx_theme' +html_theme = "ansys_sphinx_theme" # specify the location of your github repo html_theme_options = { @@ -35,7 +35,7 @@ extensions = [] # The suffix(es) of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" diff --git a/pyproject.toml b/pyproject.toml index a0e8ed18..a761c3d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,10 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections name = "pyansys" -version = "2023.1.0dev" +version = "2023.1.dev0" description = "Pythonic interfaces to Ansys products" readme = "README.rst" -license = {file = "LICENSE"} +license = "MIT" homepage = "https://github.com/pyansys" repository = "https://github.com/pyansys/pyansys_landing" documentation = "https://docs.pyansys.com/" @@ -52,11 +52,14 @@ ansys-openapi-common = "==1.1.1" ansys-mapdl-reader = {version = "==0.51.14", optional = true} ansys-fluent-visualization = {version = "==0.4.0", optional = true} ansys-fluent-parametric = {version = "==0.4.1", optional = true} +Sphinx = {version = "==5.1.1", optional = true} +ansys-sphinx-theme = {version = "==0.4.2", optional = true} [tool.poetry.extras] mapdl-all = ["ansys-mapdl-reader"] fluent-all = ["ansys-fluent-visualization","ansys-fluent-parametric",] all = ["ansys-mapdl-reader","ansys-fluent-visualization","ansys-fluent-parametric"] +docs = ["Sphinx", "ansys-sphinx-theme"] [tool.black] diff --git a/requirements_docs.txt b/requirements_docs.txt deleted file mode 100644 index 97b8708e..00000000 --- a/requirements_docs.txt +++ /dev/null @@ -1,2 +0,0 @@ -Sphinx==5.1.1 -ansys-sphinx-theme==0.4.2 diff --git a/src/pyansys/__init__.py b/src/pyansys/__init__.py index 022d2c73..851e28ed 100644 --- a/src/pyansys/__init__.py +++ b/src/pyansys/__init__.py @@ -1,3 +1,5 @@ -from pyansys._version import __version__ +"""PyAnsys general package __init__ file.""" + +from pyansys._version import __version__ # noqa: F401 # raise NotImplementedError(NOTIMPLEMENTED) diff --git a/src/pyansys/_version.py b/src/pyansys/_version.py index 7cab8557..cf700f0e 100644 --- a/src/pyansys/_version.py +++ b/src/pyansys/_version.py @@ -15,4 +15,3 @@ # Read from the pyproject.toml # major, minor, patch __version__ = importlib_metadata.version("pyansys") - From 381c798e77207bf6edc7a27c6c8d1514ea939da9 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 13:20:07 +0200 Subject: [PATCH 09/33] Add vale config --- doc/.vale.ini | 32 +++++++++++++++++++++++++++++++ doc/styles/.gitignore | 4 ++++ doc/styles/Vocab/ANSYS/accept.txt | 3 +++ doc/styles/Vocab/ANSYS/reject.txt | 0 4 files changed, 39 insertions(+) create mode 100644 doc/.vale.ini create mode 100644 doc/styles/.gitignore create mode 100644 doc/styles/Vocab/ANSYS/accept.txt create mode 100644 doc/styles/Vocab/ANSYS/reject.txt diff --git a/doc/.vale.ini b/doc/.vale.ini new file mode 100644 index 00000000..617b6bea --- /dev/null +++ b/doc/.vale.ini @@ -0,0 +1,32 @@ +# Core settings +# ============= + +# Location of our `styles` +StylesPath = "styles" + +# The options are `suggestion`, `warning`, or `error` (defaults to “warning”). +MinAlertLevel = warning + +# By default, `code` and `tt` are ignored. +IgnoredScopes = code, tt + +# By default, `script`, `style`, `pre`, and `figure` are ignored. +SkippedScopes = script, style, pre, figure + +# WordTemplate specifies what Vale will consider to be an individual word. +WordTemplate = \b(?:%s)\b + +# List of Packages to be used for our guidelines +Packages = Google + +# Define the Ansys vocabulary +Vocab = ANSYS + +[*.{md,rst}] + +# Apply the following styles +BasedOnStyles = Vale, Google + +# Removing Google-specific rule - Not applicable under some circumstances +Google.WordList = NO +Google.Colons = NO \ No newline at end of file diff --git a/doc/styles/.gitignore b/doc/styles/.gitignore new file mode 100644 index 00000000..943db7cb --- /dev/null +++ b/doc/styles/.gitignore @@ -0,0 +1,4 @@ +* +!Vocab +!Vocab/** +!.gitignore \ No newline at end of file diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt new file mode 100644 index 00000000..de10bb76 --- /dev/null +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -0,0 +1,3 @@ +ANSYS +Ansys +ansys \ No newline at end of file diff --git a/doc/styles/Vocab/ANSYS/reject.txt b/doc/styles/Vocab/ANSYS/reject.txt new file mode 100644 index 00000000..e69de29b From 46c78ccd8d5ba4ffc6d11623c9d1b78379144810 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 13:51:39 +0200 Subject: [PATCH 10/33] Removing reqs file --- requirements_style.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100755 requirements_style.txt diff --git a/requirements_style.txt b/requirements_style.txt deleted file mode 100755 index f8512470..00000000 --- a/requirements_style.txt +++ /dev/null @@ -1,3 +0,0 @@ -codespell==2.1.0 - - From 8f81a40412c17d262648a1359ac19f41cd2f7fe1 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 13:51:47 +0200 Subject: [PATCH 11/33] Updating vale accepted words --- doc/styles/Vocab/ANSYS/accept.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index de10bb76..06d269c5 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,3 +1,16 @@ ANSYS Ansys -ansys \ No newline at end of file +ansys +postprocessing +PyAnsys +Pythonic +PyAEDT +DPF +PyMAPDL +PyMAPDL Reader +PyDPF-Core +PyDPF-Post +PyDPF +PyFluent +PyPIM +Granta MI BoM Analytics \ No newline at end of file From 0c5bceb74184d650aad6c7d759227ccb5dcdf4d8 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 13:51:56 +0200 Subject: [PATCH 12/33] Creating an actual CI --- .github/workflows/ci-build.yml | 255 +++++++++++++++++++++++++++++---- 1 file changed, 229 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index cca98115..a09d6c74 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,41 +1,190 @@ -# Build documentation -name: Documentation Build +name: GitHub CI +on: + pull_request: + workflow_dispatch: + push: + tags: + - "*" + branches: + - main -on: [push, pull_request, workflow_dispatch] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + MAIN_PYTHON_VERSION: '3.9' jobs: - docs_build: - runs-on: ubuntu-20.04 + style: + name: Code Style Check + runs-on: ubuntu-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v2.1.4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + + docs-style: + name: Documentation Style Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Running Vale + uses: errata-ai/vale-action@reviewdog + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: - python-version: 3.8 + files: '["doc", "README.rst"]' + reporter: github-pr-check + level: error + filter_mode: nofilter + fail_on_error: true + vale_flags: "--config=doc/.vale.ini" - - name: Style Check + core-import: + name: Import PyAnsys packages as a bundle + runs-on: ${{ matrix.os }} + needs: [style] + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: ['3.7', '3.8', '3.9', '3.10'] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Linux pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'Linux' }} + with: + path: ~/.cache/pip + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-core + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: Window pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'Windows' }} + with: + path: ~\AppData\Local\pip\Cache + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-core + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: MacOS pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'macOS' }} + with: + path: ~/Library/Caches/pip + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-core + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: Install core PyAnsys packages run: | - pip install -r requirements_style.txt --disable-pip-version-check - make + pip install . + + - name: Smoke test + run: python -c "from pyansys import __version__; print(__version__)" + + extras-import: + name: Import PyAnsys packages as a bundle + runs-on: ${{ matrix.os }} + needs: [style, core-import] + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: ['3.7', '3.8', '3.9', '3.10'] + extras-version: ['fluent-all', 'mapdl-all', 'all'] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Linux pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'Linux' }} + with: + path: ~/.cache/pip + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ matrix.extras-version }} + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: Window pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'Windows' }} + with: + path: ~\AppData\Local\pip\Cache + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ matrix.extras-version }} + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: MacOS pip cache + uses: actions/cache@v3 + if: ${{ runner.os == 'macOS' }} + with: + path: ~/Library/Caches/pip + key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ matrix.extras-version }} + restore-keys: | + Python-${{ runner.os }}-${{ matrix.python-version }} + + - name: Install core PyAnsys packages + run: | + pip install .[${{ matrix.extras-version }}] + + - name: Smoke test + run: python -c "from pyansys import __version__; print(__version__)" + + + docs-build: + runs-on: ubuntu-latest + needs: [docs-style] + + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Build Documentation run: | - pip install -r requirements_docs.txt + pip install .[docs] make -C doc html touch doc/build/html/.nojekyll - name: Upload Documentation - uses: actions/upload-artifact@v2.2.1 + uses: actions/upload-artifact@v3 with: name: Documentation path: doc/build/html retention-days: 7 - name: Deploy Docs - uses: JamesIves/github-pages-deploy-action@4.1.0 + uses: JamesIves/github-pages-deploy-action@4.4.0 if: startsWith(github.event.ref, 'refs/tags') with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -43,17 +192,71 @@ jobs: FOLDER: doc/build/html CLEAN: true - - name: Lint package dist + package: + name: Package library + runs-on: ubuntu-latest + needs: [docs-build, core-import] + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: Python-${{ runner.os }}-${{ env.MAIN_PYTHON_VERSION }}-${{ hashFiles('pyproject.toml') }}-core + restore-keys: | + Python-${{ runner.os }}-${{ env.MAIN_PYTHON_VERSION }} + + - name: Install dependencies and build the library run: | - pip install twine - python setup.py sdist - twine check dist/* + python -m pip install --upgrade pip poetry twine + python -m poetry build + python -m twine check dist/* - - name: Upload to PyPi - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + - name: Install PyAnsys from wheel run: | - twine upload --skip-existing dist/* + pip install dist/*.whl + + - name: Upload wheel and binaries + uses: actions/upload-artifact@v3 + with: + name: PyAnsys-packages + path: dist/ + retention-days: 7 + + release: + name: Release project + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [docs-build, core-import, package] + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - name: Upload to Public PyPi + run: | + pip install twine + twine upload --skip-existing ./**/*.whl + twine upload --skip-existing ./**/*.tar.gz env: - TWINE_USERNAME: "__token__" - TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }} - TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/" + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + ./**/*.whl + ./**/*.tar.gz \ No newline at end of file From d948704e65ecf47e34478468aaa0620e66078161 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 14:05:12 +0200 Subject: [PATCH 13/33] Update docs build stage --- .github/workflows/ci-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a09d6c74..4f62d18e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -159,6 +159,7 @@ jobs: docs-build: + name: Building Documentation runs-on: ubuntu-latest needs: [docs-style] @@ -184,7 +185,7 @@ jobs: retention-days: 7 - name: Deploy Docs - uses: JamesIves/github-pages-deploy-action@4.4.0 + uses: JamesIves/github-pages-deploy-action@v4.4.0 if: startsWith(github.event.ref, 'refs/tags') with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d7bfc59d54139513a544db20d6a94adff3ee7e5f Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 14:08:27 +0200 Subject: [PATCH 14/33] Change jobs description --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4f62d18e..b16984d7 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -53,7 +53,7 @@ jobs: vale_flags: "--config=doc/.vale.ini" core-import: - name: Import PyAnsys packages as a bundle + name: Build core PyAnsys packages runs-on: ${{ matrix.os }} needs: [style] strategy: @@ -105,7 +105,7 @@ jobs: run: python -c "from pyansys import __version__; print(__version__)" extras-import: - name: Import PyAnsys packages as a bundle + name: Build extras PyAnsys packages runs-on: ${{ matrix.os }} needs: [style, core-import] strategy: From 32e84fae84842b75075e4ea306a49d1aaf632c9c Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela Date: Mon, 1 Aug 2022 14:58:54 +0200 Subject: [PATCH 15/33] Update .github/workflows/ci-build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b16984d7..b7f349ad 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -32,7 +32,7 @@ jobs: run: pip install pre-commit - name: Run pre-commit - run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + run: pre-commit run --all-files --show-diff-on-failure docs-style: name: Documentation Style Check From 1344505e875962716a0f25c8078f3002ddb86308 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:17:40 +0200 Subject: [PATCH 16/33] Removing _version and simplifying things --- doc/source/conf.py | 11 +++++------ src/pyansys/__init__.py | 9 ++++++++- src/pyansys/_version.py | 17 ----------------- 3 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 src/pyansys/_version.py diff --git a/doc/source/conf.py b/doc/source/conf.py index e084f24c..feadf6ea 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -10,13 +10,12 @@ author = "ANSYS Inc." # Get version from version info: execute file from raw string -__version__ = None -this_file = os.path.dirname(__file__) -ver_file = os.path.join(this_file, "..", "..", "src", "pyansys", "_version.py") -with io_open(ver_file, mode="r") as fd: - exec(fd.read()) +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: # pragma: no cover + import importlib_metadata -release = version = __version__ +release = version = importlib_metadata.version("pyansys") # use the default pyansys logo html_logo = pyansys_logo_black diff --git a/src/pyansys/__init__.py b/src/pyansys/__init__.py index 851e28ed..dc41e820 100644 --- a/src/pyansys/__init__.py +++ b/src/pyansys/__init__.py @@ -1,5 +1,12 @@ """PyAnsys general package __init__ file.""" -from pyansys._version import __version__ # noqa: F401 +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: # pragma: no cover + import importlib_metadata + +# Read from the pyproject.toml +# major, minor, patch +__version__ = importlib_metadata.version("pyansys") # raise NotImplementedError(NOTIMPLEMENTED) diff --git a/src/pyansys/_version.py b/src/pyansys/_version.py deleted file mode 100644 index cf700f0e..00000000 --- a/src/pyansys/_version.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Version of pyansys module. - -On the ``main`` branch, use 'dev0' to denote a development version. -For example: - -__version__ = 0, 58, 'dev0' - -""" - -try: - import importlib.metadata as importlib_metadata -except ModuleNotFoundError: # pragma: no cover - import importlib_metadata - -# Read from the pyproject.toml -# major, minor, patch -__version__ = importlib_metadata.version("pyansys") From 01621385fc9f415c790222cb0651753a3336229a Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:18:10 +0200 Subject: [PATCH 17/33] Remove unnecessary line --- src/pyansys/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pyansys/__init__.py b/src/pyansys/__init__.py index dc41e820..1bff07a2 100644 --- a/src/pyansys/__init__.py +++ b/src/pyansys/__init__.py @@ -8,5 +8,3 @@ # Read from the pyproject.toml # major, minor, patch __version__ = importlib_metadata.version("pyansys") - -# raise NotImplementedError(NOTIMPLEMENTED) From d7097d2250d8fa28344112eb629a68465a16750b Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:18:41 +0200 Subject: [PATCH 18/33] Simplifyinf conf.py --- doc/source/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index feadf6ea..800afb69 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,7 +1,5 @@ """Configuration file for docs.pyansys.com landing page.""" from datetime import datetime -from io import open as io_open -import os from ansys_sphinx_theme import pyansys_logo_black From 61c2184576ea022b775b1bdb13b9d135e43667a8 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:25:18 +0200 Subject: [PATCH 19/33] Generate wheelhouse for different targets --- .github/workflows/ci-build.yml | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b16984d7..7cb1c0ef 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -13,6 +13,7 @@ concurrency: cancel-in-progress: true env: + PACKAGE_NAME: pyansys MAIN_PYTHON_VERSION: '3.9' jobs: @@ -104,6 +105,28 @@ jobs: - name: Smoke test run: python -c "from pyansys import __version__; print(__version__)" + - name: Store version + run: | + echo "::set-output name=PYANSYS_VERSION::$(python -c "from pyansys import __version__; print(__version__)")" + id: version + + - name: Generate wheelhouse + run: | + pip wheel . -w wheelhouse + + - name: Zip wheelhouse + uses: vimtor/action-zip@v1 + with: + files: wheelhouse + dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-core.zip + + - name: Upload Wheelhouse + uses: actions/upload-artifact@v3 + with: + name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-core + path: '*.zip' + retention-days: 7 + extras-import: name: Build extras PyAnsys packages runs-on: ${{ matrix.os }} @@ -157,6 +180,27 @@ jobs: - name: Smoke test run: python -c "from pyansys import __version__; print(__version__)" + - name: Store version + run: | + echo "::set-output name=PYANSYS_VERSION::$(python -c "from pyansys import __version__; print(__version__)")" + id: version + + - name: Generate wheelhouse + run: | + pip wheel . -w wheelhouse + + - name: Zip wheelhouse + uses: vimtor/action-zip@v1 + with: + files: wheelhouse + dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.extras-version }}.zip + + - name: Upload Wheelhouse + uses: actions/upload-artifact@v3 + with: + name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.extras-version }} + path: '*.zip' + retention-days: 7 docs-build: name: Building Documentation @@ -259,5 +303,6 @@ jobs: uses: softprops/action-gh-release@v1 with: files: | + ./**/*.zip ./**/*.whl ./**/*.tar.gz \ No newline at end of file From 72e56eca94d34cbe260a307109a9564f080df404 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:27:45 +0200 Subject: [PATCH 20/33] Missing target in extras-import stage for wheel build --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7cb1c0ef..981f017c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -187,7 +187,7 @@ jobs: - name: Generate wheelhouse run: | - pip wheel . -w wheelhouse + pip wheel .[${{ matrix.extras-version }}] -w wheelhouse - name: Zip wheelhouse uses: vimtor/action-zip@v1 From c1e3c1a70f233de5d046d522759bb7f275f56a75 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 15:32:22 +0200 Subject: [PATCH 21/33] Limit to Python 3 for now --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a761c3d2..10bb461e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ packages = [ ] [tool.poetry.dependencies] -python = ">=3.7" +python = ">=3.7,<4.0" importlib-metadata = {version = "^4.0", python = "<3.8"} ansys-mapdl-core = "==0.63.0" ansys-dpf-core = "==0.4.2" From 47f15ec8af3d373b7695e3796035c5508e17402f Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 17:28:21 +0200 Subject: [PATCH 22/33] Wheelhouse already generates all imports --- .github/workflows/ci-build.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 8cce0ee8..530c6e95 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -180,28 +180,6 @@ jobs: - name: Smoke test run: python -c "from pyansys import __version__; print(__version__)" - - name: Store version - run: | - echo "::set-output name=PYANSYS_VERSION::$(python -c "from pyansys import __version__; print(__version__)")" - id: version - - - name: Generate wheelhouse - run: | - pip wheel .[${{ matrix.extras-version }}] -w wheelhouse - - - name: Zip wheelhouse - uses: vimtor/action-zip@v1 - with: - files: wheelhouse - dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.extras-version }}.zip - - - name: Upload Wheelhouse - uses: actions/upload-artifact@v3 - with: - name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYANSYS_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.extras-version }} - path: '*.zip' - retention-days: 7 - docs-build: name: Building Documentation runs-on: ubuntu-latest From d8c02b11dd7b20dd885ab800b0eb9ac900090498 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 17:28:47 +0200 Subject: [PATCH 23/33] Comment problematic dependencies for now --- pyproject.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 10bb461e..d7803956 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,15 +50,17 @@ ansys-openapi-common = "==1.1.1" # Optional dependencies ansys-mapdl-reader = {version = "==0.51.14", optional = true} -ansys-fluent-visualization = {version = "==0.4.0", optional = true} +# ansys-fluent-visualization = {version = "==0.4.0", optional = true} ansys-fluent-parametric = {version = "==0.4.1", optional = true} Sphinx = {version = "==5.1.1", optional = true} ansys-sphinx-theme = {version = "==0.4.2", optional = true} [tool.poetry.extras] mapdl-all = ["ansys-mapdl-reader"] -fluent-all = ["ansys-fluent-visualization","ansys-fluent-parametric",] -all = ["ansys-mapdl-reader","ansys-fluent-visualization","ansys-fluent-parametric"] +# fluent-all = ["ansys-fluent-visualization","ansys-fluent-parametric",] +fluent-all = ["ansys-fluent-parametric",] +# all = ["ansys-mapdl-reader","ansys-fluent-visualization","ansys-fluent-parametric"] +all = ["ansys-mapdl-reader","ansys-fluent-parametric"] docs = ["Sphinx", "ansys-sphinx-theme"] From 9a014aaba07de6af689d48bdc57602ed730a6e03 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 17:35:19 +0200 Subject: [PATCH 24/33] Install wheelhouse when needed --- .github/workflows/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 530c6e95..12c22ce7 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -112,6 +112,7 @@ jobs: - name: Generate wheelhouse run: | + pip install wheel pip wheel . -w wheelhouse - name: Zip wheelhouse From afd8164b3b9e1f0ed30e96eceabeef092ef12afe Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 17:36:17 +0200 Subject: [PATCH 25/33] Remove Python 3.10 version for now --- .github/workflows/ci-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 12c22ce7..5d5aad63 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -60,7 +60,8 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + # python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9'] fail-fast: false steps: @@ -135,7 +136,8 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + # python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9'] extras-version: ['fluent-all', 'mapdl-all', 'all'] fail-fast: false From a15077304331b7b1d52bf892183fac51d2a88b2c Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 17:55:58 +0200 Subject: [PATCH 26/33] Improve description of extras jobs --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5d5aad63..7700cdab 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -176,7 +176,7 @@ jobs: restore-keys: | Python-${{ runner.os }}-${{ matrix.python-version }} - - name: Install core PyAnsys packages + - name: Install ${{ matrix.extras-version }} PyAnsys packages run: | pip install .[${{ matrix.extras-version }}] From b8781fbe74c88f1a9716449567c47f04ff75eb8e Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 18:03:07 +0200 Subject: [PATCH 27/33] Upgrade pip --- .github/workflows/ci-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7700cdab..1549e4b9 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -101,6 +101,7 @@ jobs: - name: Install core PyAnsys packages run: | + pip install --upgrade pip pip install . - name: Smoke test @@ -178,6 +179,7 @@ jobs: - name: Install ${{ matrix.extras-version }} PyAnsys packages run: | + pip install --upgrade pip pip install .[${{ matrix.extras-version }}] - name: Smoke test @@ -198,6 +200,7 @@ jobs: - name: Build Documentation run: | + pip install --upgrade pip pip install .[docs] make -C doc html touch doc/build/html/.nojekyll From f1a1fdc04b68e1adcb3c1c8cc3c5f630c358227c Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Mon, 1 Aug 2022 18:12:43 +0200 Subject: [PATCH 28/33] Remove pip upgrades - did not solve the problem --- .github/workflows/ci-build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 1549e4b9..7700cdab 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -101,7 +101,6 @@ jobs: - name: Install core PyAnsys packages run: | - pip install --upgrade pip pip install . - name: Smoke test @@ -179,7 +178,6 @@ jobs: - name: Install ${{ matrix.extras-version }} PyAnsys packages run: | - pip install --upgrade pip pip install .[${{ matrix.extras-version }}] - name: Smoke test @@ -200,7 +198,6 @@ jobs: - name: Build Documentation run: | - pip install --upgrade pip pip install .[docs] make -C doc html touch doc/build/html/.nojekyll From 17d3845c487832b1702b1ac097a9eb3ad849fc2f Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela Date: Mon, 1 Aug 2022 18:43:17 +0200 Subject: [PATCH 29/33] Update pyproject.toml Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d7803956..1894f7ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ classifiers = [ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', ] packages = [ From 499d8abe0d4d7ae593c3f5eceda124a32391d4e4 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela Date: Thu, 4 Aug 2022 08:12:36 +0200 Subject: [PATCH 30/33] Apply suggestions from code review by @akaszynski Co-authored-by: Alex Kaszynski --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1894f7ef..d4277225 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,8 @@ packages = [ [tool.poetry.dependencies] python = ">=3.7,<4.0" importlib-metadata = {version = "^4.0", python = "<3.8"} -ansys-mapdl-core = "==0.63.0" +ansys-mapdl-core = "==0.63.1" + ansys-dpf-core = "==0.4.2" ansys-dpf-post = "==0.2.2" ansys-fluent-core = "==0.10.1" @@ -48,7 +49,7 @@ ansys-grantami-bomanalytics = "==1.0.1" ansys-openapi-common = "==1.1.1" # Optional dependencies -ansys-mapdl-reader = {version = "==0.51.14", optional = true} +ansys-mapdl-reader = {version = "==0.51.15", optional = true} # ansys-fluent-visualization = {version = "==0.4.0", optional = true} ansys-fluent-parametric = {version = "==0.4.1", optional = true} Sphinx = {version = "==5.1.1", optional = true} From 64d2a3c84d81f0bbdbfdd45e063ef4a258f4343c Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Thu, 4 Aug 2022 10:19:17 +0200 Subject: [PATCH 31/33] Commiting @jorgepiloto's suggestion --- doc/source/conf.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 800afb69..8073a43c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,18 +2,14 @@ from datetime import datetime from ansys_sphinx_theme import pyansys_logo_black +from pyansys import __version__ as pyansys_version project = "pyansys-landing" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" author = "ANSYS Inc." -# Get version from version info: execute file from raw string -try: - import importlib.metadata as importlib_metadata -except ModuleNotFoundError: # pragma: no cover - import importlib_metadata - -release = version = importlib_metadata.version("pyansys") +# get the PyAnsys version +release = version = pyansys_version # use the default pyansys logo html_logo = pyansys_logo_black From 304df0f1c2b4dc63ce49024f0df17ecab78cdaa0 Mon Sep 17 00:00:00 2001 From: RobPasMue Date: Thu, 4 Aug 2022 10:29:08 +0200 Subject: [PATCH 32/33] Pre-commit check --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8073a43c..c223be6d 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,6 +2,7 @@ from datetime import datetime from ansys_sphinx_theme import pyansys_logo_black + from pyansys import __version__ as pyansys_version project = "pyansys-landing" From 24241d45ad6a83d680ec1e032f618bb88f7d0820 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela Date: Thu, 4 Aug 2022 11:42:19 +0200 Subject: [PATCH 33/33] Apply suggestions from code review Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> --- .github/workflows/ci-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7700cdab..ebf95801 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -60,7 +60,6 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - # python-version: ['3.7', '3.8', '3.9', '3.10'] python-version: ['3.7', '3.8', '3.9'] fail-fast: false @@ -136,7 +135,6 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - # python-version: ['3.7', '3.8', '3.9', '3.10'] python-version: ['3.7', '3.8', '3.9'] extras-version: ['fluent-all', 'mapdl-all', 'all'] fail-fast: false