3
3
Development Practices
4
4
=====================
5
5
This page explains how PyAnsys development is conducted. When
6
- contributing directly to PyAnsys libraries , use these general
6
+ contributing to a PyAnsys repository , use these general
7
7
coding paradigms:
8
8
9
9
#. Follow the `Zen of Python <https://www.python.org/dev/peps/pep-0020/ >`__.
10
10
As silly as core Python developers are sometimes, there's much to be
11
11
gained by following the basic guidelines listed in PEP 20. As suggested
12
12
in these guidelines, focus on making your additions intuitive, novel,
13
- and helpful for PyAnsys library users. When in doubt, use ``import this ``.
13
+ and helpful for PyAnsys users. When in doubt, use ``import this ``.
14
14
For Ansys code quality standards, see :ref: `coding_style `.
15
15
16
16
#. Document your contributions. Include a docstring for any added
@@ -31,13 +31,15 @@ coding paradigms:
31
31
32
32
Contributing Through GitHub
33
33
---------------------------
34
- To submit new code to a PyAnsys Library :
34
+ To submit new code to a PyAnsys repository :
35
35
36
36
#. `Fork <https://docs.github.com/en/get-started/quickstart/fork-a-repo >`_
37
- the respective library's GitHub repository and then clone
38
- the forked repository to your computer.
37
+ the respective GitHub repository and then clone the forked repository
38
+ to your computer.
39
39
40
- #. In your local repository, create a branch. See `Branching Model <#Branching Model >`__.
40
+ #. In your local repository, create a branch. See :ref: `branch_naming `.
41
+ Comprehensive information on our model for branching is availible in
42
+ `Branching Model <#Branching Model >`__.
41
43
42
44
#. Add your new feature and commit it locally. Be sure to commit
43
45
frequently as the ability to revert to past commits is often helpful,
@@ -54,15 +56,15 @@ Once you have tested your branch locally, create a PR and target your
54
56
merge to ``main ``. This will automatically run CI testing and verify
55
57
that your changes will work across all supported platforms.
56
58
57
- For code verification, someone from the development team for the PyAnsys library
58
- will review your code to verify that it meets our standards. Once your code
59
- is approved, if you have write permission, you may merge the PR branch. If you
60
- don't have write permission, the reviewer or someone else with write permission
61
- will merge and delete the PR branch.
59
+ For code verification, someone from the PyAnsys development team will review your
60
+ code to verify that it meets our standards. Once your code is approved, if you
61
+ have write permission, you may merge the PR branch. If you don't have write
62
+ permission, the reviewer or someone else with write permission will merge your
63
+ PR and then delete your PR branch.
62
64
63
65
If your PR branch is a ``fix/ `` branch, do not delete it because it may be necessary to
64
- merge your PR branch with the current release branch. See the next section for branch
65
- naming conventions.
66
+ merge your PR branch with the current release branch. The next section explains our
67
+ branch naming conventions.
66
68
67
69
.. _branch_naming :
68
70
@@ -124,7 +126,8 @@ like this:
124
126
125
127
Documentation
126
128
-------------
127
- Documentation for a PyAnsys library is generated from three sources:
129
+ The source and content for documentation varies from repository to repository. For a PyAnsys library,
130
+ documentation is generated from three sources:
128
131
129
132
- Docstrings from the library's classes, functions, and modules using
130
133
`sphinx.ext.autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html >`_.
@@ -161,21 +164,21 @@ and will be compiled dynamically during the build process. Always ensure that
161
164
examples run properly locally because they will be verified through the CI performed
162
165
via GitHub Actions.
163
166
164
- Documentation for the latest stable release of a PyAnsys libary is accessible
165
- from its repository. You can access the latest development version of the
167
+ Documentation for the latest stable release of a PyAnsys library is accessible
168
+ from its repository. You can generally access the latest development version of the
166
169
documentation tracking the ``main `` branch by adding the prefix ``dev. `` to
167
- the URL for the latest stable release. For example, the URL for the latest
168
- stable release of the PyAEDT documentation is
169
- `< https://dev.aedtdocs.pyansys.com/ >`_, and the URL for the latest development
170
- version of this documentation is `<https://dev.aedtdocs.pyansys.com/ >`_. The
171
- latest development version is kept up-to-date automatically via GitHub actions.
170
+ the URL for the latest stable release. For example, the URL for documentation of the
171
+ latest stable release of PyAEDT is `< https://aedtdocs.pyansys.com/ >`_, and
172
+ the URL for the latest documentation for the development version of PyAEDT is
173
+ `<https://dev.aedtdocs.pyansys.com/ >`_. The latest development versions of both
174
+ the library and its documentation are kept up-to-date automatically via GitHub actions.
172
175
173
- Building the Documentation Locally
174
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
- You can build and verify a library's HTML documentation locally by installing
176
- Sphinx and other documentation build dependencies.
176
+ Building Documentation Locally
177
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178
+ You can build and verify the HTML documentation for a PyAnsys project locally
179
+ by installing Sphinx and other documentation build dependencies.
177
180
178
- #. Optionally install the library in development mode:
181
+ #. Optionally install the project in development mode:
179
182
180
183
.. code ::
181
184
@@ -201,14 +204,14 @@ Otherwise, if running on Windows, build the documentation:
201
204
cd doc
202
205
make.bat html
203
206
204
- #. After documentation builds successfully locally, use your
205
- browser to open the file `` index.html `` in `` doc/_build/html/ ``
206
- to review it .
207
+ #. After documentation builds successfully locally, navigate to
208
+ `` doc/_build/html/ `` and use your browser to open the
209
+ `` index.html `` so that you can review the documenation .
207
210
208
211
Continuous Integration and Continuous Delivery (CI/CD)
209
212
------------------------------------------------------
210
213
211
- A PyAnsys library uses continuous integration (CI) and continuous delivery (CD)
214
+ A PyAnsys project uses continuous integration (CI) and continuous delivery (CD)
212
215
to automate building, testing, and deployment tasks. The CI pipeline is
213
216
deployed on both GitHub Actions and Azure Pipelines and performs the following
214
217
tasks:
@@ -218,9 +221,11 @@ tasks:
218
221
- Spelling and style verification
219
222
- Documentation build
220
223
224
+ .. _branching_model :
225
+
221
226
Branching Model
222
227
---------------
223
- The branching model for a PyAnsys library enables rapid development of
228
+ The branching model for a PyAnsys project enables rapid development of
224
229
features without sacrificing stability. The model closely follows the
225
230
`Trunk Based Development <https://trunkbaseddevelopment.com/ >`_ approach:
226
231
@@ -276,11 +281,10 @@ Release procedures follow for major and minor releases.
276
281
#. After building the documentation, open the local build and examine
277
282
the examples for any obvious issues.
278
283
279
- #. Update the version numbers in
280
- ``ansys/<product>/<library>/_version.py `` and commit this file. Push the
281
- branch to GitHub and create a new PR for this release that merges
282
- it to ``main ``. While effort is focused on the release, development
283
- to ``main `` should be limited.
284
+ #. Update the version numbers in ``ansys/<product>/<library>/_version.py ``
285
+ and commit this file. Push the branch to GitHub and create a new PR
286
+ for this release that merges it to ``main ``. While effort is focused
287
+ on the release, development to ``main `` should be limited.
284
288
285
289
#. Wait for the PyAnsys developers and community to functionally test the
286
290
new release. Testors should locally install this branch and use it in
@@ -327,11 +331,12 @@ should not wait until a minor release. These are the steps for a patch release:
327
331
an opportunity to validate and approve the bug fix release. Any
328
332
additional hotfixes should be outside of this PR.
329
333
330
- #. When the PR is approved, merge it with the release branch, but not with
331
- ``main `` as there is no reason to increment the version of the ``main `` branch.
334
+ #. When the PR is approved, merge it with the release branch but not with
335
+ ``main `` because there is no reason to increment the version of the
336
+ ``main `` branch.
332
337
333
338
#. Create a tag from the release branch with the applicable version number
334
339
as described in the previous section.
335
340
336
- 4 . If deemed necessary, create and add release notes as described in the
341
+ # . If deemed necessary, create and add release notes as described in the
337
342
previous section.
0 commit comments