ansys-pre-commit-hooks 0.4.1__tar.gz → 0.4.2__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 (35) hide show
  1. {ansys_pre_commit_hooks-0.4.1/src/ansys_pre_commit_hooks.egg-info → ansys_pre_commit_hooks-0.4.2}/PKG-INFO +12 -12
  2. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/README.rst +6 -6
  3. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/pyproject.toml +1 -1
  4. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/setup.py +5 -5
  5. ansys_pre_commit_hooks-0.4.2/src/ansys/pre_commit_hooks/VERSION +1 -0
  6. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/__pycache__/__init__.cpython-310.pyc +0 -0
  7. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/__pycache__/tech_review.cpython-310.pyc +0 -0
  8. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/add_license_headers.py +5 -3
  9. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/tech_review.py +2 -2
  10. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2/src/ansys_pre_commit_hooks.egg-info}/PKG-INFO +12 -12
  11. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys_pre_commit_hooks.egg-info/requires.txt +5 -5
  12. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/tests/test_reuse.py +1 -2
  13. ansys_pre_commit_hooks-0.4.1/src/ansys/pre_commit_hooks/VERSION +0 -1
  14. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/AUTHORS.md +0 -0
  15. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/LICENSE +0 -0
  16. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/MANIFEST.in +0 -0
  17. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/setup.cfg +0 -0
  18. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/__init__.py +0 -0
  19. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/assets/.reuse/templates/ansys.jinja2 +0 -0
  20. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/assets/LICENSES/MIT.txt +0 -0
  21. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/assets/licenses.json +0 -0
  22. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/AUTHORS +0 -0
  23. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/CODE_OF_CONDUCT.md +0 -0
  24. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/CONTRIBUTING.md +0 -0
  25. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/CONTRIBUTORS.md +0 -0
  26. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/LICENSE +0 -0
  27. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/README.md +0 -0
  28. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/README.rst +0 -0
  29. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys/pre_commit_hooks/templates/dependabot.yml +0 -0
  30. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys_pre_commit_hooks.egg-info/SOURCES.txt +0 -0
  31. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys_pre_commit_hooks.egg-info/dependency_links.txt +0 -0
  32. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys_pre_commit_hooks.egg-info/entry_points.txt +0 -0
  33. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/src/ansys_pre_commit_hooks.egg-info/top_level.txt +0 -0
  34. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/tests/test_metadata.py +0 -0
  35. {ansys_pre_commit_hooks-0.4.1 → ansys_pre_commit_hooks-0.4.2}/tests/test_tech_review.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ansys-pre-commit-hooks
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A Python wrapper to create Ansys-tailored pre-commit hooks
5
5
  Home-page: https://github.com/ansys/pre-commit-hooks
6
6
  Author: ANSYS, Inc.
@@ -25,20 +25,20 @@ Requires-Python: >=3.9,<4
25
25
  License-File: LICENSE
26
26
  License-File: AUTHORS.md
27
27
  Requires-Dist: GitPython==3.1.43
28
- Requires-Dist: importlib-metadata==8.0.0
28
+ Requires-Dist: importlib-metadata==8.2.0
29
29
  Requires-Dist: Jinja2==3.1.4
30
- Requires-Dist: reuse==3.0.2
30
+ Requires-Dist: reuse==4.0.3
31
31
  Requires-Dist: requests==2.32.3
32
32
  Requires-Dist: semver==3.0.2
33
33
  Requires-Dist: toml==0.10.2
34
34
  Provides-Extra: doc
35
35
  Requires-Dist: ansys-sphinx-theme[autoapi]==0.16.6; extra == "doc"
36
36
  Requires-Dist: numpydoc==1.7.0; extra == "doc"
