Skip to content

Commit a11ad80

Browse files
committed
docs: deprecating a library
1 parent 5d630b8 commit a11ad80

File tree

3 files changed

+136
-1
lines changed

3 files changed

+136
-1
lines changed

doc/source/how-to/deprecating.rst

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.. _deprecating:
2+
3+
Deprecating a library
4+
=====================
5+
6+
As time passes, some libraries may become outdated or replaced by better alternatives.
7+
When this happens, it is important to deprecate the old library properly to ensure users
8+
are aware of the change and can transition smoothly.
9+
10+
In the PyAnsys ecosystem, we follow a specific process for deprecating libraries.
11+
This process helps maintain clarity and consistency across our projects.
12+
13+
Maintainer tasks
14+
----------------
15+
16+
When a library is no longer maintained or has been replaced by a better alternative,
17+
18+
If you are a maintainer of a library that is being deprecated, please follow these steps. As
19+
an illustrative example, the deprecation of `PyAdditive Widgets <https://github.com/ansys/pyadditive-widgets>`_
20+
is used in this guide.
21+
22+
1. **Inform the PyAnsys Core team**: Before proceeding with the deprecation, it is essential to
23+
inform the PyAnsys Core team. This can be done by sending an email to
24+
the team at `[email protected] <pyansys_core_email_>`_. This step ensures that the
25+
deprecation is communicated effectively and that the team can assist with any necessary
26+
changes in the PyAnsys ecosystem.
27+
2. **Close all open issues and pull requests**: Before deprecating the library, ensure that all
28+
open issues and pull requests in the library's repository are closed. This helps to avoid
29+
confusion and ensures that users are aware that the library is no longer actively maintained.
30+
You can close issues and pull requests with a comment explaining that the library is being
31+
deprecated and will no longer be supported.
32+
3. **Create a deprecation issue**: Open an issue in the library's repository to announce the
33+
deprecation. This issue should explain why the library is being deprecated, what alternatives
34+
are available, and any relevant timelines. See a template below for the issue content.
35+
36+
.. warning::
37+
38+
Make sure to adapt the template to your specific library and situation!
39+
40+
.. code:: markdown
41+
42+
## ⚠️ Project Deprecation Notice
43+
44+
**This repository is no longer maintained as of [DATE].**
45+
46+
### Reason for deprecation
47+
[Explain briefly why the project is being deprecated — e.g., better alternatives, no time to maintain, outdated use case.]
48+
49+
### Alternatives
50+
If you're looking for a maintained alternative, consider:
51+
- [Alternative 1](https://...)
52+
- [Alternative 2](https://...)
53+
54+
### What this means
55+
- No further updates, bug fixes, or pull request reviews
56+
- Issues will be closed
57+
- The repository will be archived
58+
59+
Thank you to everyone who contributed, used, or supported this project!
60+
61+
This issue will serve as a permanent record of the deprecation and provide users with
62+
necessary information about alternatives.
63+
64+
Make sure to pin the issue to the top of the repository so that it is easily visible to users.
65+
This can be done by selecting the "Pin issue" option in the issue's right-side menu, on GitHub.
66+
67+
See an example at `PyAdditive Widgets deprecation issue`_.
68+
69+
4. **Adapt the README**: Update the library's README file to reflect the deprecation.
70+
This should include a clear notice at the top of the README, informing users that the
71+
library is deprecated. See an example at `PyAdditive Widgets README`_.
72+
73+
5. **(Optional) Add a warning in the code**: If applicable, add a warning in the code itself to inform users
74+
that the library is deprecated. This can be done using Python's `warnings` module. For example:
75+
76+
.. code:: python
77+
78+
# At the top of your main module or package (i.e. src/ansys/<...>/__init__.py)
79+
80+
import warnings
81+
82+
warnings.warn(
83+
"This library is deprecated and will no longer be maintained. "
84+
"Please consider using alternatives.",
85+
DeprecationWarning,
86+
)
87+
88+
See an example at `PyAdditive Widgets deprecation warning`_.
89+
90+
6. **(Optional) Make a last release**: If you carried out step 5, consider making a final release
91+
of the library that includes the deprecation warning. This ensures that users who install
92+
the library in the future will see the warning immediately.
93+
94+
7. **Archive the repository**: Once the deprecation issue is created and the README is updated,
95+
you can archive the repository. This will prevent any further changes to the repository and
96+
signal to users that the library is no longer maintained. To archive a repository, go to the
97+
repository settings and select "Archive this repository".
98+
99+
These steps ensure that the deprecation process is clear and transparent, allowing users to
100+
transition smoothly to alternatives while maintaining the integrity of the PyAnsys ecosystem.
101+
102+
.. note::
103+
104+
The deprecation process may vary slightly depending on the specific library and its
105+
context. However, the core principles should remain consistent across all deprecations.
106+
107+
Core team tasks
108+
---------------
109+
110+
The PyAnsys Core team will assist with the deprecation process by:
111+
112+
- Reviewing the deprecation issue to ensure it meets the project's standards.
113+
- Assisting with the above steps, if necessary.
114+
- Remove from PyPI the configuration (PyPI token or trusted publisher) for the library.
115+
- Removing the library from the `PyAnsys metapackage <metapackage_>`_, automation project
116+
and the ``ansys-internal/pyansys-dev`` repository. See example pull requests:
117+
118+
- `Metapackage deprecation PR`_
119+
- `PyAnsys Dev deprecation PR`_
120+
- `Automation project deprecation PR`_

doc/source/how-to/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ and app APIs.
106106

107107
How to handle vulnerabilities in PyAnsys packages.
108108

109+
.. grid-item-card:: :fas:`fa-solid fa-bug` Deprecating a library
110+
:link: deprecating
111+
:link-type: doc
112+
:padding: 2 2 2 2
113+
114+
How to deprecate a PyAnsys library.
109115

110116
.. toctree::
111117
:maxdepth: 3
@@ -125,3 +131,4 @@ and app APIs.
125131
dns-configuration
126132
compatibility
127133
vulnerabilities
134+
deprecating

doc/source/links.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,19 @@
212212
.. _PyPI API token: https://pypi.org/help/#apitoken
213213

214214
.. #Vulnerabilities
215-
.. _metapackage: https://github.com/pyansys/pyansys
215+
.. _metapackage: https://github.com/ansys/pyansys
216216
.. _CVE: https://www.cve.org/
217217
.. _Safety: https://pyup.io/safety/
218218
.. _Bandit: https://bandit.readthedocs.io/en/latest/
219219
.. _the action's documentation: https://actions.docs.ansys.com/version/stable/vulnerability-actions/index.html#check-vulnerabilities-action
220220
.. _PyACP security considerations: https://acp.docs.pyansys.com/version/dev/user_guide/security_considerations.html
221221
.. _Github's documentation: https://docs.github.com/en/code-security/security-advisories/working-with-repository-security-advisories/collaborating-in-a-temporary-private-fork-to-resolve-a-repository-security-vulnerability
222222
.. _PyAnsys Geometry subprocess advisory: https://github.com/ansys/pyansys-geometry/security/advisories/GHSA-38jr-29fh-w9vm
223+
224+
.. #Deprecation
225+
.. _PyAdditive Widgets README: https://github.com/ansys/pyadditive-widgets/blob/main/README.rst
226+
.. _PyAdditive Widgets deprecation issue: https://github.com/ansys/pyadditive-widgets/issues/102
227+
.. _PyAdditive Widgets deprecation warning: https://github.com/ansys/pyadditive-widgets/blob/600915a8db2dbb02088266c17ba2be53584079d0/src/ansys/additive/widgets/__init__.py#L24-L31
228+
.. _Metapackage deprecation PR: https://github.com/ansys/pyansys/pull/968
229+
.. _PyAnsys Dev deprecation PR: https://github.com/ansys-internal/pyansys-dev/pull/44
230+
.. _Automation project deprecation PR: https://github.com/ansys-internal/pyansys-maintenance-automation/pull/79

0 commit comments

Comments
 (0)