diff --git a/.coveragerc b/.coveragerc index 3e01138..ab07a20 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,9 +3,8 @@ branch = True omit = */MedicalImageAnonymizer/__init__.py */MedicalImageAnonymizer/__version__.py - */MedicalImageAnonymizer/build.py */MedicalImageAnonymizer/GUI/__init__.py [report] # Regexes for lines to exclude from consideration exclude_lines = - pragma: no cover \ No newline at end of file + pragma: no cover diff --git a/.travis.yml b/.travis.yml index 31ab8ce..8889726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,30 +7,6 @@ matrix: # linux + python - - os: linux - python: 2.6 - name: ubuntu 14.04 - python@2.6 - env: - - MATRIX_EVAL="" - - - os: linux - python: 2.7 - name: ubuntu 14.04 - python@2.7 - env: - - MATRIX_EVAL="" - - - os: linux - python: 3.3 - name: ubuntu 14.04 - python@3.3 - env: - - MATRIX_EVAL="" - - - os: linux - python: 3.4 - name: ubuntu 14.04 - python@3.4 - env: - - MATRIX_EVAL="" - - os: linux python: 3.5 name: ubuntu 14.04 - python@3.5 @@ -51,34 +27,19 @@ matrix: - MATRIX_EVAL="" - os: linux - python: 3.8-dev - name: ubuntu 14.04 - python@3.8-dev + python: 3.8 + name: ubuntu 14.04 - python@3.8 dist: xenial env: - MATRIX_EVAL="" - allow_failures: - # python2.6 and python3.3 are no longer supported by opencv - # python3.8 does not yet supports opencv - - name: ubuntu 14.04 - python@2.6 - - name: ubuntu 14.04 - python@2.7 - - name: ubuntu 14.04 - python@3.3 - # python3.4 does not support PyNacl as recursive dependency of paramiko - - name: ubuntu 14.04 - python@3.4 - - before_install: - travis_retry eval "${MATRIX_EVAL}" - #- pip install -r requirements.txt - - python -m pip install pydicom==1.3.0 - - python -m pip install nibabel==2.5.0 - - python -m pip install enum34 + - python -m pip install --upgrade pip - python -m pip install codecov - - python -m pip install configparser - - python -m pip install plumbum install: - - python setup.py install + - python -m pip install . script: #- coverage run tests.py diff --git a/MedicalImageAnonymizer/build.py b/MedicalImageAnonymizer/build.py deleted file mode 100644 index c62dc94..0000000 --- a/MedicalImageAnonymizer/build.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from __future__ import print_function - -__package__ = "build_mia" -__author__ = ['Enrico Giampieri', 'Nico Curti'] -__email__ = [ 'enrico.giampier@unibo.it', 'nico.curit2@unibo.it'] - -def get_requires (requirements_filename): - """ - What packages are required for this module to be executed? - """ - with open(requirements_filename, 'r') as fp: - requirements = fp.read() - - return list(filter(lambda x: x != '', requirements.split())) - -def read_description (readme_filename): - """ - Description package from filename - """ - - try: - - with open(readme_filename, 'r') as fp: - description = '\n' - description += fp.read() - - except Exception: - return '' diff --git a/SOURCES.txt b/SOURCES.txt index 3c1c7f6..0101c83 100644 --- a/SOURCES.txt +++ b/SOURCES.txt @@ -1,7 +1,6 @@ setup.py MedicalImageAnonymizer/__init__.py MedicalImageAnonymizer/__version__.py -MedicalImageAnonymizer/build.py MedicalImageAnonymizer/Anonymizer.py MedicalImageAnonymizer/DICOM_anonymizer.py MedicalImageAnonymizer/Nifti_anonymizer.py diff --git a/appveyor.yml b/appveyor.yml index 43c0a94..dcc98c2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,21 +13,9 @@ environment: # The list here is complete (excluding Python 2.6, which # isn't covered by this document) at the time of writing. - #- PYTHON: "C:\\Python27" - # VERSION: 27 - # ARCH: x86 - #- PYTHON: "C:\\Python33" # does not support opencv - # VERSION: 27 - # ARCH: x86 - - PYTHON: "C:\\Python34" - VERSION: 34 - ARCH: x86 - PYTHON: "C:\\Python35" VERSION: 35 ARCH: x86 - #- PYTHON: "C:\\Python27-x64" - # VERSION: 27 - # ARCH: x64 - PYTHON: "C:\\Python35-x64" # pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-window.whl VERSION: 35 ARCH: x64 @@ -41,8 +29,7 @@ install: - "%PYTHON%\\python.exe --version" - cd %WORKSPACE%\MedicalImageAnonymizer - "%PYTHON%\\python.exe -m pip install -U pip" - - "%PYTHON%\\python.exe -m pip install -r requirements.txt" - - "%PYTHON%\\python.exe setup.py install" + - "%PYTHON%\\python.exe -m pip install ." test_script: #- IF [%VERSION%] GEQ [35] IF [%ARCH%] == [x64] %PYTHON%\\Scripts\\pytest.exe diff --git a/setup.py b/setup.py index cae88e9..836e387 100644 --- a/setup.py +++ b/setup.py @@ -11,11 +11,34 @@ from distutils.core import setup from distutils.core import find_packages -from MedicalImageAnonymizer.build import get_requires -from MedicalImageAnonymizer.build import read_description - here = os.path.abspath(os.path.dirname(__file__)) + +def get_requires (requirements_filename): + """ + What packages are required for this module to be executed? + """ + with open(requirements_filename, 'r') as fp: + requirements = fp.read() + + return list(filter(lambda x: x != '', requirements.split())) + + +def read_description (readme_filename): + """ + Description package from filename + """ + + try: + + with open(readme_filename, 'r') as fp: + description = '\n' + description += fp.read() + + except Exception: + return '' + + # Package meta-data. NAME = 'MedicalImageAnonymizer' DESCRIPTION = 'Medical Image Anonymizer Toolkit'