37
- Requires-Dist: sphinx==7.4.0; extra == "doc"
38
- Requires-Dist: sphinx-autodoc-typehints==2.2.2; extra == "doc"
37
+ Requires-Dist: sphinx==7.4.7; extra == "doc"
38
+ Requires-Dist: sphinx-autodoc-typehints==2.2.3; extra == "doc"
39
39
  Requires-Dist: sphinx-copybutton==0.5.1; extra == "doc"
40
40
  Provides-Extra: tests
41
- Requires-Dist: pytest==8.2.2; extra == "tests"
41
+ Requires-Dist: pytest==8.3.2; extra == "tests"
42
42
  Requires-Dist: pytest-cov==5.0.0; extra == "tests"
43
43
 
44
44
  Ansys pre-commit hooks
@@ -80,7 +80,7 @@ Currently, these hooks are available:
80
80
  `REUSE <https://reuse.software/>`_ . To use this hook, you must
81
81
  have ``REUSE`` implemented in your repository.
82
82
  * ``tech-review``: Do a technical review of your repository according to
83
- `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_`
83
+ `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_
84
84
 
85
85
  ``add-license-headers`` setup
86
86
  -----------------------------
@@ -127,7 +127,7 @@ Set custom arguments
127
127
  .. code:: yaml
128
128
 
129
129
  - repo: https://github.com/ansys/pre-commit-hooks
130
- rev: v0.4.1
130
+ rev: v0.4.2
131
131
  hooks:
132
132
  - id: add-license-headers
133
133
  args: ["--custom_copyright", "custom copyright phrase", "--custom_template", "template_name", "--custom_license", "license_name", "--ignore_license_check", "--start_year", "2023"]
@@ -172,7 +172,7 @@ the hook should run on, add the necessary regex to the ``files`` line in your
172
172
  .. code:: yaml
173
173
 
174
174
  - repo: https://github.com/ansys/pre-commit-hooks
175
- rev: v0.4.1
175
+ rev: v0.4.2
176
176
  hooks:
177
177
  - id: add-license-headers
178
178
  files: '(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'
@@ -185,7 +185,7 @@ In .pre-commit-config.yaml:
185
185
  .. code:: yaml
186
186
 
187
187
  - repo: https://github.com/ansys/pre-commit-hooks
188
- rev: v0.4.1
188
+ rev: v0.4.2
189
189
  hooks:
190
190
  - id: add-license-headers
191
191
  exclude: |
@@ -238,7 +238,7 @@ Technical review hook in ``ansys/pre-commit-hooks``' .pre-commit-config.yaml fil
238
238
  .. code:: yaml
239
239
 
240
240
  - repo: https://github.com/ansys/pre-commit-hooks
241
- rev: v0.4.1
241
+ rev: v0.4.2
242
242
  hooks:
243
243
  - id: tech-review
244
244
  args:
@@ -250,7 +250,7 @@ Technical review hook in ``PyMechanical``'s .pre-commit-config.yaml file:
250
250
  .. code:: yaml
251
251
 
252
252
  - repo: https://github.com/ansys/pre-commit-hooks
253
- rev: v0.4.1
253
+ rev: v0.4.2
254
254
  hooks:
255
255
  - id: tech-review
256
256
  args:
@@ -37,7 +37,7 @@ Currently, these hooks are available:
37
37
  `REUSE <https://reuse.software/>`_ . To use this hook, you must
38
38
  have ``REUSE`` implemented in your repository.
39
39
  * ``tech-review``: Do a technical review of your repository according to
