Skip to content

Commit

Permalink
Merge pull request #90 from pseudocubic/feature/conda-build
Browse files Browse the repository at this point in the history
Feature/conda build
  • Loading branch information
David M Fobes committed Aug 25, 2016
2 parents 6ef3285 + b462f52 commit 43af976
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 18 deletions.
47 changes: 41 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,48 @@ language: generic
matrix:
include:
- os: linux
env: PYTHON_VERSION=2.7 NUMPY_VERSION=1.10.2 SCIPY_VERSION=0.16.1 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=2.7
- NUMPY_VERSION=1.10.2
- SCIPY_VERSION=0.16.1
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
- os: linux
env: PYTHON_VERSION=3.4 NUMPY_VERSION=1.10.2 SCIPY_VERSION=0.16.1 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=3.4
- NUMPY_VERSION=1.10.2
- SCIPY_VERSION=0.16.1
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
- os: linux
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.11.1 SCIPY_VERSION=0.18 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=3.5
- NUMPY_VERSION=1.11.1
- SCIPY_VERSION=0.18
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
- secure: "HDIWzCpi0kGZzvRWKLOlBOjNYellI2x08uQ3qiEBuBIMp73EQYx3amhOxm0HoUgK4T1FoeFvVwZRgR8UoV8pDnXtMXxQ/XxVlnHDZE3EtBBHv8sabgtEbE0k9WebGK3krYFPvWHB85xig57kjr7caBqTjhIt9cc6lcKFBgOo2FQ="
- os: osx
env: PYTHON_VERSION=2.7 NUMPY_VERSION=1.10.2 SCIPY_VERSION=0.16.1 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=2.7
- NUMPY_VERSION=1.10.2
- SCIPY_VERSION=0.16.1
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
- os: osx
env: PYTHON_VERSION=3.4 NUMPY_VERSION=1.10.2 SCIPY_VERSION=0.16.1 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=3.4
- NUMPY_VERSION=1.10.2
- SCIPY_VERSION=0.16.1
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
- os: osx
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.11.1 SCIPY_VERSION=0.18 MATPLOTLIB_VERSION=1.5.1 LMFIT_VERSION=0.9.5
env:
- PYTHON_VERSION=3.5
- NUMPY_VERSION=1.11.1
- SCIPY_VERSION=0.18
- MATPLOTLIB_VERSION=1.5.1
- LMFIT_VERSION=0.9.5
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; fi
Expand All @@ -34,6 +65,10 @@ script:
- pytest --cov=neutronpy --tb=short
after_success:
- codecov
- source deactivate
- if [ "$TRAVIS_BRANCH" == "master" ] && [ -n "$TRAVIS_TAG"] && [ "$PYTHON_VERSION" == "3.5" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then conda config --add channels neutronpy; fi
- if [ "$TRAVIS_BRANCH" == "master" ] && [ -n "$TRAVIS_TAG"] && [ "$PYTHON_VERSION" == "3.5" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then conda update -q --yes conda conda-build; fi
- if [ "$TRAVIS_BRANCH" == "master" ] && [ -n "$TRAVIS_TAG"] && [ "$PYTHON_VERSION" == "3.5" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then conda build --user neutronpy --token $CONDA_TOKEN ./conda-recipe; fi
deploy:
- provider: pypi
user: davidfobes
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ The following packages are required to install this library:

Installation
------------
It is recommended that you use `anaconda <>`_ and ``pip`` to install NeutronPy::
It is recommended that you use `anaconda <>`_ or ``pip`` to install NeutronPy::

conda config --add channels mmcauliffe
conda install python nomkl numpy scipy h5py matplotlib pyqt5
pip install neutronpy
conda install -c neutronpy neutronpy

or::

Note: the added channel is for pyqt5.
pip install neutronpy

The resolution calculator gui can be used after installation by executing ``neutronpy`` from the command-line.
Note: the channel ``mmcauliffe`` is required for pyqt5, so that the resolution calculator gui can be used after installation by executing ``neutronpy`` from the command-line. See Installation for more detailed instructions.

Documentation
-------------
Expand Down
8 changes: 8 additions & 0 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"%PYTHON%" setup.py install
if errorlevel 1 exit 1

:: Add more build steps here, if they are necessary.

:: See
:: http://docs.continuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.
9 changes: 9 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

$PYTHON setup.py install

# Add more build steps here, if they are necessary.

# See
# http://docs.continuum.io/conda/build.html
# for a list of environment variables that are set during the build process.
70 changes: 70 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package:
name: neutronpy
version: "1.0.1b2"

source:
path: ../
# patches:
# List any patch files here
# - fix.patch

build:
noarch_python: True
# preserve_egg_dir: True
entry_points:
- neutronpy=neutronpy.gui:launch

# If this is a new build for the same version, increment the build
# number. If you do not include this key, it defaults to 0.
# number: 1

requirements:
build:
- python
- setuptools
- numpy
- scipy
- matplotlib
- lmfit
- h5py

run:
- python
- numpy
- scipy
- matplotlib
- lmfit
- h5py

test:
# Python imports
imports:
- neutronpy
- neutronpy.crystal
- neutronpy.data
- neutronpy.fileio
- neutronpy.fileio.loaders
- neutronpy.instrument
- neutronpy.lsfit
- neutronpy.scattering

commands:
# You can put test commands to be run here. Use this to test that the
# entry points work.
# - neutronpy --help

# You can also put a file called run_test.py in the recipe that will be run
# at test time.

# requires:
# Put any additional test requirements here. For example
# - nose

about:
home: https://github.com/neutronpy/neutronpy
license: MIT License
summary: 'NeutronPy: Neutron scattering tools for scientific data analysis in python'

# See
# http://docs.continuum.io/conda/build.html for
# more information about meta.yaml
1 change: 1 addition & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Changelog
=========

* :feature:`90` Added automatic conda builds for tagged releases
* :feature:`89` Depreciated support for py26 and py33, and changed to py.test from nose. Added ``nan_policy`` kwarg to :py:class:`.Fitter`
* :feature:`86` Enhanced :py:meth:`.Data.integrate`, :py:meth:`.Data.position`, :py:meth:`.Data.width`
* :bug:`84` Fixed typo in ``resolution.ui`` to select ``'Co0.92Fe0.08(200)'`` as monochromator/analyzer in :py:mod:`neutronpy.gui`
Expand Down
14 changes: 9 additions & 5 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ The following explains various methods for installing neutronpy on your system.

Anaconda Cloud - conda -- **Recommended**
-----------------------------------------
One recommended method for installing `neutronpy <https://anaconda.org/neutronpy>`_ is using `Anaconda <http://branding-continuum-content.pantheonsite.io/downloads>`_. Once Anaconda is installed, from the command line::
The recommended method for installing `neutronpy <https://anaconda.org/neutronpy>`_ is using `Anaconda <http://branding-continuum-content.pantheonsite.io/downloads>`_. Once Anaconda is installed, from the command line::

conda config --add channels neutronpy
conda config --add channels mmcauliffe
conda install neutronpy pyqt5
conda install -c neutronpy neutronpy

``pyqt5`` is an optional package, necessary for the neutronpy resolution gui executed from the command line with ``neutronpy``.
``pyqt5`` is necessary for the neutronpy resolution gui executed from the command line with ``neutronpy``, but optional for all other features of neutronpy. ``pyqt5`` currently also requires Python 3.4. You can create a virtual environment with ``python=3.4``, activate it, and install neutronpy in the following way::

conda install -c neutronpy neutronpy
conda uninstall qt pyqt
conda install -c mmcauliffe pyqt5

``matplotlib`` seems to force the installation of qt4, so it needs to be uninstalled to work correctly.

Python Package Index - pip
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion neutronpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
except ImportError:
warnings.warn('PyQt5 not found, cannot run Resolution GUI')

__version__ = '1.0.1-b2'
__version__ = '1.0.1-b3'

if sys.version_info[:2] == (2, 6) or sys.version_info[:2] == (3, 3):
warnings.warn('Support for Python 2.6 and Python 3.3 is depreciated and will be dropped in neutronpy 1.1.0',
Expand Down

0 comments on commit 43af976

Please sign in to comment.