ansys-pre-commit-hooks 0.3.2__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. ansys_pre_commit_hooks-0.3.2/README.rst → ansys_pre_commit_hooks-0.4.0/PKG-INFO +95 -5
  2. ansys_pre_commit_hooks-0.3.2/PKG-INFO → ansys_pre_commit_hooks-0.4.0/README.rst +58 -38
  3. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/pyproject.toml +17 -6
  4. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/tech_review.py +737 -0
  5. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/AUTHORS +12 -0
  6. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/CODE_OF_CONDUCT.md +65 -0
  7. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/CONTRIBUTING.md +12 -0
  8. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/CONTRIBUTORS.md +9 -0
  9. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/LICENSE +21 -0
  10. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/README.md +81 -0
  11. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/README.rst +107 -0
  12. ansys_pre_commit_hooks-0.4.0/src/ansys/pre_commit_hooks/templates/dependabot.yml +16 -0
  13. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/LICENSE +0 -0
  14. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/src/ansys/pre_commit_hooks/__init__.py +0 -0
  15. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/src/ansys/pre_commit_hooks/add_license_headers.py +0 -0
  16. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/src/ansys/pre_commit_hooks/assets/.reuse/templates/ansys.jinja2 +0 -0
  17. {ansys_pre_commit_hooks-0.3.2 → ansys_pre_commit_hooks-0.4.0}/src/ansys/pre_commit_hooks/assets/LICENSES/MIT.txt +0 -0
@@ -1,3 +1,39 @@
1
+ Metadata-Version: 2.1
2
+ Name: ansys-pre-commit-hooks
3
+ Version: 0.4.0
4
+ Summary: A Python wrapper to create Ansys-tailored pre-commit hooks
5
+ Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
+ Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
7
+ Requires-Python: >=3.9,<4
8
+ Description-Content-Type: text/x-rst
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Dist: GitPython==3.1.43
17
+ Requires-Dist: importlib-metadata==8.0.0
18
+ Requires-Dist: Jinja2==3.1.4
19
+ Requires-Dist: reuse==3.0.2
20
+ Requires-Dist: requests==2.32.3
21
+ Requires-Dist: semver==3.0.2
22
+ Requires-Dist: toml==0.10.2
23
+ Requires-Dist: ansys-sphinx-theme[autoapi]==0.16.6 ; extra == "doc"
24
+ Requires-Dist: numpydoc==1.7.0 ; extra == "doc"
25
+ Requires-Dist: sphinx==7.3.7 ; extra == "doc"
26
+ Requires-Dist: sphinx-autodoc-typehints==2.2.2 ; extra == "doc"
27
+ Requires-Dist: sphinx-copybutton==0.5.1 ; extra == "doc"
28
+ Requires-Dist: pytest==8.2.2 ; extra == "tests"
29
+ Requires-Dist: pytest-cov==5.0.0 ; extra == "tests"
30
+ Project-URL: Documentation, https://pre-commit-hooks.docs.ansys.com
31
+ Project-URL: Homepage, https://github.com/ansys/pre-commit-hooks
32
+ Project-URL: Source, https://github.com/ansys/pre-commit-hooks
33
+ Project-URL: Tracker, https://github.com/ansys/pre-commit-hooks/issues
34
+ Provides-Extra: doc
35
+ Provides-Extra: tests
36
+
1
37
  Ansys pre-commit hooks
2
38
  ======================
3
39
  |pyansys| |python| |pypi| |GH-CI| |MIT| |black| |pre-commit-ci|
@@ -36,8 +72,8 @@ Currently, these hooks are available:
36
72
  * ``add-license-headers``: Add missing license headers to files by using
37
73
  `REUSE <https://reuse.software/>`_ . To use this hook, you must
38
74
  have ``REUSE`` implemented in your repository.
39
-
40
- |
75
+ * ``tech-review``: Do a technical review of your repository according to
76
+ `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_`
41
77
 
42
78
  ``add-license-headers`` setup
43
79
  -----------------------------
@@ -84,7 +120,7 @@ Set custom arguments
84
120
  .. code:: yaml
85
121
 
86
122
  - repo: https://github.com/ansys/pre-commit-hooks
87
- rev: v0.3.2
123
+ rev: v0.4.0
88
124
  hooks:
89
125
  - id: add-license-headers
90
126
  args: ["--custom_copyright", "custom copyright phrase", "--custom_template", "template_name", "--custom_license", "license_name", "--ignore_license_check", "--start_year", "2023"]
