Skip to content

Commit

Permalink
gh-97669: Create Tools/patchcheck/ directory (#98186)
Browse files Browse the repository at this point in the history
Move patchcheck.py, reindent.py and untabify.py scripts to a new
Tools/patchcheck/ directory.
  • Loading branch information
vstinner committed Oct 12, 2022
1 parent c39a0c3 commit 0895c2a
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/posix-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ steps:
- ${{ if eq(parameters.patchcheck, 'true') }}:
- script: |
git fetch origin
./python Tools/scripts/patchcheck.py --ci true
./python Tools/patchcheck/patchcheck.py --ci true
displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_tools/test_reindent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from test.support.script_helper import assert_python_ok
from test.support import findfile

from test.test_tools import scriptsdir, skip_if_missing
from test.test_tools import toolsdir, skip_if_missing

skip_if_missing()

class ReindentTests(unittest.TestCase):
script = os.path.join(scriptsdir, 'reindent.py')
script = os.path.join(toolsdir, 'patchcheck', 'reindent.py')

def test_noargs(self):
assert_python_ok(self.script)
Expand Down
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ Python/dtoa.o: Python/dtoa.c

# Run reindent on the library
reindent:
./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
./$(BUILDPYTHON) $(srcdir)/Tools/patchcheck/reindent.py -r $(srcdir)/Lib

This comment has been minimized.

Copy link
@GitPyAJ

GitPyAJ Dec 5, 2022

l

# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
Expand Down Expand Up @@ -2546,7 +2546,7 @@ funny:

# Perform some verification checks on any modified files.
patchcheck: all
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/patchcheck/patchcheck.py

check-limited-abi: all
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --all $(srcdir)/Misc/stable_abi.toml
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions Tools/scripts/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ useful while building, extending or managing Python.
combinerefs.py A helper for analyzing PYTHONDUMPREFS output
idle3 Main program to start IDLE
parse_html5_entities.py Utility for parsing HTML5 entity definitions
patchcheck.py Perform common checks and cleanup before committing
pydoc3 Python documentation browser
reindent.py Change .py files to use 4-space indents
run_tests.py Run the test suite with more sensible default options
stable_abi.py Stable ABI checks and file generators.
untabify.py Replace tabs with spaces in argument files

1 comment on commit 0895c2a

@GitPyAJ
Copy link

@GitPyAJ GitPyAJ commented on 0895c2a Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print("Please select the operation.")
print("a. Add")
print("b. Subtract")
print("c. Multiply")
print("d. Divide")

choice = input("Please enter choice (a/ b/ c/ d): ")

num_1 = int(input("Please enter the first number: "))
num_2 = int(input("Please enter the second number: "))

if choice == 'a':
print(num_1, " + ", num_2, " = ", add(num_1, num_2))

elif choice == 'b':
print(num_1, " - ", num_2, " = ", subtract(num_1, num_2))

elif choice == 'c':
print(num1, " * ", num2, " = ", multiply(num1, num2))
elif choice == 'd':
print(num_1, " / ", num_2, " = ", divide(num_1, num_2))
else:
print("This is an invalid input")

Please sign in to comment.