about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2020-05-13 23:37:21 +0200
committerGitHub <noreply@github.com>2020-05-13 23:37:21 +0200
commit7e167b638327620a870b423ac44fa834bf88592a (patch)
tree04ba1086967e9477ef743abfcc9a41f66205f903
parent081e73152a9391211770fab56676d7d974413ae6 (diff)
parentb89a2f21365e4b7f9eb010c0b99b85c70251a6cf (diff)
downloadranger-7e167b638327620a870b423ac44fa834bf88592a.tar.gz
Merge pull request #1958 from Vifon/setuptools
Fully migrate from distutils to setuptools
-rw-r--r--doc/howto-publish-a-release.md2
-rwxr-xr-xsetup.py16
2 files changed, 5 insertions, 13 deletions
diff --git a/doc/howto-publish-a-release.md b/doc/howto-publish-a-release.md
index 6bd70047..c62a1908 100644
--- a/doc/howto-publish-a-release.md
+++ b/doc/howto-publish-a-release.md
@@ -62,7 +62,7 @@ Update the website
 Make a PyPI release
 -------------------
 * [ ] `git clean --force -d -x`
-* [ ] `SETUPTOOLS_USE=1 python setup.py sdist`
+* [ ] `python setup.py sdist`
 * [ ] `gpg --local-user 0x00000000 --detach-sign --armor dist/*`
 * [ ] `twine upload dist/*`
 
diff --git a/setup.py b/setup.py
index edf48c4a..493deadd 100755
--- a/setup.py
+++ b/setup.py
@@ -4,11 +4,13 @@
 
 from __future__ import (absolute_import, division, print_function)
 
-from distutils import log  # pylint: disable=import-error,no-name-in-module
 from hashlib import sha512
 import os
 import shutil
 
+from setuptools import setup
+from setuptools.command.install_lib import install_lib
+
 import ranger
 
 
@@ -16,16 +18,6 @@ SCRIPTS_PATH = 'build_scripts'
 EXECUTABLES_PATHS = ['/ranger/data/scope.sh']
 
 
-# pylint: disable=import-error,no-name-in-module,ungrouped-imports
-if os.environ.get('SETUPTOOLS_USE'):
-    from setuptools import setup
-    from setuptools.command.install_lib import install_lib
-else:
-    from distutils.core import setup
-    from distutils.command.install_lib import install_lib
-# pylint: enable=import-error,no-name-in-module,ungrouped-imports
-
-
 def findall(directory):
     return [os.path.join(directory, f) for f in os.listdir(directory)
             if os.path.isfile(os.path.join(directory, f))]
@@ -59,7 +51,7 @@ class InstallLib(install_lib):
             for exe_path in EXECUTABLES_PATHS:
                 if path.endswith(exe_path):
                     mode = ((os.stat(path).st_mode) | 0o555) & 0o7777
-                    log.info('changing mode of %s to %o', path, mode)
+                    print('changing mode of %s to %o' % (path, mode))
                     os.chmod(path, mode)