@@ -129,7 +165,7 @@ the hook should run on, add the necessary regex to the ``files`` line in your
129
165
  .. code:: yaml
130
166
 
131
167
  - repo: https://github.com/ansys/pre-commit-hooks
132
- rev: v0.3.2
168
+ rev: v0.4.0
133
169
  hooks:
134
170
  - id: add-license-headers
135
171
  files: '(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'
@@ -142,7 +178,7 @@ In .pre-commit-config.yaml:
142
178
  .. code:: yaml
143
179
 
144
180
  - repo: https://github.com/ansys/pre-commit-hooks
145
- rev: v0.3.2
181
+ rev: v0.4.0
146
182
  hooks:
147
183
  - id: add-license-headers
148
184
  exclude: |
@@ -160,6 +196,59 @@ In .pre-commit-config.yaml:
160
196
  * ``.*\.js`` excludes all .js files in all directories.
161
197
  * ``\..*`` excludes all hidden files.
162
198
 
199
+ ``tech-review`` setup
200
+ ---------------------
201
+
202
+ These are the default values for the arguments of the tech-review hook:
203
+
204
+ * ``--author_maint_name=ANSYS, Inc.``
205
+ * ``--author_maint_email=pyansys.core@ansys.com``
206
+ * ``--license=MIT``
207
+ * ``--url=https://github.com/ansys/{repo-name}``, replacing ``repo-name`` with the name of the repository
208
+
209
+ The ``--author_maint_name`` is the name of the author and maintainer in the ``pyproject.toml`` file.
210
+ By default, it is "Ansys, Inc.".
211
+
212
+ The ``--author_maint_email`` is the email of the author and maintainer in the ``pyproject.toml`` file.
213
+ By default, it is "pyansys.core@ansys.com".
214
+
215
+ The ``--license`` argument is the license that is being used by your repository. By default, it is
216
+ MIT.
217
+
218
+ The ``--url`` argument is automatically rendered based on the repository name. If your repository
219
+ is not in the Ansys organization, please add this argument to your configuration in
220
+ .pre-commit-config.yaml.
221
+
222
+ The ``--product`` argument is required if a ``README.rst`` or ``README.md`` file does not
223
+ exist in your repository and you want the template to render correctly. The product
224
+ for ``PyMechanical`` would be ``mechanical``, for example.
225
+
226
+ The ``--non_compliant_name`` flag can be used if your repository does not follow the typical
227
+ naming convention of ``ansys-*-*``.
228
+
229
+ Technical review hook in ``ansys/pre-commit-hooks``' .pre-commit-config.yaml file:
230
+
231
+ .. code:: yaml
232
+
233
+ - repo: https://github.com/ansys/pre-commit-hooks
234
+ rev: v0.4.0
235
+ hooks:
236
+ - id: tech-review
237
+ args:
238
+ - --product=pre_commit_hooks
239
+ - --non_compliant_name
240
+
241
+ Technical review hook in ``PyMechanical``'s .pre-commit-config.yaml file:
242
+
243
+ .. code:: yaml
244
+
245
+ - repo: https://github.com/ansys/pre-commit-hooks
246
+ rev: v0.4.0
247
+ hooks:
248
+ - id: tech-review
249
+ args:
250
+ - --product=mechanical
251
+
163
252
 
164
253
  How to install
165
254
  --------------
@@ -331,3 +420,4 @@ the building requirements and then execute the build module with these commands:
331
420
  .. _pytest: https://docs.pytest.org/en/stable/
332
421
  .. _Sphinx: https://www.sphinx-doc.org/en/master/
333
422
  .. _tox: https://tox.wiki/
