# Buggy code
def declare_var(
    self, name, type, pos, cname=None, visibility="private", api=0, in_pxd=0, is_cdef=0
):
    name = self.mangle_special_name(name)
    if is_cdef:
        # Add an entry for an attribute.
        if self.defined:
            error(
                pos,
                "C attributes cannot be added in implementation part of"
                " extension type defined in a pxd",
            )
        if not self.is_closure_class_scope and get_special_method_signature(name):
            error(pos, "The name '%s' is reserved for a special method." % name)
        if not cname:
            cname = name
            if visibility == "private":
                cname = c_safe_identifier(cname)
            cname = punycodify_name(cname, Naming.unicode_structmember_prefix)
        if type.is_cpp_class and visibility != "extern":
            type.check_nullary_constructor(pos)
            self.use_utility_code(Code.UtilityCode("#include <new>"))
        entry = self.declare(name, cname, type, pos, visibility)
        entry.is_variable = 1
        self.var_entries.append(entry)
        if type.is_memoryviewslice:
            self.has_memoryview_attrs = True
        elif type.is_cpp_class:
            self.has_cpp_class_attrs = True
        elif type.is_pyobject and (
            self.is_closure_class_scope or name != "__weakref__"
        ):
            self.has_pyobject_attrs = True
            if not type.is_builtin_type or not type.scope or type.scope.needs_gc():
                self.has_cyclic_pyobject_attrs = True
        if visibility not in ("private", "public", "readonly"):
            error(pos, "Attribute of extension type cannot be declared %s" % visibility)
        if visibility in ("public", "readonly"):
            # If the field is an external typedef, we cannot be sure about the type,
            # so do conversion ourself rather than rely on the CPython mechanism (through
            # a property; made in AnalyseDeclarationsTransform).
            entry.needs_property = True
            if not self.is_closure_class_scope and name == "__weakref__":
                error(pos, "Special attribute __weakref__ cannot be exposed to Python")
            if not (type.is_pyobject or type.can_coerce_to_pyobject(self)):
                # we're not testing for coercion *from* Python here - that would fail later
                error(
                    pos,
                    "C attribute of type '%s' cannot be accessed from Python" % type,
                )
        else:
            entry.needs_property = False
        return entry
    else:
        if type is unspecified_type:
            type = py_object_type
        # Add an entry for a class attribute.
        entry = Scope.declare_var(
            self,
            name,
            type,
            pos,
            cname=cname,
            visibility=visibility,
            api=api,
            in_pxd=in_pxd,
            is_cdef=is_cdef,
        )
        entry.is_member = 1
        entry.is_pyglobal = (
            1  # xxx: is_pyglobal changes behaviour in so many places that
        )
        # I keep it in for now. is_member should be enough
        # later on
        self.namespace_cname = "(PyObject *)%s" % self.parent_type.typeptr_cname

        return entry


# Traceback (Cython.Compiler.Errors.CompileError)
(bleeding) ✔  ~/source/other_source/pandas [master {pandas/master}|✚ 2]
jupiter@15:19  ➤  pip install -v .
Non-user install because user site-packages disabled
Created temporary directory: /tmp/pip-ephem-wheel-cache-zcmyaxf3
Created temporary directory: /tmp/pip-req-tracker-dfm6xgbp
Initialized build tracking at /tmp/pip-req-tracker-dfm6xgbp
Created build tracker: /tmp/pip-req-tracker-dfm6xgbp
Entered build tracker: /tmp/pip-req-tracker-dfm6xgbp
Created temporary directory: /tmp/pip-install-_tjupc3v
Processing /home/tcaswell/source/other_source/pandas
Created temporary directory: /tmp/pip-req-build-eh2hlgu3
Added file:///home/tcaswell/source/other_source/pandas to build tracker '/tmp/pip-req-tracker-dfm6xgbp'
Running setup.py (path:/tmp/pip-req-build-eh2hlgu3/setup.py) egg_info for package from file:///home/tcaswell/source/other_source/pandas
Running command python setup.py egg_info
warning: pandas/_libs/groupby.pyx:1101:26: Unreachable code

Error compiling Cython file:
------------------------------------------------------------
...
cdef Py_ssize_t itemsize
cdef bint dtype_signed
cdef char kind
itemsize = -1
cdef bint ___pyx_int64_t_is_signed
___pyx_int64_t_is_signed = not (<___pyx_int64_t> -1 > 0)
^
------------------------------------------------------------

(tree fragment):19:37: '___pyx_int64_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
cdef char kind
itemsize = -1
cdef bint ___pyx_int64_t_is_signed
___pyx_int64_t_is_signed = not (<___pyx_int64_t> -1 > 0)
cdef bint ___pyx_uint64_t_is_signed
___pyx_uint64_t_is_signed = not (<___pyx_uint64_t> -1 > 0)
^
------------------------------------------------------------

(tree fragment):21:38: '___pyx_uint64_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_int64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_int64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
ctypedef struct __Pyx_memviewslice:
void *memview

