Skip to content

Commit e3a345d

Browse files
committed
Merge pull request #751 from kain88-de/conda
conda build scripts (fixes #608)
2 parents e39ace4 + abf7aa7 commit e3a345d

File tree

8 files changed

+181
-39
lines changed

8 files changed

+181
-39
lines changed

README.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
|build| |cov| [*]_
66

7-
|docs| |devdocs| |usergroup| |developergroup|
7+
|docs| |devdocs| |usergroup| |developergroup| |anaconda|
88

99
MDAnalysis_ is a Python toolkit to analyze molecular dynamics
1010
trajectories generated by a wide range of popular simulation packages
@@ -14,18 +14,18 @@ lists of supported `trajectory formats`_ and `topology formats`_.)
1414
.. code:: python
1515
1616
import MDAnalysis as mda
17-
17+
1818
# Load simulation results with a single line
1919
u = mda.Universe('topol.tpr','traj.trr')
20-
20+
2121
# Select atoms
2222
ag = u.select_atoms('name OH')
23-
23+
2424
# Atom data made available as Numpy arrays
2525
ag.positions
2626
ag.velocities
2727
ag.forces
28-
28+
2929
# Iterate through trajectories
3030
for ts in u.trajectory:
3131
print(ag.center_of_mass())
@@ -61,7 +61,7 @@ MDAnalysis issue tracker.)
6161

6262
.. Footnotes
6363
64-
.. [*] **build**: Unit testing is for the whole package; **coverage** is shown for the core library
64+
.. [*] **build**: Unit testing is for the whole package; **coverage** is shown for the core library
6565
modules (which excludes `MDAnalysis.analysis`_ and `MDAnalysis.visualization`_ at
6666
the moment). For more details and discussion see issue `#286`_.
6767
@@ -77,11 +77,11 @@ MDAnalysis issue tracker.)
7777
.. |usergroup| image:: https://img.shields.io/badge/Google%20Group-Users-lightgrey.svg
7878
:alt: User Google Group
7979
:target: http://users.mdanalysis.org
80-
80+
8181
.. |developergroup| image:: https://img.shields.io/badge/Google%20Group-Developers-lightgrey.svg
8282
:alt: Developer Google Group
8383
:target: http://developers.mdanalysis.org
84-
84+
8585
.. |docs| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
8686
:alt: Documentation (latest release)
8787
:target: http://docs.mdanalysis.org
@@ -93,7 +93,11 @@ MDAnalysis issue tracker.)
9393
.. |build| image:: https://travis-ci.org/MDAnalysis/mdanalysis.svg?branch=develop
9494
:alt: Build Status
9595
:target: https://travis-ci.org/MDAnalysis/mdanalysis
96-
96+
9797
.. |cov| image:: https://coveralls.io/repos/MDAnalysis/mdanalysis/badge.svg?branch=develop
9898
:alt: Coverage Status
9999
:target: https://coveralls.io/r/MDAnalysis/mdanalysis?branch=develop
100+
101+
.. |anaconda| image:: https://anaconda.org/mdanalysis/mdanalysis/badges/version.svg
102+
:alt: Anaconda
103+
:target: https://anaconda.org/MDAnalysis/mdanalysis

maintainer/change_release.sh

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ like '0.7.6' or 0.7.6-dev'.
1010
Run from the top directory of the git checkout.
1111
"
1212

13-
FILES="package/setup.py package/MDAnalysis/version.py testsuite/setup.py testsuite/MDAnalysisTests/__init__.py"
13+
FILES="package/setup.py package/MDAnalysis/version.py testsuite/setup.py testsuite/MDAnalysisTests/__init__.py maintainer/conda/MDAnalysis/meta.yaml"
1414

1515
die () {
1616
echo "ERROR: $1"
@@ -19,40 +19,40 @@ die () {
1919

2020
findcommand() {
2121
for name in $*; do
22-
path=$(which $name)
23-
if [ -n "$path" ]; then
24-
echo $path
25-
return 0
26-
fi
22+
path=$(which $name)
23+
if [ -n "$path" ]; then
24+
echo $path
25+
return 0
26+
fi
2727
done
2828
die "None of the commands $* found." 2
2929
}
3030

3131
sed_eregex () {
32-
# does this sed understand extended regular expressions?
33-
# - FreeBSD (Mac OS X) sed -E
34-
# - GNU sed --regexp-extended (undocumented: also -E ...)
35-
local SED=$1
36-
if [ "good" = "$(echo 'bad' | $SED -E 's/(abc)?bad|foo/good/')" ]; then
37-
echo "$SED -E"
38-
return 0
39-
elif [ "good" = "$(echo 'bad' | $SED --regexp-extended 's/(abc)?bad|foo/good/')" ]; then
40-
echo "$SED --regexp-extended"
41-
return 0
42-
elif [ "good" = "$(echo 'bad' | $SED 's/(abc)?bad|foo/good/')" ]; then
43-
echo "$SED"
44-
return 0
45-
fi
46-
echo "false"
47-
return 1
32+
# does this sed understand extended regular expressions?
33+
# - FreeBSD (Mac OS X) sed -E
34+
# - GNU sed --regexp-extended (undocumented: also -E ...)
35+
local SED=$1
36+
if [ "good" = "$(echo 'bad' | $SED -E 's/(abc)?bad|foo/good/')" ]; then
37+
echo "$SED -E"
38+
return 0
39+
elif [ "good" = "$(echo 'bad' | $SED --regexp-extended 's/(abc)?bad|foo/good/')" ]; then
40+
echo "$SED --regexp-extended"
41+
return 0
42+
elif [ "good" = "$(echo 'bad' | $SED 's/(abc)?bad|foo/good/')" ]; then
43+
echo "$SED"
44+
return 0
45+
fi
46+
echo "false"
47+
return 1
4848
}
4949

5050
while getopts h OPT; do
5151
case $OPT in
52-
h) echo "$usage";
53-
exit 0
54-
;;
55-
\?) exit 2;;
52+
h) echo "$usage";
53+
exit 0
54+
;;
55+
\?) exit 2;;
5656
esac
5757
done
5858

@@ -62,11 +62,11 @@ RELEASE=$1
6262
test -n "$RELEASE" || die "Required argument missing. See -h for help." 2
6363

6464
# find a sed with -i and -E
65-
for cmd in gsed sed; do
65+
for cmd in gsed sed; do
6666
SED=$(sed_eregex $(findcommand $cmd))
6767
[ "$SED" != "false" ] && break
6868
done
69-
[ "$SED" = "false" ] && { echo "ERROR: cannot find suitable sed."; exit 1; }
69+
[ "$SED" = "false" ] && { echo "ERROR: cannot find suitable sed."; exit 1; }
7070
# should check for -i but we just hope for the best ...
7171
# modern(ish) seds have -i
7272
echo "Using sed = $SED"
@@ -75,7 +75,11 @@ echo "Setting RELEASE/__version__ in MDAnalysis to $RELEASE"
7575

7676
git grep -E -l 'RELEASE.*[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?' $FILES \
7777
| xargs -I FILE $SED '/RELEASE/s/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?/'${RELEASE}'/' -i.bak FILE
78+
7879
git grep -E -l '__version__ =.*[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?' $FILES \
7980
| xargs -I FILE $SED '/__version__/s/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?/'${RELEASE}'/' -i.bak FILE
80-
git status
8181

82+
git grep -E -l 'version:.*[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?' $FILES \
83+
| xargs -I FILE $SED '/version:/s/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(dev|rc*[0-9])?/'${RELEASE}'/' -i.bak FILE
84+
85+
git status
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
MDA_USE_OPENMP=FALSE pip install package/
4+
pip install testsuite/
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package:
2+
name: mdanalysis
3+
# This has to be changed after a release
4+
version: "0.14.0"
5+
6+
source:
7+
# to build from source you can speficy the path to the code directly.
8+
# path: ../../../
9+
# This ensures that you will build from a clean checkout
10+
git_url: https://github.com/MDAnalysis/mdanalysis
11+
git_branch: master
12+
# git_tag: release-0.14.0
13+
14+
requirements:
15+
build:
16+
- python
17+
- setuptools
18+
- pip
19+
- numpy
20+
- cython
21+
- biopython
22+
- networkx
23+
- griddataformats
24+
- nose
25+
- tempdir
26+
27+
run:
28+
- python
29+
- numpy
30+
- scipy
31+
- griddataformats
32+
- networkx
33+
- biopython
34+
- matplotlib
35+
- seaborn
36+
- six
37+
- netcdf4
38+
- nose
39+
- tempdir
40+
41+
test:
42+
imports:
43+
- MDAnalysis
44+
- MDAnalysis.analysis
45+
# check that distance cython modules have been build
46+
- MDAnalysis.lib.c_distances_openmp
47+
- MDAnalysis.lib.c_distances
48+
49+
requires:
50+
# this is the same list as the run requirements
51+
- python
52+
- numpy
53+
- scipy
54+
- griddataformats
55+
- networkx
56+
- biopython
57+
- matplotlib
58+
- seaborn
59+
- six
60+
- netcdf4
61+
- nose
62+
- tempdir
63+
64+
commands:
65+
# run the testsuite with 2 processes
66+
- python -c 'import MDAnalysisTests; MDAnalysisTests.run(label="full", extra_argv=["-v", "--processes=2", "--process-timeout=120"])'
67+
68+
about:
69+
home: http://www.mdanalysis.org
70+
license: GPLv2
71+
license_file: package/LICENSE
72+
summary: 'MDAnalysis is a Python library to analyze molecular dynamics trajectories.'
73+
74+
# See
75+
# http://docs.continuum.io/conda/build.html for
76+
# more information about meta.yaml

maintainer/conda/tempdir/bld.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"%PYTHON%" setup.py install
2+
if errorlevel 1 exit 1
3+
4+
:: Add more build steps here, if they are necessary.
5+
6+
:: See
7+
:: http://docs.continuum.io/conda/build.html
8+
:: for a list of environment variables that are set during the build process.

maintainer/conda/tempdir/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
$PYTHON setup.py install
4+
5+
# Add more build steps here, if they are necessary.
6+
7+
# See
8+
# http://docs.continuum.io/conda/build.html
9+
# for a list of environment variables that are set during the build process.

maintainer/conda/tempdir/meta.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package:
2+
name: tempdir
3+
version: "0.7.1"
4+
5+
source:
6+
fn: tempdir-0.7.1.tar.gz
7+
url: https://pypi.python.org/packages/source/t/tempdir/tempdir-0.7.1.tar.gz
8+
md5: 4076f2d7fa9306c77f7b16a5f2e4c154
9+
10+
build:
11+
noarch_python: True
12+
13+
requirements:
14+
build:
15+
- python
16+
- setuptools
17+
18+
run:
19+
- python
20+
21+
test:
22+
# Python imports
23+
imports:
24+
- tempdir
25+
26+
about:
27+
home: https://bitbucket.org/another_thomas/tempdir
28+
license: MIT License
29+
summary: 'Tempdirs are temporary directories, based on tempfile.mkdtemp'
30+
31+
# See
32+
# http://docs.continuum.io/conda/build.html for
33+
# more information about meta.yaml

package/CHANGELOG

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The rules for this file:
1313
* release numbers follow "Semantic Versioning" http://semver.org
1414

1515
------------------------------------------------------------------------------
16-
??/??/16 jandom, abhinavgupta94, orbeckst
16+
??/??/16 jandom, abhinavgupta94, orbeckst, kain88-de, hainm
1717

1818
* 0.15.0
1919

@@ -27,6 +27,10 @@ API Changes
2727
* rmsd doesn't superimpose by default anymore. The superposition
2828
is controlled by the 'superposition' keyword now. (see issue #562)
2929

30+
Enhancements
31+
32+
* Add conda build scripts (Issue #608)
33+
3034
Fixes
3135

3236
* test_shear_from_matrix doesn't fail for MKL builds anymore (Issue #757)

0 commit comments

Comments
 (0)