423
+
@@ -1,35 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: ansys-pre-commit-hooks
3
- Version: 0.3.2
4
- Summary: A Python wrapper to create Ansys-tailored pre-commit hooks
5
- Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
- Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
7
- Requires-Python: >=3.9,<4
8
- Description-Content-Type: text/x-rst
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Operating System :: OS Independent
16
- Requires-Dist: importlib-metadata==7.1.0
17
- Requires-Dist: reuse==3.0.2
18
- Requires-Dist: GitPython==3.1.43
19
- Requires-Dist: ansys-sphinx-theme[autoapi]==0.16.5 ; extra == "doc"
20
- Requires-Dist: numpydoc==1.7.0 ; extra == "doc"
21
- Requires-Dist: sphinx==7.3.7 ; extra == "doc"
22
- Requires-Dist: sphinx-autodoc-typehints==2.1.1 ; extra == "doc"
23
- Requires-Dist: sphinx-copybutton==0.5.1 ; extra == "doc"
24
- Requires-Dist: pytest==8.2.2 ; extra == "tests"
25
- Requires-Dist: pytest-cov==5.0.0 ; extra == "tests"
26
- Project-URL: Documentation, https://pre-commit-hooks.docs.ansys.com
27
- Project-URL: Homepage, https://github.com/ansys/pre-commit-hooks
28
- Project-URL: Source, https://github.com/ansys/pre-commit-hooks
29
- Project-URL: Tracker, https://github.com/ansys/pre-commit-hooks/issues
30
- Provides-Extra: doc
31
- Provides-Extra: tests
32
-
33
1
  Ansys pre-commit hooks
34
2
  ======================
35
3
  |pyansys| |python| |pypi| |GH-CI| |MIT| |black| |pre-commit-ci|
@@ -68,8 +36,8 @@ Currently, these hooks are available:
68
36
  * ``add-license-headers``: Add missing license headers to files by using
69
37
  `REUSE <https://reuse.software/>`_ . To use this hook, you must
70
38
  have ``REUSE`` implemented in your repository.
71
-
72
- |
39
+ * ``tech-review``: Do a technical review of your repository according to
40
+ `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_`
73
41
 
74
42
  ``add-license-headers`` setup
75
43
  -----------------------------
@@ -116,7 +84,7 @@ Set custom arguments
116
84
  .. code:: yaml
117
85
 
118
86
  - repo: https://github.com/ansys/pre-commit-hooks
119
- rev: v0.3.2
87
+ rev: v0.4.0
120
88
  hooks:
121
89
  - id: add-license-headers
122
90
  args: ["--custom_copyright", "custom copyright phrase", "--custom_template", "template_name", "--custom_license", "license_name", "--ignore_license_check", "--start_year", "2023"]
@@ -161,7 +129,7 @@ the hook should run on, add the necessary regex to the ``files`` line in your
161
129
  .. code:: yaml
162
130
 
163
131
  - repo: https://github.com/ansys/pre-commit-hooks
164
- rev: v0.3.2
132
+ rev: v0.4.0
165
133
  hooks:
166
134
  - id: add-license-headers
167
135
  files: '(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'
@@ -174,7 +142,7 @@ In .pre-commit-config.yaml:
174
142
  .. code:: yaml
175
143
 
176
144
  - repo: https://github.com/ansys/pre-commit-hooks
177
- rev: v0.3.2
145
+ rev: v0.4.0
178
146
  hooks:
179
147
  - id: add-license-headers
180
148
  exclude: |
@@ -192,6 +160,59 @@ In .pre-commit-config.yaml:
192
160
  * ``.*\.js`` excludes all .js files in all directories.
193
161
  * ``\..*`` excludes all hidden files.
194
162
 
163
+ ``tech-review`` setup
164
+ ---------------------
165
+
166
+ These are the default values for the arguments of the tech-review hook:
167
+
168
+ * ``--author_maint_name=ANSYS, Inc.``
169
+ * ``--author_maint_email=pyansys.core@ansys.com``
170
+ * ``--license=MIT``
171
+ * ``--url=https://github.com/ansys/{repo-name}``, replacing ``repo-name`` with the name of the repository
172
+
173
+ The ``--author_maint_name`` is the name of the author and maintainer in the ``pyproject.toml`` file.
174
+ By default, it is "Ansys, Inc.".
175
+
176
+ The ``--author_maint_email`` is the email of the author and maintainer in the ``pyproject.toml`` file.
177
+ By default, it is "pyansys.core@ansys.com".
178
+
179
+ The ``--license`` argument is the license that is being used by your repository. By default, it is
180
+ MIT.
181
+
182
+ The ``--url`` argument is automatically rendered based on the repository name. If your repository
183
+ is not in the Ansys organization, please add this argument to your configuration in
184
+ .pre-commit-config.yaml.
185
+
186
+ The ``--product`` argument is required if a ``README.rst`` or ``README.md`` file does not
187
+ exist in your repository and you want the template to render correctly. The product
188
+ for ``PyMechanical`` would be ``mechanical``, for example.
189
+
190
+ The ``--non_compliant_name`` flag can be used if your repository does not follow the typical
191
+ naming convention of ``ansys-*-*``.
192
+
193
+ Technical review hook in ``ansys/pre-commit-hooks``' .pre-commit-config.yaml file:
194
+
195
+ .. code:: yaml
196
+
197
+ - repo: https://github.com/ansys/pre-commit-hooks
198
+ rev: v0.4.0
199
+ hooks:
200
+ - id: tech-review
201
+ args:
202
+ - --product=pre_commit_hooks
203
+ - --non_compliant_name
204
+
205
+ Technical review hook in ``PyMechanical``'s .pre-commit-config.yaml file:
206
+
207
+ .. code:: yaml
208
+
209
+ - repo: https://github.com/ansys/pre-commit-hooks
210
+ rev: v0.4.0
211
+ hooks:
212
+ - id: tech-review
213
+ args:
214
+ - --product=mechanical
215
+
195
216
 