40
- `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_`
40
+ `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_
41
41
 
42
42
  ``add-license-headers`` setup
43
43
  -----------------------------
@@ -84,7 +84,7 @@ Set custom arguments
84
84
  .. code:: yaml
85
85
 
86
86
  - repo: https://github.com/ansys/pre-commit-hooks
87
- rev: v0.4.1
87
+ rev: v0.4.2
88
88
  hooks:
89
89
  - id: add-license-headers
90
90
  args: ["--custom_copyright", "custom copyright phrase", "--custom_template", "template_name", "--custom_license", "license_name", "--ignore_license_check", "--start_year", "2023"]
@@ -129,7 +129,7 @@ the hook should run on, add the necessary regex to the ``files`` line in your
129
129
  .. code:: yaml
130
130
 
131
131
  - repo: https://github.com/ansys/pre-commit-hooks
132
- rev: v0.4.1
132
+ rev: v0.4.2
133
133
  hooks:
134
134
  - id: add-license-headers
135
135
  files: '(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'
@@ -142,7 +142,7 @@ In .pre-commit-config.yaml:
142
142
  .. code:: yaml
143
143
 
144
144
  - repo: https://github.com/ansys/pre-commit-hooks
145
- rev: v0.4.1
145
+ rev: v0.4.2
146
146
  hooks:
147
147
  - id: add-license-headers
148
148
  exclude: |
@@ -195,7 +195,7 @@ Technical review hook in ``ansys/pre-commit-hooks``' .pre-commit-config.yaml fil
195
195
  .. code:: yaml
196
196
 
197
197
  - repo: https://github.com/ansys/pre-commit-hooks
198
- rev: v0.4.1
198
+ rev: v0.4.2
199
199
  hooks:
200
200
  - id: tech-review
201
201
  args:
@@ -207,7 +207,7 @@ Technical review hook in ``PyMechanical``'s .pre-commit-config.yaml file:
207
207
  .. code:: yaml
208
208
 
209
209
  - repo: https://github.com/ansys/pre-commit-hooks
210
- rev: v0.4.1
210
+ rev: v0.4.2
211
211
  hooks:
212
212
  - id: tech-review
213
213
  args:
@@ -3,7 +3,7 @@ requires = [
3
3
  "setuptools>=42.0",
4
4
  "GitPython==3.1.43",
5
5
  "Jinja2==3.1.4",
6
- "reuse==3.0.2",
6
+ "reuse==4.0.3",
7
7
  "requests==2.32.3",
8
8
  "semver==3.0.2",
9
9
  "toml==0.10.2",
@@ -69,9 +69,9 @@ setup(
69
69
  python_requires=">=3.9,<4",
70
70
  install_requires=[
71
71
  "GitPython==3.1.43",
72
- "importlib-metadata==8.0.0",
72
+ "importlib-metadata==8.2.0",
73
73
  "Jinja2==3.1.4",
74
- "reuse==3.0.2",
74
+ "reuse==4.0.3",
75
75
  "requests==2.32.3",
76
76
  "semver==3.0.2",
77
77
  "toml==0.10.2",
@@ -80,12 +80,12 @@ setup(
80
80
  "doc": [
81
81
  "ansys-sphinx-theme[autoapi]==0.16.6",
82
82
  "numpydoc==1.7.0",
83
- "sphinx==7.4.0",
84
- "sphinx-autodoc-typehints==2.2.2",
83
+ "sphinx==7.4.7",
84
+ "sphinx-autodoc-typehints==2.2.3",
85
85
  "sphinx-copybutton==0.5.1",
86
86
  ],
87
87
  "tests": [
88
- "pytest==8.2.2",
88
+ "pytest==8.3.2",
89
89
  "pytest-cov==5.0.0",
90
90
  ],
91
91
  },
@@ -97,7 +97,10 @@ def set_lint_args(parser: argparse.ArgumentParser) -> argparse.Namespace:
97
97
  parser.add_argument("--ignore_license_check", action="store_true")
98
98
  parser.add_argument("--parser")
99
99
  parser.add_argument("--no_multiprocessing", action="store_true")
100
- lint.add_arguments(parser)
100
+
101
+ # Option for printing lint output
102
+ mutex_group = parser.add_mutually_exclusive_group()
103
+ mutex_group.add_argument("-q", "--quiet", action="store_true")
101
104
 
102
105
  return parser.parse_args()
103
106
 
@@ -241,7 +244,7 @@ def set_header_args(
241
244
  args.year = [current_year]
242
245
  else:
243
246
  args.year = [int(start_year), current_year]
244
- args.copyright_style = "string-c"
247
+ args.copyright_prefix = "string-c"
245
248
  args.copyright = [copyright]
246
249
  args.merge_copyrights = True
247
250
  args.template = template
@@ -697,7 +700,6 @@ def find_files_missing_header() -> int:
697
700
  # year, style, copyright-style, template, exclude-year, merge-copyrights, single-line,
698
701
  # multi-line, explicit-license, force-dot-license, recursive, no-replace,
699
702
  # skip-unrecognized, and skip-existing
700
- # header.add_arguments(parser)
701
703
  _annotate.add_arguments(parser)
702
704
 
703
705
  # Link the default template and/or license from the assets folder to your git repo.
@@ -346,7 +346,7 @@ def download_license_json(url: str, json_file: str) -> bool:
346
346
  # If the licenses.json file does not exist in the hook's folder
347
347
  if not pathlib.Path.exists(json_file):
348
348
  # Download licenses.json
349
- r = requests.get(url)
349
+ r = requests.get(url, timeout=60)
350
350
  status_code = r.status_code
351
351
  if status_code == 200:
352
352
  # If it was successfully downloaded, write content to file
@@ -545,7 +545,7 @@ def generate_file_from_jinja(
545
545
  """
546
546
  # Load the templates from the hook path
547
547
  loader = FileSystemLoader(searchpath=pathlib.PurePath.joinpath(HOOK_PATH, "templates"))
548
- env = Environment(loader=loader)
548
+ env = Environment(loader=loader) # nosec
549
549
  # Get the template for the specified file
550
550
  template = env.get_template(file)
551
551
  # Generate the file content from the template
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ansys-pre-commit-hooks
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A Python wrapper to create Ansys-tailored pre-commit hooks
5
5
  Home-page: https://github.com/ansys/pre-commit-hooks
6
6
  Author: ANSYS, Inc.
@@ -25,20 +25,20 @@ Requires-Python: >=3.9,<4
25
25
  License-File: LICENSE
26
26
  License-File: AUTHORS.md
27
27
  Requires-Dist: GitPython==3.1.43
28
- Requires-Dist: importlib-metadata==8.0.0
28
+ Requires-Dist: importlib-metadata==8.2.0
29
29
  Requires-Dist: Jinja2==3.1.4
30
- Requires-Dist: reuse==3.0.2
30
+ Requires-Dist: reuse==4.0.3
31
31
  Requires-Dist: requests==2.32.3
32
32
  Requires-Dist: semver==3.0.2
33
33
  Requires-Dist: toml==0.10.2
34
34
  Provides-Extra: doc
35
35
  Requires-Dist: ansys-sphinx-theme[autoapi]==0.16.6; extra == "doc"
36
36
  Requires-Dist: numpydoc==1.7.0; extra == "doc"
37
- Requires-Dist: sphinx==7.4.0; extra == "doc"
38
- Requires-Dist: sphinx-autodoc-typehints==2.2.2; extra == "doc"
37
+ Requires-Dist: sphinx==7.4.7; extra == "doc"
38
+ Requires-Dist: sphinx-autodoc-typehints==2.2.3; extra == "doc"
39
39
  Requires-Dist: sphinx-copybutton==0.5.1; extra == "doc"
40
40
  Provides-Extra: tests
41
- Requires-Dist: pytest==8.2.2; extra == "tests"
41
+ Requires-Dist: pytest==8.3.2; extra == "tests"
42
42
  Requires-Dist: pytest-cov==5.0.0; extra == "tests"
43
43
 
44
44
  Ansys pre-commit hooks
@@ -80,7 +80,7 @@ Currently, these hooks are available:
80
80
  `REUSE <https://reuse.software/>`_ . To use this hook, you must
