diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 70cdf566c9f..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,10 +0,0 @@ -[run] -omit = - # omit commands - ansys/mapdl/core/_commands/* - - # ignore legacy interfaces - ansys/mapdl/core/mapdl_console.py - ansys/mapdl/core/mapdl_corba.py - ansys/mapdl/core/jupyter.py - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddc854b55bf..9695d8ca97e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,11 +8,6 @@ repos: rev: 5.10.1 hooks: - id: isort - args: [ - "--profile", "black", - "--force-sort-within-sections", - "--skip-glob", "*__init__.py", - ] - repo: https://github.com/PyCQA/flake8 rev: 6.0.0 @@ -24,7 +19,6 @@ repos: hooks: - id: codespell -# add this eventually # - repo: https://github.com/pycqa/pydocstyle # rev: 6.1.1 # hooks: diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index 6e9a1adb534..cc112820f1c 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -101,4 +101,32 @@ Windows Subsystem Windows Subsystem for Linux WSL Zhu -3-D \ No newline at end of file +3-D +delet +appen +parm +pres +WAN +filname +ans +tread +wan +levl +mater +aadd +extrem +imagin +ist +nin +sord +struc +emiss +vise +sur +larg +smal +ect +nce +singl +righ +trian diff --git a/pyproject.toml b/pyproject.toml index 73ccbe72343..f3d20dd8af0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,4 +97,50 @@ name = "ansys.mapdl.core" Source = "https://github.com/pyansys/pymapdl" [project.scripts] -pymapdl_convert_script = "ansys.mapdl.core.convert:cli" \ No newline at end of file +pymapdl_convert_script = "ansys.mapdl.core.convert:cli" + +[tool.pytest.ini_options] +junit_family = "legacy" +filterwarnings = [ + "ignore::FutureWarning", + "ignore::PendingDeprecationWarning", + "ignore::DeprecationWarning", + # bogus numpy ABI warning (see numpy/#432) + "ignore:.*numpy.dtype size changed.*:RuntimeWarning", + "ignore:.*numpy.ufunc size changed.*:RuntimeWarning", + "ignore::UserWarning", +] +markers = [ + "skip_grpc: skip tests using grpc", + "corba: skip tests using the CORBA interface", + "gui: skip tests that launch the GUI interface", +] +testpaths = "tests" + +[tool.isort] +profile = "black" +force_sort_within_sections = true +default_section = "THIRDPARTY" +skip_glob = ["__init__.py"] +src_paths = ["doc", "src", "tests"] + + +[tool.coverage.run] +source = ["ansys/pymapdl"] +omit = [ + # omit commands + "ansys/mapdl/core/_commands/*", + + # ignore legacy interfaces + "ansys/mapdl/core/mapdl_console.py", + "ansys/mapdl/core/mapdl_corba.py", + "ansys/mapdl/core/jupyter.py", +] + +[tool.coverage.report] +show_missing = true + +[tool.codespell] +skip = "*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,build,./docker/mapdl/v*,./factory/*,./ansys/mapdl/core/mapdl_functions.py,PKG-INFO,*.mypy_cache/*,./docker/mapdl/*,./_unused/*" +ignore-words-list = "doc/styles/Vocab/ANSYS/accept.txt" +quiet-level = 3 diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 6fbf49a6e24..00000000000 --- a/pytest.ini +++ /dev/null @@ -1,15 +0,0 @@ -[pytest] -junit_family=legacy -filterwarnings = - ignore::FutureWarning - ignore::PendingDeprecationWarning - ignore::DeprecationWarning - # bogus numpy ABI warning (see numpy/#432) - ignore:.*numpy.dtype size changed.*:RuntimeWarning - ignore:.*numpy.ufunc size changed.*:RuntimeWarning - ignore::UserWarning -markers = - skip_grpc: skip tests using grpc - corba: skip tests using the CORBA interface - gui: skip tests that launch the GUI interface -testpaths = tests \ No newline at end of file diff --git a/src/ansys/mapdl/core/database/__init__.py b/src/ansys/mapdl/core/database/__init__.py index b663e96ffe2..f94bb63d792 100644 --- a/src/ansys/mapdl/core/database/__init__.py +++ b/src/ansys/mapdl/core/database/__init__.py @@ -1,8 +1,4 @@ """The mapdl database module, allowing the access to the MAPDL database from Python.""" -from .database import ( # noqa: F401 - VALID_MAPDL_VERSIONS, - DBDef, - MapdlDb, - check_mapdl_db_is_alive, -) +from .database import MapdlDb # noqa: F401 +from .database import VALID_MAPDL_VERSIONS, DBDef, check_mapdl_db_is_alive diff --git a/tests/conftest.py b/tests/conftest.py index 00d62a2690b..e884f049594 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,9 +3,10 @@ from pathlib import Path import signal -from common import Element, Node, get_details_of_elements, get_details_of_nodes import pytest +from common import Element, Node, get_details_of_elements, get_details_of_nodes + # import time diff --git a/tests/test_licensing.py b/tests/test_licensing.py index 64557354a7c..6cd381ca143 100644 --- a/tests/test_licensing.py +++ b/tests/test_licensing.py @@ -4,12 +4,12 @@ import time import types -from conftest import LOCAL as IS_LOCAL import pytest from ansys.mapdl.core import errors, launch_mapdl, licensing from ansys.mapdl.core.launcher import check_valid_ansys, get_start_instance from ansys.mapdl.core.misc import threaded +from conftest import LOCAL as IS_LOCAL try: LIC_INSTALLED = os.path.isfile(licensing.get_ansys_license_utility_path()) diff --git a/tests/test_logging.py b/tests/test_logging.py index 648cd6e1fd2..8bffc9d5706 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -3,11 +3,11 @@ import os import re -from conftest import HAS_GRPC import pytest from ansys.mapdl.core import LOG # Global logger from ansys.mapdl.core import logging +from conftest import HAS_GRPC ## Notes # Use the next fixtures for: