diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6524a3fd7cb85e8093c49e99c381fdbc7c0230c9..1bc87f19a75ebeec1b0f4efc381c15a59272730c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,17 +20,26 @@ stages: before_script: - pip install -e .[dev] +python3.6: + image: python:3.6 + tags: + - passoft + stage: test + script: + - python -m unittest -python2: - image: python:2.7 +python3.7: + image: python:3.7 tags: - passoft stage: test - script: tox -e py27 + script: + - python -m unittest -python3: - image: python:3.6 +python3.8: + image: python:3.8 tags: - passoft stage: test - script: tox -e py36 + script: + - python -m unittest diff --git a/docs/conf.py b/docs/conf.py index a7466263d5380a52fa66367ec74d8b544766c5f7..75a17634aa20fe0025454e34b1b2fe0f8027f5b8 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,9 +47,9 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'fixhdr' -copyright = u"2018, IRIS PASSCAL" -author = u"IRIS PASSCAL" +project = 'fixhdr' +copyright = "2018, IRIS PASSCAL" +author = "IRIS PASSCAL" # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout @@ -129,8 +129,8 @@ latex_elements = { # [howto, manual, or own class]). latex_documents = [ (master_doc, 'fixhdr.tex', - u'fixhdr Documentation', - u'IRIS PASSCAL', 'manual'), + 'fixhdr Documentation', + 'IRIS PASSCAL', 'manual'), ] @@ -140,7 +140,7 @@ latex_documents = [ # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'fixhdr', - u'fixhdr Documentation', + 'fixhdr Documentation', [author], 1) ] @@ -152,7 +152,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'fixhdr', - u'fixhdr Documentation', + 'fixhdr Documentation', author, 'fixhdr', 'One line description of project.', diff --git a/fixhdr/fixhdr.py b/fixhdr/fixhdr.py index 437db442b27264d88c47d144a590012f2e7756c4..405ad1be19bf93e7361cf8a260dd642d3d4b3e91 100755 --- a/fixhdr/fixhdr.py +++ b/fixhdr/fixhdr.py @@ -257,25 +257,16 @@ VERSION = "2019.025" import os, sys, string, time import Pmw -if sys.version_info[0] == 3: - # for Python3 - from tkinter import * ## notice lowercase 't' in tkinter here - from tkinter.filedialog import * - #from tkinter.filedialog import askopenfilename -else: - # for Python2 - VERSION += " run in py2passoft" - from Tkinter import * ## notice capitalized T in Tkinter - from FileDialog import * - from tkFileDialog import askopenfilename from operator import mod from struct import pack from getopt import getopt -from LibTrace import * #import threading from glob import glob +from tkinter import * +from tkinter.filedialog import * +from fixhdr.LibTrace import * SPACE = " " DATALOC = "" diff --git a/setup.py b/setup.py index 7c694c2eeb965563f91af14311b922b45255d52c..8dfa0dc43980feae59095867190df9241ec54ead 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ from setuptools import setup, find_packages -with open('README.rst') as readme_file: +with open('README.rst', 'rt') as readme_file: readme = readme_file.read() -with open('HISTORY.rst') as history_file: +with open('HISTORY.rst', 'rt') as history_file: history = history_file.read() @@ -20,7 +20,9 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Natural Language :: English', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], description="Modifies mseed headers", entry_points={ @@ -28,7 +30,7 @@ setup( 'fixhdr=fixhdr.fixhdr:main', ], }, - install_requires=['Pmw'], + install_requires=['Pmw @ https://github.com/schrodinger/pmw-patched/archive/master.tar.gz'], setup_requires = [], extras_require={ 'dev': [ diff --git a/tests/test_fixhdr.py b/tests/test_fixhdr.py index c81b8e25302816c18b2d2d1770592253ffd5cf2d..7520eb40c343bc59a0ac890a78a20f830777b7d2 100644 --- a/tests/test_fixhdr.py +++ b/tests/test_fixhdr.py @@ -21,8 +21,4 @@ class TestFixhdr(unittest.TestCase): """Tear down test fixtures, if any.""" def test_import(self): - if 'fixhdr' in sys.modules: - self.assert_(True, "fixhdr loaded") - else: - self.fail() - + self.assertTrue('fixhdr' in sys.modules, "Fixhdr import failed!") diff --git a/tox.ini b/tox.ini index 5482bdfbbba7662cec49153b3c31307252b7e8d1..bf6c0725b91a09d47ebc02bcfec374415d4ecfc9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,5 @@ [tox] -envlist = py27, py36 flake8 - -[travis] -python = - 2.7: py27 - 3.6: py36 - -[testenv:flake8] -basepython = python -deps = flake8 -commands = flake8 fixhdr +envlist = py36, py37, py38 [testenv] -setenv = - PYTHONPATH = {toxinidir} -commands=python setup.py test - - +commands = python -m unittest