The first argument to the Extension constructor is always the name of the extension, including any package names. For example,
Extension("foo", ["src/foo1.c", "src/foo2.c"])
Extension("pkg.foo", ["src/foo1.c", "src/foo2.c"])
If you have a number of extensions all in the same package (or all under the same base package), use the ext_package keyword argument to setup(). For example,
setup(... ext_package = "pkg", extensions = [Extension("foo", ["foo.c"]), Extension("subpkg.bar", ["bar.c"])] )