astropy / extension-helpers

Helpers to assist with building Python packages with compiled C/Cython extensions
https://extension-helpers.readthedocs.io
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Cannot find DistutilsExtensionArgs #10

Closed pllim closed 4 years ago

pllim commented 4 years ago

This is in astropy-helpers and used to work here before everything was moved to top-level imports. Where did it go?

https://github.com/astropy/astropy-helpers/blob/fc91b5f089a897d134d629b85e6ba57b27ed2b39/astropy_helpers/setup_helpers.py#L580-L597

class DistutilsExtensionArgs(collections.defaultdict):
    """
    A special dictionary whose default values are the empty list.
    This is useful for building up a set of arguments for
    `distutils.Extension` without worrying whether the entry is
    already present.
    """
    def __init__(self, *args, **kwargs):
        def default_factory():
            return []

        super(DistutilsExtensionArgs, self).__init__(
            default_factory, *args, **kwargs)

    def update(self, other):
        for key, val in other.items():
            self[key].extend(val)

xref spacetelescope/synphot_refactor#229

pllim commented 4 years ago

Oh no, it was removed in #6 . :scream:

pllim commented 4 years ago

Ok, I see... astropy/astropy#9726

-    cfg = setup_helpers.DistutilsExtensionArgs()
+    cfg = defaultdict(list)