81
81
  have ``REUSE`` implemented in your repository.
82
82
  * ``tech-review``: Do a technical review of your repository according to
83
- `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_`
83
+ `Ansys repository requirements <https://dev.docs.pyansys.com/packaging/structure.html>`_
84
84
 
85
85
  ``add-license-headers`` setup
86
86
  -----------------------------
@@ -127,7 +127,7 @@ Set custom arguments
127
127
  .. code:: yaml
128
128
 
129
129
  - repo: https://github.com/ansys/pre-commit-hooks
130
- rev: v0.4.1
130
+ rev: v0.4.2
131
131
  hooks:
132
132
  - id: add-license-headers
133
133
  args: ["--custom_copyright", "custom copyright phrase", "--custom_template", "template_name", "--custom_license", "license_name", "--ignore_license_check", "--start_year", "2023"]
@@ -172,7 +172,7 @@ the hook should run on, add the necessary regex to the ``files`` line in your
172
172
  .. code:: yaml
173
173
 
174
174
  - repo: https://github.com/ansys/pre-commit-hooks
175
- rev: v0.4.1
175
+ rev: v0.4.2
176
176
  hooks:
177
177
  - id: add-license-headers
178
178
  files: '(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'
@@ -185,7 +185,7 @@ In .pre-commit-config.yaml:
185
185
  .. code:: yaml
