Skip to content

Commit

Permalink
Merge pull request #7216 from Mic92/distutils-removal
Browse files Browse the repository at this point in the history
buildbot_pkg: replace distutils with setuptools
  • Loading branch information
p12tic committed Dec 3, 2023
2 parents b623c79 + 91b32a1 commit ba6ab0c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/buildbot_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Method to add build step taken from here
# https://seasonofcode.com/posts/how-to-add-custom-build-steps-and-commands-to-setuppy.html
import datetime
import logging
import os
import re
import shutil
Expand All @@ -27,10 +28,9 @@

import setuptools.command.build_py
import setuptools.command.egg_info
from setuptools import Command
from setuptools import setup

import distutils.cmd # isort:skip

old_listdir = os.listdir


Expand Down Expand Up @@ -182,7 +182,7 @@ def getVersion(init_file):
# This is why we override both egg_info and build, and the first run build
# the js.

class BuildJsCommand(distutils.cmd.Command):
class BuildJsCommand(Command):
"""A custom command to run JS build."""

description = 'run JS build'
Expand Down Expand Up @@ -228,12 +228,13 @@ def run(self):

for command in commands:
self.announce('Running command: {}'.format(str(" ".join(command))),
level=distutils.log.INFO)
level=logging.INFO)
subprocess.check_call(command, shell=shell)

self.copy_tree(os.path.join(package, 'static'), os.path.join(
"build", "lib", package, "static"))

assert self.distribution.metadata.version is not None, "version is not set"
with open(os.path.join("build", "lib", package, "VERSION"), "w") as f:
f.write(self.distribution.metadata.version)

Expand Down

0 comments on commit ba6ab0c

Please sign in to comment.