Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions src/cmdclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def write_to_version_file(): pass # --STRIP DURING BUILD


def get_cmdclass(cmdclass=None):
"""Get the custom setuptools/distutils subclasses used by Versioneer.
"""Get the custom setuptools subclasses used by Versioneer.

If the package uses a different cmdclass (e.g. one from numpy), it
should be provide as an argument.
Expand All @@ -30,11 +30,8 @@ def get_cmdclass(cmdclass=None):

cmds = {} if cmdclass is None else cmdclass.copy()

# we add "version" to both distutils and setuptools
try:
from setuptools import Command
except ImportError:
from distutils.core import Command
# we add "version" to setuptools
from setuptools import Command

class cmd_version(Command):
description = "report generated version string"
Expand All @@ -57,7 +54,7 @@ def run(self):
print(" error: %s" % vers["error"])
cmds["version"] = cmd_version

# we override "build_py" in both distutils and setuptools
# we override "build_py" in setuptools
#
# most invocation pathways end up running build_py:
# distutils/build -> build_py
Expand All @@ -75,10 +72,8 @@ def run(self):
# we override different "build_py" commands for both environments
if 'build_py' in cmds:
_build_py = cmds['build_py']
elif "setuptools" in sys.modules:
from setuptools.command.build_py import build_py as _build_py
else:
from distutils.command.build_py import build_py as _build_py
from setuptools.command.build_py import build_py as _build_py

class cmd_build_py(_build_py):
def run(self):
Expand All @@ -97,10 +92,8 @@ def run(self):

if 'build_ext' in cmds:
_build_ext = cmds['build_ext']
elif "setuptools" in sys.modules:
from setuptools.command.build_ext import build_ext as _build_ext
else:
from distutils.command.build_ext import build_ext as _build_ext
from setuptools.command.build_ext import build_ext as _build_ext

class cmd_build_ext(_build_ext):
def run(self):
Expand Down Expand Up @@ -182,10 +175,8 @@ def run(self):
# we override different "sdist" commands for both environments
if 'sdist' in cmds:
_sdist = cmds['sdist']
elif "setuptools" in sys.modules:
from setuptools.command.sdist import sdist as _sdist
else:
from distutils.command.sdist import sdist as _sdist
from setuptools.command.sdist import sdist as _sdist

class cmd_sdist(_sdist):
def run(self):
Expand Down
4 changes: 2 additions & 2 deletions src/setupfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def do_setup():
except OSError:
pass
# That doesn't cover everything MANIFEST.in can do
# (http://docs.python.org/2/distutils/sourcedist.html#commands), so
# it might give some false negatives. Appending redundant 'include'
# (https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands),
# so it might give some false negatives. Appending redundant 'include'
# lines is safe, though.
if "versioneer.py" not in simple_includes:
print(" appending 'versioneer.py' to MANIFEST.in")
Expand Down
Empty file.
1 change: 0 additions & 1 deletion test/demoapp2-distutils-subproject/subproject/README

This file was deleted.

9 changes: 0 additions & 9 deletions test/demoapp2-distutils-subproject/subproject/bin/rundemo

This file was deleted.

7 changes: 0 additions & 7 deletions test/demoapp2-distutils-subproject/subproject/setup.cfg

This file was deleted.

16 changes: 0 additions & 16 deletions test/demoapp2-distutils-subproject/subproject/setup.py

This file was deleted.

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion test/demoapp2-distutils/README

This file was deleted.

9 changes: 0 additions & 9 deletions test/demoapp2-distutils/bin/rundemo

This file was deleted.

7 changes: 0 additions & 7 deletions test/demoapp2-distutils/setup.cfg

This file was deleted.

16 changes: 0 additions & 16 deletions test/demoapp2-distutils/setup.py

This file was deleted.

1 change: 0 additions & 1 deletion test/demoapp2-distutils/src/demo/__init__.py

This file was deleted.

Loading