diff --git a/LICENSE.md b/LICENSE.md index d74b6714a..9f93a3843 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,19 +1,21 @@ +MIT License + +Copyright (c) 2023 ANSYS, Inc. All rights reserved. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Copyright 2023 Ansys Inc +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/TODO.md b/TODO.md index 60e4a1c80..29df286f0 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,9 @@ +vscode autocomplete more DLLs handle subclasses sphinx doc build -vscode autocomplete +minify filter in sphinx build instead of doc gen split into two libs: 1. lib to generate stubs (propose to add to pythonnet) diff --git a/main.py b/main.py index 1fd246ac8..c0847471b 100644 --- a/main.py +++ b/main.py @@ -20,7 +20,6 @@ def resolve(): resolve_handler = assembly_resolver.WindowsResolveEventHandler else: resolve_handler = assembly_resolver.MechanicalResolveEventHandler - System.AppDomain.CurrentDomain.AssemblyResolve += resolve_handler resolve() @@ -65,4 +64,28 @@ def minify(): make() if MINIFY: - minify() \ No newline at end of file + minify() + + +def write_docs(commands, tiny_pages_path): + """Output to the tinypages directory. + + Parameters + ---------- + tiny_pages_path : str + Path to the tiny pages directory. + + """ + + doc_src = os.path.join(tiny_pages_path, "docs.rst") + with open(doc_src, "w") as fid: + fid.write("###################\n") + fid.write("Autosummary Testing\n") + fid.write("###################\n") + + fid.write(".. currentmodule:: ansys.mapdl.commands\n\n") + fid.write(".. autosummary::\n") + fid.write(" :toctree: _autosummary/\n\n") + for ans_name in commands: + cmd_name = ans_name + fid.write(f" {cmd_name}\n") \ No newline at end of file diff --git a/package/README.rst b/package/README.rst new file mode 100644 index 000000000..940841b93 --- /dev/null +++ b/package/README.rst @@ -0,0 +1,6 @@ +Mechanical Stubs +================ + +Autogenerated for Ansys Release {{ name }} on {{ name }}. + + diff --git a/package/pyproject.toml b/package/pyproject.toml new file mode 100644 index 000000000..b19fa9a0c --- /dev/null +++ b/package/pyproject.toml @@ -0,0 +1,41 @@ +[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 = "ansys-mechanical-stubs" +version = "0.1.dev0" +description = "PyMechanical scripting API stubs." +readme = "README.rst" +requires-python = ">=3.9" +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", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "ansys-sphinx-theme>=0.8.2", + "flit>3.8.0", + "sphinx-notfound-page==0.8.3", + "numpydoc==1.5.0", + "sphinx-copybutton==0.5.1", + "build>= 0.10.0", +] + +[tool.flit.module] +name = "ansys.mechanical.stubs" + +[project.urls] +Source = "https://github.com/pyansys/mechanical-stubs/" +Tracker = "https://github.com/pyansys/mechanical-stubs/issues" +Homepage = "https://github.com/pyansys/mechanical-stubs"