|
2 | 2 | Library Template
|
3 | 3 | ################
|
4 | 4 |
|
5 |
| -Within the `PyAnsys Organization <https://github.com/pyansys>`_, there |
6 |
| -is a `template repository <https://github.com/pyansys/template>`_ |
7 |
| -where you can `create a repository from a template`_ and create a |
8 |
| -PyAnsys project that follows the guidelines specified in this developer's |
9 |
| -guide. |
| 5 | +If you are about to start a new PyAnsys project from scratch, please consider |
| 6 | +using the `ansys-templates`_ tool. This is a command line tool which allows you |
| 7 | +to dynamically create a PyAnsys project from different available templates. |
10 | 8 |
|
11 |
| -The template repository contains a generalized library skeleton that includes: |
| 9 | +.. note:: |
12 | 10 |
|
13 |
| -- Library skeleton with sample classes and methods |
14 |
| -- Sample documentation build including customized templates |
15 |
| -- Sample GitHub actions specific to PyAnsys libraries |
16 |
| -- Licensing, example README, and setup files |
17 |
| -- ``.gitignore`` and other requirements files |
| 11 | + Check the `pyansys-templates documentation`_ for guidelines on how to use |
| 12 | + the `ansys-templates`_ command line interface. |
18 | 13 |
|
19 |
| -To use this template, `create a repository from a template`_. |
20 | 14 |
|
| 15 | +PyAnsys Available Templates |
| 16 | +=========================== |
21 | 17 |
|
22 |
| -.. _Create a repository from a template: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template |
| 18 | +There are two templates to be used as basis for PyAnsys projects. These are the |
| 19 | +``pyansys`` and the ``pyansys-advanced`` templates. |
| 20 | + |
| 21 | + |
| 22 | +PyAnsys template |
| 23 | +---------------- |
| 24 | + |
| 25 | +The ``pyansys`` template ships only with the required directories and files to |
| 26 | +quickly setup a PyAnsys compliant project: |
| 27 | + |
| 28 | +- Provides a ``src/ansys/product/library/`` layout. |
| 29 | +- Includes a ``setup.py`` file. |
| 30 | +- Generates a ``doc/`` and a ``tests/`` directories. |
| 31 | +- Generic ``.gitignore`` for Python libraries. |
| 32 | +- Minimum required build, doc and test requirements. Dependencies are hosted in |
| 33 | + ``requirements_<type>.txt`` files, in the project's root directory. |
| 34 | +- Usual files: ``README.rst`` and ``LICENSE``. |
| 35 | + |
| 36 | +Create a new project based on the ``pyansys-advanced`` template by running: |
| 37 | + |
| 38 | +.. code:: bash |
| 39 | +
|
| 40 | + ansys-templates new pyansys |
| 41 | +
|
| 42 | +
|
| 43 | +PyAnsys Advanced Template |
| 44 | +------------------------- |
| 45 | + |
| 46 | +The ``pyansys-advanced`` is an enhanced version of the ``pyansys`` template. It |
| 47 | +ships with the same files as this last template except: |
| 48 | + |
| 49 | +- It allows you to select the build system among `flit`_, `poetry`_ or |
| 50 | + `setuptools`_. Refer to :ref:`packaging` for more about build systems. |
| 51 | +- Uses `Tox`_ for testing and tasks automation. |
| 52 | +- Includes a GitHub actions workflow for testing coding style, running the test |
| 53 | + suite and building documentation. |
| 54 | +- Uses `pre-commit`_ for checking coding style. |
| 55 | + |
| 56 | +Create a new project based on the ``pyansys-advanced`` template by running: |
| 57 | + |
| 58 | +.. code:: bash |
| 59 | +
|
| 60 | + ansys-templates new pyansys-advanced |
| 61 | +
|
| 62 | +.. _ansys-templates: https://github.com/pyansys/pyansys-templates |
| 63 | +.. _flit: https://flit.readthedocs.io/en/latest/ |
| 64 | +.. _poetry: https://python-poetry.org/ |
| 65 | +.. _pre-commit: https://pre-commit.com/ |
| 66 | +.. _pyansys-templates documentation: https://templates.pyansys.com/getting_started/index.html |
| 67 | +.. _setuptools: https://pypi.org/project/setuptools/ |
| 68 | +.. _Tox: https://tox.wiki/en/latest/ |
0 commit comments