With removal of distutils in python3.12 from setuptools._distutils.dep_util import newer_group does not seem to work in pegen
Open
Nobody has claimed this yet.
build
topic-parser
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
# Add a code block here, if required
def compile_c_extension(
generated_source_path: str,
build_dir: Optional[str] = None,
verbose: bool = False,
keep_asserts: bool = True,
disable_optimization: bool = False,
library_dir: Optional[str] = None,
) -> pathlib.Path:
"""Compile the generated source for a parser generator into an extension module.
The extension module will be generated in the same directory as the provided path
for the generated source, with the same basename (in addition to extension module
metadata). For example, for the source mydir/parser.c the generated extension
in a darwin system with python 3.8 will be mydir/parser.cpython-38-darwin.so.
If *build_dir* is provided, that path will be used as the temporary build directory
of distutils (this is useful in case you want to use a temporary directory).
If *library_dir* is provided, that path will be used as the directory for a
static library of the common parser sources (this is useful in case you are
creating multiple extensions).
"""
import setuptools.command.build_ext
import setuptools.logging
from setuptools import Distribution, Extension
from setuptools._distutils.ccompiler import new_compiler
from setuptools._distutils.dep_util import newer_group
from setuptools._distutils.sysconfig import customize_compiler
CPython versions tested on:
3.12
3.14
Operating systems tested on:
macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the compile_c_extension entry point shown in the report and inspect the setuptools._distutils.dep_util import of newer_group under Python 3.12 and 3.14. Reproduce the macOS failure in pegen and identify the compatibility issue; done means the parser generator's extension compilation works on the tested Python versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100