Skip to content
Snippets Groups Projects
Commit 618b728d authored by Jan Caron's avatar Jan Caron
Browse files

Small changes to deployment files.

Added environment.yml and requirement.txt.
GitLab should now produce html coverage artifacts.
io_vectordata: now warns if grid spacing is not equal in all directions.
parent 8d8fafaa
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,9 @@ before_script:
# Install jutil via secure ssh connection:
- pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
## Used for
#- pip install pytest pytest-cov
stages:
- test
......@@ -27,5 +30,9 @@ test:
# TODO: Different jobs with custom develop arguments? extra_requires (hyperspy, plotting)?
# TODO: Use pip install -e .[hyperspy], etc.
# Install requirements (-e: editable, like python setup.py develop, but pip, not easy_install):
- pip install -e . # TODO: belongs here or before_script?
- pip install -e .['tests'] # Also installs everything for tests!
- python setup.py test
- coverage html
artifacts:
paths:
- htmlcov/
name: pyramid
dependencies:
- python=3.5
- numpy
- pip
- pip:
- pypi-package-name
......@@ -155,7 +155,7 @@ def _load_from_ovf(filename, a):
field = np.asarray((x_mag, y_mag, z_mag)) * float(header.get('valuemultiplier', 1))
if a is None:
# TODO: If transferred to HyperSpy, this has to stay in Pyramid reader!
if header.get('xstepsize') == header.get('ystepsize') == header.get('zstepsize'):
if not header.get('xstepsize') == header.get('ystepsize') == header.get('zstepsize'):
_log.warning('Grid spacing is not equal in x, y and z (x will be used)!')
a = float(header.get('xstepsize', 1.))
meshunit = header.get('meshunit', 'nm')
......
-e .
......@@ -36,7 +36,7 @@ omit =
[tool:pytest]
addopts = --cov --flake8
flake8-max-line-length = 120
flake8-max-line-length = 100
flake8-ignore =
ALL # TODO: PEP8 deactivated by this line (remove at a later point)!
E402 E124 E125
......
......@@ -8,7 +8,7 @@ import subprocess
import sys
from distutils.command.build import build
import numpy
#import numpy
from setuptools import setup, find_packages
......@@ -19,8 +19,8 @@ MAINTAINER_EMAIL = 'j.caron@fz-juelich.de'
URL = ''
VERSION = '0.1.0-dev'
PYTHON_VERSION = (2, 7)
DEPENDENCIES = {'numpy': (1, 10)}
LONG_DESCRIPTION = 'long description (TODO!)' # TODO: Long description!
DEPENDENCIES = {'numpy': (1, 10)} # TODO: get rid off!!!
LONG_DESCRIPTION = 'long description (TODO!)' # TODO: Long description! put in (Readme?) file!
def get_package_version(package):
......@@ -126,6 +126,15 @@ def get_files(rootdir):
return filepaths
# TODO: extend extras_require for plotting and IO:
extras_require = {
# TODO: Test all if really needed! don't use nose, if possible (pure pytest)!
"tests": ['pytest', 'pytest-runner', 'pytest-cov', 'pytest-flake8', 'coverage', 'nose']
# TODO: more for mayavi (plotting in general) and hyperspy, etc (see below)...
}
print('\n-------------------------------------------------------------------------------')
print('checking requirements')
check_requirements()
......@@ -140,17 +149,17 @@ setup(name=DISTNAME,
download_url=URL,
version=VERSION,
packages=find_packages(exclude=['tests', 'doc']),
include_dirs=[numpy.get_include()],
#include_dirs=[numpy.get_include()],
# TODO: Use requirements.txt? extras_require for optional stuff (hyperspy, plotting)?
# TODO: After split of Pyramid, comment out and see what really is used (is e.g. scipy?)!
# - pip install numpy scipy nose h5py matplotlib Pillow scikit-image cmocean hyperspy
setup_requires=['numpy>=1.6', 'pytest-runner', 'pytest'],
tests_require=['nose', 'pytest-cov', 'pytest-flake8', 'coverage'],
#setup_requires=['numpy>=1.6', 'pytest', 'pytest-runner'],
#tests_require=['pytest', 'pytest-cov', 'pytest-flake8'],
install_requires=['numpy>=1.6', 'tqdm', 'scipy', 'matplotlib', 'Pillow', 'h5py',
'hyperspy', 'jutil', 'cmocean'],
extras_require=extras_require,
# TODO: extra: 'pyfftw', 'mayavi' (not easy to install... find a way!)
# TODO: See https://stackoverflow.com/a/28842733 for extras_require...
# TODO: ...replace [dev] with [IO] (hyperspy) and [plotting] (separate plotting library)!
test_suite='nose.collector',
#test_suite='nose.collector', # TODO: don't use nose!
cmdclass={'build': build})
print('-------------------------------------------------------------------------------\n')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment