Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Replace now deprecated distutils with setuptools #199

Merged
merged 1 commit into from
Dec 24, 2021
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
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
import os
import io

try:
from setuptools import setup
from setuptools.command.install import install
except ImportError:
from distutils.core import setup
from distutils.core.command.install import install
from setuptools import setup
from setuptools.command.install import install

# Code to add custom build commands comes from here:
import setupbase
Expand Down
21 changes: 11 additions & 10 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

from urllib.request import urlopen

import distutils.cmd
import distutils.log
import setuptools

LOG_INFO = 2

HERE = os.path.abspath(os.path.dirname(__file__))
ICONIC_FONT_PY_PATH = os.path.join(HERE, 'qtawesome', 'iconic_font.py')
Expand Down Expand Up @@ -74,7 +75,7 @@ def rename_font(font_path, font_name):
f"ERROR: unable to write new name to OpenType tables for: {font_path}")


class UpdateFA5Command(distutils.cmd.Command):
class UpdateFA5Command(setuptools.Command):
"""A custom command to make updating FontAwesome 5.x easy!"""
description = 'Try to update the FontAwesome 5.x data in the project.'
user_options = [
Expand Down Expand Up @@ -102,8 +103,8 @@ def finalize_options(self):
'Local zipfile does not exist: %s' % self.zip_path)

def __print(self, msg):
"""Shortcut for printing with the distutils logger."""
self.announce(msg, level=distutils.log.INFO)
"""Shortcut for printing with the setuptools logger."""
self.announce(msg, level=LOG_INFO)

def __get_charmap_path(self, style):
"""Get the project FA charmap path for a given style."""
Expand Down Expand Up @@ -232,7 +233,7 @@ def run(self):
'qtawesome/docs/source/usage.rst to reflect the changes.')


class UpdateCodiconCommand(distutils.cmd.Command):
class UpdateCodiconCommand(setuptools.Command):
"""A custom command to make updating Microsoft's Codicons easy!"""
description = 'Try to update the Codicon font data in the project.'
user_options = []
Expand All @@ -245,14 +246,14 @@ class UpdateCodiconCommand(distutils.cmd.Command):
DOWNLOAD_URL_JSON = 'https://raw.githubusercontent.com/microsoft/vscode-codicons/master/package.json'

def initialize_options(self):
"""Required by distutils."""
"""Required by setuptools."""

def finalize_options(self):
"""Required by distutils."""
"""Required by setuptools."""

def __print(self, msg):
"""Shortcut for printing with the distutils logger."""
self.announce(msg, level=distutils.log.INFO)
"""Shortcut for printing with the setuptools logger."""
self.announce(msg, level=LOG_INFO)

def run(self):
"""Run command."""
Expand Down