196
217
  How to install
197
218
  --------------
@@ -363,4 +384,3 @@ the building requirements and then execute the build module with these commands:
363
384
  .. _pytest: https://docs.pytest.org/en/stable/
364
385
  .. _Sphinx: https://www.sphinx-doc.org/en/master/
365
386
  .. _tox: https://tox.wiki/
366
-
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
  [project]
6
6
  # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
7
7
  name = "ansys-pre-commit-hooks"
8
- version = "0.3.2"
8
+ version = "0.4.0"
9
9
  description = "A Python wrapper to create Ansys-tailored pre-commit hooks"
10
10
  readme = "README.rst"
11
11
  requires-python = ">=3.9,<4"
@@ -27,9 +27,13 @@ classifiers = [
27
27
  "Operating System :: OS Independent",
28
28
  ]
29
29
  dependencies = [
30
- "importlib-metadata==7.1.0",
31
- "reuse==3.0.2",
32
30
  "GitPython==3.1.43",
31
+ "importlib-metadata==8.0.0",
32
+ "Jinja2==3.1.4",
33
+ "reuse==3.0.2",
34
+ "requests==2.32.3",
35
+ "semver==3.0.2",
36
+ "toml==0.10.2",
33
37
  ]
34
38
 
35
39
  [project.optional-dependencies]
@@ -38,10 +42,10 @@ tests = [
38
42
  "pytest-cov==5.0.0",
39
43
  ]
40
44
  doc = [
41
- "ansys-sphinx-theme[autoapi]==0.16.5",
45
+ "ansys-sphinx-theme[autoapi]==0.16.6",
42
46
  "numpydoc==1.7.0",
43
47
  "sphinx==7.3.7",
44
- "sphinx-autodoc-typehints==2.1.1",
48
+ "sphinx-autodoc-typehints==2.2.2",
45
49
  "sphinx-copybutton==0.5.1",
46
50
  ]
47
51
 
@@ -51,6 +55,7 @@ name = "ansys.pre_commit_hooks"
51
55
 
52
56
  [project.scripts]
53
57
  add-license-headers = "ansys.pre_commit_hooks.add_license_headers:main"
58
+ tech-review = "ansys.pre_commit_hooks.tech_review:main"
54
59
 
55
60
  [project.urls]
56
61
  Source = "https://github.com/ansys/pre-commit-hooks"
@@ -58,7 +63,6 @@ Tracker = "https://github.com/ansys/pre-commit-hooks/issues"
58
63
  Homepage = "https://github.com/ansys/pre-commit-hooks"
59
64
  Documentation = "https://pre-commit-hooks.docs.ansys.com"
60
65
 
61
-
62
66
  [tool.black]
63
67
  line-length = 100
64
68
 
@@ -68,6 +72,9 @@ force_sort_within_sections = true
68
72
  line_length = 100
69
73
  src_paths = ["doc", "src", "tests"]
70
74
 
75
+ [tool.codespell]
76
+ ignore-words = "doc/styles/config/vocabularies/ANSYS/accept.txt"
77
+
71
78
  [tool.coverage.run]
72
79
  source = ["ansys.pre_commit_hooks"]
73
80
 
@@ -80,6 +87,10 @@ addopts = "--cov=ansys.pre_commit_hooks --cov-report term-missing -vv"
80
87
  testpaths = [
81
88
  "tests",
82
89
  ]
90
+ markers = [
91
+ "license_headers: marks tests for add-license-headers hook",
92
+ "tech_review: marks tests for tech-review hook",
93
+ ]
83
94
 
84
95
  [tool.towncrier]
85
96
  package = "ansys.pre_commit_hooks"