Remove remaining tox references

This commit is contained in:
Scot Hacker 2018-02-04 00:40:00 -08:00
parent 0c42de2ffb
commit cd1678da47
3 changed files with 0 additions and 99 deletions

1
.gitignore vendored
View file

@ -2,7 +2,6 @@
/.coverage/
/.eggs/
/.idea/
/.tox/
/build/
/dist/
/docs/build/

View file

@ -1,83 +1,13 @@
#!/usr/bin/env python
from glob import glob
from os import remove
from os.path import abspath, dirname, join
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from shlex import split
from shutil import rmtree
from sys import exit
import todo as package
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import tox
args = self.tox_args
if args:
args = split(self.tox_args)
errno = tox.cmdline(args=args)
exit(errno)
class Clean(TestCommand):
def run(self):
delete_in_root = [
'build',
'dist',
'.eggs',
'*.egg-info',
'.tox',
]
delete_everywhere = [
'__pycache__',
'*.pyc',
]
for candidate in delete_in_root:
rmtree_glob(candidate)
for visible_dir in glob('[A-Za-z0-9]*'):
for candidate in delete_everywhere:
rmtree_glob(join(visible_dir, candidate))
rmtree_glob(join(visible_dir, '*', candidate))
rmtree_glob(join(visible_dir, '*', '*', candidate))
def rmtree_glob(file_glob):
for fobj in glob(file_glob):
try:
rmtree(fobj)
print('%s/ removed ...' % fobj)
except OSError:
try:
remove(fobj)
print('%s removed ...' % fobj)
except OSError:
pass
def read_file(*pathname):
with open(join(dirname(abspath(__file__)), *pathname)) as f:
return f.read()
setup(
name='django-todo',
version=package.__version__,
description=package.__doc__.strip(),
long_description=read_file('README.rst'),
author=package.__author__,
author_email=package.__email__,
url=package.__url__,
@ -98,10 +28,5 @@ setup(
],
include_package_data=True,
zip_safe=False,
tests_require=['tox'],
install_requires=['unidecode', ],
cmdclass={
'clean': Clean,
'test': Tox,
},
)

23
tox.ini
View file

@ -1,23 +0,0 @@
[tox]
envlist =
flake8py{2,3}
[testenv]
# deps = pytest
commands =
# py.test
[testenv:flake8py2]
basepython = python2.7
deps = flake8
commands = flake8 .
[testenv:flake8py3]
basepython = python3.5
deps = flake8
commands = flake8 .
[flake8]
max-line-length = 120
max-complexity = 10
exclude = [build, lib, bin, dist, docs/conf.py, */migrations, .eggs, *.egg-info]