8000 [DRAFT] gh-113299: Split clinic.py into sub-files by vstinner · Pull Request #113300 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[DRAFT] gh-113299: Split clinic.py into sub-files #113300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Ju 8000 mp to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-113299: Split clinic.py into sub-files
* Create Tools/clinic/clinic/ package
* Add Tools/clinic/clinic/__init__.py: export names, most of them are
  used by tests.
* Use vars(module) instead of globals() to get symbols.
* Move header (author, license) to clinic/__init__.py.
* Add run_clinic.py script in Tools/clinic/. Update "make clinic"
  and "make clinic-tests" in Makefile.pre.in to use run_clinic.py.
  • Loading branch information
vstinner committed Dec 20, 2023
commit c2b47ceb78eef5cd7b93493bb3e4186f2f602297
4 changes: 2 additions & 2 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def converter_init(self):
@contextlib.contextmanager
def _clinic_version(new_version):
"""Helper for test_version_*() tests"""
_saved = clinic.version
clinic.version = new_version
_saved = clinic.parser.version
clinic.parser.version = new_version
try:
yield
finally:
Expand Down
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,11 @@ coverage-report: regen-token regen-frozen
# Run "Argument Clinic" over all source files
.PHONY: clinic
clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --exclude Lib/test/clinic.test.c --srcdir $(srcdir)
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/run_clinic.py --make --exclude Lib/test/clinic.test.c --srcdir $(srcdir)

.PHONY: clinic-tests
clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $(srcdir)/Lib/test/clinic.test.c
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/run_clinic.py -f $(srcdir)/Lib/test/clinic.test.c

# Build the interpreter
$(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS)
Expand Down
Loading
0