Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1154 from josemauro/issue-1145
Browse files Browse the repository at this point in the history
Remove the use of distutils due to incompatibility with setuptools 50.0
  • Loading branch information
hdiogenes committed Oct 16, 2020
2 parents 1bc85d0 + da559a1 commit 8cd6c38
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -3,7 +3,9 @@ build: clean prepare
ls -l dist/

clean:
rm -rf build/ dist/ *.egg-info/ kytos/web-ui-*
rm -vrf build/ dist/ *.egg-info/ kytos/web-ui-*
find . -name __pycache__ -type d | xargs rm -rf
test -d docs && make -C docs/ clean

prepare:
pip3 install --upgrade pip setuptools wheel twine
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Expand Up @@ -8,7 +8,6 @@
import sys
from abc import abstractmethod
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
from distutils.command.clean import clean # pylint: disable=E0401,E0611
from pathlib import Path
from subprocess import CalledProcessError, call, check_call

Expand Down Expand Up @@ -99,17 +98,14 @@ def finalize_options(self):
sys.exit(-1)


class Cleaner(clean):
class Cleaner(SimpleCommand):
"""Custom clean command to tidy up the project root."""

description = 'clean build, dist, pyc and egg from package and docs'

def run(self):
"""Clean build, dist, pyc and egg from package and docs."""
super().run()
call('rm -vrf ./build ./dist ./*.egg-info', shell=True)
call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
call('test -d docs && make -C docs/ clean', shell=True)
call('make clean', shell=True)


class Test(TestCommand):
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Expand Up @@ -4,11 +4,15 @@
[testenv]
whitelist_externals=
rm
make

commands=
; Force packaging even if setup.{py,cfg} haven't changed
rm -rf ./kytos.egg-info/
python setup.py ci
# The build of the documentation is running outside the tox env, so it is
# necessary to clear the build after running ci.
make clean -C docs

deps=
-rrequirements/dev.txt

0 comments on commit 8cd6c38

Please sign in to comment.