void __PYX_XDEC_MEMVIEW(__Pyx_memviewslice *, int have_gil)
bint __pyx_memoryview_check(object)
ctypedef long long ___pyx_int64_t "__pyx_t_5numpy_int64_t"
^
------------------------------------------------------------

__pyxutil:15:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_uint64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_uint64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...

void __PYX_XDEC_MEMVIEW(__Pyx_memviewslice *, int have_gil)
bint __pyx_memoryview_check(object)
ctypedef long long ___pyx_int64_t "__pyx_t_5numpy_int64_t"
ctypedef double ___pyx_float64_t "__pyx_t_5numpy_float64_t"
ctypedef unsigned long long ___pyx_uint64_t "__pyx_t_5numpy_uint64_t"
^
------------------------------------------------------------

__pyxutil:17:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_float64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_float64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
void *memview

void __PYX_XDEC_MEMVIEW(__Pyx_memviewslice *, int have_gil)
bint __pyx_memoryview_check(object)
ctypedef long long ___pyx_int64_t "__pyx_t_5numpy_int64_t"
ctypedef double ___pyx_float64_t "__pyx_t_5numpy_float64_t"
^
------------------------------------------------------------

__pyxutil:16:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_int64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_int64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_float64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_float64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: undeclared name not builtin: ___pyx_uint64_t

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: '___pyx_uint64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
cdef Py_ssize_t itemsize
cdef bint dtype_signed
cdef char kind
itemsize = -1
cdef bint ___pyx_int64_t_is_signed
___pyx_int64_t_is_signed = not (<___pyx_int64_t> -1 > 0)
^
------------------------------------------------------------

(tree fragment):19:37: '___pyx_int64_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
cdef char kind
itemsize = -1
cdef bint ___pyx_int64_t_is_signed
___pyx_int64_t_is_signed = not (<___pyx_int64_t> -1 > 0)
cdef bint ___pyx_uint64_t_is_signed
___pyx_uint64_t_is_signed = not (<___pyx_uint64_t> -1 > 0)
^
------------------------------------------------------------

(tree fragment):21:38: '___pyx_uint64_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_int64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_int64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_uint64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_uint64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_float64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_float64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
values = [self.right, self.left]

sort_order = np.lexsort(values)
return is_monotonic(sort_order, False)[0]

def get_indexer(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:122:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_int64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_int64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_float64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_float64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: undeclared name not builtin: ___pyx_uint64_t

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: '___pyx_uint64_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError(
'indexer does not intersect a unique set of intervals')
old_len = result.data.n
return result.to_array().astype('intp')

def get_indexer_non_unique(self, scalar_t[:] target):
^
------------------------------------------------------------

pandas/_libs/intervaltree.pxi:150:4: Previous declaration is here
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-eh2hlgu3/setup.py", line 794, in <module>
setup_package()
File "/tmp/pip-req-build-eh2hlgu3/setup.py", line 764, in setup_package
ext_modules=maybe_cythonize(extensions, compiler_directives=directives),
File "/tmp/pip-req-build-eh2hlgu3/setup.py", line 537, in maybe_cythonize
return cythonize(extensions, *args, **kwargs)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1105, in cythonize
cythonize_one(*args)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1263, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pandas/_libs/interval.pyx
Compiling pandas/_libs/algos.pyx because it changed.
Compiling pandas/_libs/groupby.pyx because it changed.
Compiling pandas/_libs/hashing.pyx because it changed.
Compiling pandas/_libs/hashtable.pyx because it changed.
Compiling pandas/_libs/index.pyx because it changed.
Compiling pandas/_libs/indexing.pyx because it changed.
Compiling pandas/_libs/internals.pyx because it changed.
Compiling pandas/_libs/interval.pyx because it changed.
Compiling pandas/_libs/join.pyx because it changed.
Compiling pandas/_libs/lib.pyx because it changed.
Compiling pandas/_libs/missing.pyx because it changed.
Compiling pandas/_libs/parsers.pyx because it changed.
Compiling pandas/_libs/reduction.pyx because it changed.
Compiling pandas/_libs/ops.pyx because it changed.
Compiling pandas/_libs/ops_dispatch.pyx because it changed.
Compiling pandas/_libs/properties.pyx because it changed.
Compiling pandas/_libs/reshape.pyx because it changed.
Compiling pandas/_libs/sparse.pyx because it changed.
Compiling pandas/_libs/tslib.pyx because it changed.
Compiling pandas/_libs/tslibs/c_timestamp.pyx because it changed.
Compiling pandas/_libs/tslibs/ccalendar.pyx because it changed.
Compiling pandas/_libs/tslibs/conversion.pyx because it changed.
Compiling pandas/_libs/tslibs/fields.pyx because it changed.
Compiling pandas/_libs/tslibs/frequencies.pyx because it changed.
Compiling pandas/_libs/tslibs/nattype.pyx because it changed.
Compiling pandas/_libs/tslibs/np_datetime.pyx because it changed.
Compiling pandas/_libs/tslibs/offsets.pyx because it changed.
Compiling pandas/_libs/tslibs/parsing.pyx because it changed.
Compiling pandas/_libs/tslibs/period.pyx because it changed.
Compiling pandas/_libs/tslibs/resolution.pyx because it changed.
Compiling pandas/_libs/tslibs/strptime.pyx because it changed.
Compiling pandas/_libs/tslibs/timedeltas.pyx because it changed.
Compiling pandas/_libs/tslibs/timestamps.pyx because it changed.
Compiling pandas/_libs/tslibs/timezones.pyx because it changed.
Compiling pandas/_libs/tslibs/tzconversion.pyx because it changed.
Compiling pandas/_libs/testing.pyx because it changed.
Compiling pandas/_libs/window/aggregations.pyx because it changed.
Compiling pandas/_libs/window/indexers.pyx because it changed.
Compiling pandas/_libs/writers.pyx because it changed.
Compiling pandas/io/sas/sas.pyx because it changed.
[ 1/40] Cythonizing pandas/_libs/algos.pyx
[ 2/40] Cythonizing pandas/_libs/groupby.pyx
[ 3/40] Cythonizing pandas/_libs/hashing.pyx
[ 4/40] Cythonizing pandas/_libs/hashtable.pyx
[ 5/40] Cythonizing pandas/_libs/index.pyx
[ 6/40] Cythonizing pandas/_libs/indexing.pyx
[ 7/40] Cythonizing pandas/_libs/internals.pyx
[ 8/40] Cythonizing pandas/_libs/interval.pyx
Cleaning up...
Removing source in /tmp/pip-req-build-eh2hlgu3
Removed file:///home/tcaswell/source/other_source/pandas from build tracker '/tmp/pip-req-tracker-dfm6xgbp'
Removed build tracker: '/tmp/pip-req-tracker-dfm6xgbp'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Exception information:
Traceback (most recent call last):
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 331, in run
resolver.resolve(requirement_set)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata
self.req.prepare_metadata()
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 564, in prepare_metadata
self.metadata_directory = self._generate_metadata()
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 538, in _generate_metadata
return generate_metadata_legacy(
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 115, in generate_metadata
call_subprocess(
File "/home/tcaswell/.virtualenvs/bleeding/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

# Fixed code
def declare_var(
    self, name, type, pos, cname=None, visibility="private", api=0, in_pxd=0, is_cdef=0
):
    name = self.mangle_class_private_name(name)
    if is_cdef:
        # Add an entry for an attribute.
        if self.defined:
            error(
                pos,
                "C attributes cannot be added in implementation part of"
                " extension type defined in a pxd",
            )
        if not self.is_closure_class_scope and get_special_method_signature(name):
            error(pos, "The name '%s' is reserved for a special method." % name)
        if not cname:
            cname = name
            if visibility == "private":
                cname = c_safe_identifier(cname)
            cname = punycodify_name(cname, Naming.unicode_structmember_prefix)
        if type.is_cpp_class and visibility != "extern":
            type.check_nullary_constructor(pos)
            self.use_utility_code(Code.UtilityCode("#include <new>"))
        entry = self.declare(name, cname, type, pos, visibility)
        entry.is_variable = 1
        self.var_entries.append(entry)
        if type.is_memoryviewslice:
            self.has_memoryview_attrs = True
        elif type.is_cpp_class:
            self.has_cpp_class_attrs = True
        elif type.is_pyobject and (
            self.is_closure_class_scope or name != "__weakref__"
        ):
            self.has_pyobject_attrs = True
            if not type.is_builtin_type or not type.scope or type.scope.needs_gc():
                self.has_cyclic_pyobject_attrs = True
        if visibility not in ("private", "public", "readonly"):
            error(pos, "Attribute of extension type cannot be declared %s" % visibility)
        if visibility in ("public", "readonly"):
            # If the field is an external typedef, we cannot be sure about the type,
            # so do conversion ourself rather than rely on the CPython mechanism (through
            # a property; made in AnalyseDeclarationsTransform).
            entry.needs_property = True
            if not self.is_closure_class_scope and name == "__weakref__":
                error(pos, "Special attribute __weakref__ cannot be exposed to Python")
            if not (type.is_pyobject or type.can_coerce_to_pyobject(self)):
                # we're not testing for coercion *from* Python here - that would fail later
                error(
                    pos,
                    "C attribute of type '%s' cannot be accessed from Python" % type,
                )
        else:
            entry.needs_property = False
        return entry
    else:
        if type is unspecified_type:
            type = py_object_type
        # Add an entry for a class attribute.
        entry = Scope.declare_var(
            self,
            name,
            type,
            pos,
            cname=cname,
            visibility=visibility,
            api=api,
            in_pxd=in_pxd,
            is_cdef=is_cdef,
        )
        entry.is_member = 1
        entry.is_pyglobal = (
            1  # xxx: is_pyglobal changes behaviour in so many places that
        )
        # I keep it in for now. is_member should be enough
        # later on
        self.namespace_cname = "(PyObject *)%s" % self.parent_type.typeptr_cname

        return entry