Skip to content

Commit

Permalink
Emit a user warning when comment-style declarations are used.
Browse files Browse the repository at this point in the history
Closes #97
  • Loading branch information
jaraco committed Feb 8, 2024
1 parent 084a418 commit f2db188
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions newsfragments/97.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Comment-style declarations are now deprecated in favor of Python or TOML style.
5 changes: 5 additions & 0 deletions pip_run/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import pathlib
import re
import warnings

import jaraco.text
import packaging.requirements
Expand Down Expand Up @@ -131,6 +132,10 @@ def read_comments(self):

try:
lines = match.group(1).splitlines()
warnings.warn(
"Comment-style script declarations are deprecated. "
"Please use Python style or PEP 723 TOML style."
)
except AttributeError:
lines = []

Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ filterwarnings=

# known internal deprecations
ignore:separate_dash is deprecated
ignore:Comment-style script declarations are deprecated

0 comments on commit f2db188

Please sign in to comment.