Switch to setuptools and use pytest
This commit is contained in:
parent
e4cd22b7bd
commit
8ae32539fe
|
@ -33,9 +33,10 @@ jobs:
|
|||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .
|
||||
python setup.py develop
|
||||
|
||||
- name: Compile all scripts
|
||||
run: python -m compileall -f terminatorlib/ tests/ remotinator terminator
|
||||
|
||||
- name: Run legacy tests
|
||||
run: bash run_tests
|
||||
- name: Run tests
|
||||
run: python setup.py test
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
/.bzr
|
||||
|
||||
## Python
|
||||
/.eggs
|
||||
*.pyc
|
||||
*.egg-info
|
||||
/build
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include AUTHORS CHANGELOG* COPYING INSTALL README* remotinator setup.py terminator run_tests
|
||||
include AUTHORS CHANGELOG* COPYING INSTALL README* remotinator setup.py terminator
|
||||
recursive-include data *
|
||||
recursive-include doc *
|
||||
recursive-include po *
|
||||
|
|
14
run_tests
14
run_tests
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
for t in tests/test*; do
|
||||
echo $t
|
||||
file_type=$(file -b $t)
|
||||
case ${file_type} in
|
||||
*[Pp]ython*) python ${t} || exit 1 ;;
|
||||
*Bourne*) bash ${t} || exit 1 ;;
|
||||
*bash*) bash ${t} || exit 1 ;;
|
||||
*perl*) perl ${t} || exit 1 ;;
|
||||
*) echo "Unknown" ;;
|
||||
esac
|
||||
echo
|
||||
done
|
33
setup.py
33
setup.py
|
@ -1,13 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from distutils.core import setup
|
||||
from distutils.dist import Distribution
|
||||
from distutils.cmd import Command
|
||||
from setuptools import setup, Distribution, Command
|
||||
|
||||
from distutils.command.install_data import install_data
|
||||
from distutils.command.build import build
|
||||
from distutils.dep_util import newer
|
||||
from distutils.log import warn, info, error
|
||||
from distutils.errors import DistutilsFileError
|
||||
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
@ -20,6 +20,7 @@ PO_DIR = 'po'
|
|||
MO_DIR = os.path.join('build', 'mo')
|
||||
CSS_DIR = os.path.join('terminatorlib', 'themes')
|
||||
|
||||
|
||||
class TerminatorDist(Distribution):
|
||||
global_options = Distribution.global_options + [
|
||||
("build-documentation", None, "Build the documentation"),
|
||||
|
@ -177,21 +178,6 @@ class InstallData(install_data):
|
|||
return data_files
|
||||
|
||||
|
||||
class Test(Command):
|
||||
user_options = []
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
import subprocess
|
||||
import sys
|
||||
errno = subprocess.call(['bash', 'run_tests'])
|
||||
raise SystemExit(errno)
|
||||
|
||||
|
||||
if platform.system() in ['FreeBSD', 'OpenBSD']:
|
||||
man_dir = 'man'
|
||||
else:
|
||||
|
@ -232,6 +218,9 @@ setup(name=APP_NAME,
|
|||
'terminatorlib',
|
||||
'terminatorlib.plugins',
|
||||
],
|
||||
setup_requires=[
|
||||
'pytest-runner',
|
||||
],
|
||||
install_requires=[
|
||||
'pycairo',
|
||||
'configobj',
|
||||
|
@ -239,8 +228,10 @@ setup(name=APP_NAME,
|
|||
'pygobject',
|
||||
'psutil',
|
||||
],
|
||||
tests_require=[
|
||||
'pytest',
|
||||
],
|
||||
package_data={'terminatorlib': ['preferences.glade', 'layoutlauncher.glade']},
|
||||
cmdclass={'build': BuildData, 'install_data': InstallData, 'uninstall': Uninstall, 'test':Test},
|
||||
distclass=TerminatorDist
|
||||
)
|
||||
cmdclass={'build': BuildData, 'install_data': InstallData, 'uninstall': Uninstall},
|
||||
distclass=TerminatorDist)
|
||||
|
||||
|
|
Loading…
Reference in New Issue