186
186
 
187
187
  - repo: https://github.com/ansys/pre-commit-hooks
188
- rev: v0.4.1
188
+ rev: v0.4.2
189
189
  hooks:
190
190
  - id: add-license-headers
191
191
  exclude: |
@@ -238,7 +238,7 @@ Technical review hook in ``ansys/pre-commit-hooks``' .pre-commit-config.yaml fil
238
238
  .. code:: yaml
239
239
 
240
240
  - repo: https://github.com/ansys/pre-commit-hooks
241
- rev: v0.4.1
241
+ rev: v0.4.2
242
242
  hooks:
243
243
  - id: tech-review
244
244
  args:
@@ -250,7 +250,7 @@ Technical review hook in ``PyMechanical``'s .pre-commit-config.yaml file:
250
250
  .. code:: yaml
251
251
 
252
252
  - repo: https://github.com/ansys/pre-commit-hooks
253
- rev: v0.4.1
253
+ rev: v0.4.2
254
254
  hooks:
255
255
  - id: tech-review
256
256
  args:
@@ -1,7 +1,7 @@
1
1
  GitPython==3.1.43
2
- importlib-metadata==8.0.0
2
+ importlib-metadata==8.2.0
3
3
  Jinja2==3.1.4
4
- reuse==3.0.2
4
+ reuse==4.0.3
5
5
  requests==2.32.3
6
6
  semver==3.0.2
7
7
  toml==0.10.2
@@ -9,10 +9,10 @@ toml==0.10.2
9
9
  [doc]
10
10
  ansys-sphinx-theme[autoapi]==0.16.6
11
11
  numpydoc==1.7.0
12
- sphinx==7.4.0
13
- sphinx-autodoc-typehints==2.2.2
12
+ sphinx==7.4.7
13
+ sphinx-autodoc-typehints==2.2.3
14
14
  sphinx-copybutton==0.5.1
15
15
 
16
16
  [tests]
17
- pytest==8.2.2
17
+ pytest==8.3.2
18
18
  pytest-cov==5.0.0
@@ -184,8 +184,7 @@ def test_start_year_same_as_current(tmp_path: pytest.TempPathFactory):
184
184
  count = 0
185
185
  for line in file:
186
186
  count += 1
187
- # Assert the copyright line's time range is
188
- # from 2023 to the current year
187
+ # Assert the copyright line's time range is from 2023 to the current year
189
188
  if count == 1:
190
189
  assert f"Copyright (C) {dt.today().year} ANSYS, Inc." in line
191
190
  if count > 1: