Skip to content

Commit

Permalink
Switch to setuptools and use pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyfrosch committed May 9, 2020
1 parent e4cd22b commit 8ae3253
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 38 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/.bzr

## Python
/.eggs
*.pyc
*.egg-info
/build
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down
14 changes: 0 additions & 14 deletions run_tests

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[aliases]
test=pytest
33 changes: 12 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,6 +20,7 @@
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"),
Expand Down Expand Up @@ -177,21 +178,6 @@ def _find_css_files (self):
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:
Expand Down Expand Up @@ -232,15 +218,20 @@ def run(self):
'terminatorlib',
'terminatorlib.plugins',
],
setup_requires=[
'pytest-runner',
],
install_requires=[
'pycairo',
'configobj',
'dbus-python',
'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)

0 comments on commit 8ae3253

Please sign in to comment.