Skip to content

Commit 3412cff

Browse files
committed
Merge branch 'maint'
* Merge branch 'common-diffpy-patches' into maint * Merge branch 'update-conda-recipe' into maint
2 parents 7479aa8 + d486bb5 commit 3412cff

9 files changed

Lines changed: 54 additions & 40 deletions

File tree

.codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fixes:
2+
- ".*/site-packages/::src/"

.travis.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Use container-based travis workers
2-
sudo: false
3-
1+
dist: xenial
42
language: generic
53

64
os:
@@ -23,15 +21,6 @@ branches:
2321
except:
2422
- /^v[0-9]/
2523

26-
addons:
27-
apt:
28-
packages:
29-
- build-essential
30-
- libgsl0-dev
31-
- python-dev
32-
- python-numpy
33-
- python-setuptools
34-
- python-wxtools
3524

3625
before_install:
3726
- MYNAME=diffpy.pdfgui
@@ -44,12 +33,12 @@ before_install:
4433
NOAPT=false; NOMC=true;
4534
MYPIPFLAGS="--user";
4635
fi
47-
- MYMCREPO=https://repo.continuum.io/miniconda
36+
- MYMCREPO=https://repo.anaconda.com/miniconda
4837
- case ${TRAVIS_OS_NAME} in
4938
linux)
50-
MYMCBUNDLE=Miniconda2-latest-Linux-x86_64.sh ;;
39+
MYMCBUNDLE=Miniconda3-latest-Linux-x86_64.sh ;;
5140
osx)
52-
MYMCBUNDLE=Miniconda2-latest-MacOSX-x86_64.sh ;;
41+
MYMCBUNDLE=Miniconda3-latest-MacOSX-x86_64.sh ;;
5342
*)
5443
echo "Unsupported operating system." >&2;
5544
exit 2 ;;
@@ -66,28 +55,36 @@ before_install:
6655
- $NOMC || popd
6756
- $NOMC || source ~/mc/bin/activate base
6857
- $NOMC || conda update --yes conda
69-
- $NOMC || conda install --yes conda-build jinja2
58+
- $NOMC || conda install --yes conda-build conda-verify jinja2
7059
- $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
7160
- $NOMC || conda config --add channels diffpy
7261

62+
# TODO - remove after update to wxpython 4
63+
- $NOMC || conda config --set restore_free_channel true
64+
7365
- $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $?
7466
- $NOAPT || PATH="$(echo "$PATH" | sed 's,:/opt/pyenv/[^:]*,,g')"
7567
- $NOAPT || test "$(which python)" = "/usr/bin/python" || (
7668
which python; exit 1)
69+
- $NOAPT || sudo apt-get update -qq
70+
- $NOAPT || sudo apt-get install -y
71+
build-essential libgsl0-dev python-dev
72+
python-numpy python-setuptools python-pip python-wxtools
7773
- $NOAPT || devutils/makesdist
7874
- $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
7975

8076
install:
81-
- $NOMC || conda build --python=${MYPYTHON_VERSION} conda-recipe
77+
- $NOMC || conda build --python=${MYPYTHON_VERSION} --no-test conda-recipe
8278
- $NOMC || conda render --python=${MYPYTHON_VERSION} --output conda-recipe |
8379
sed 's,.*/,,; s/[.]tar[.]bz2$//; s/-/=/g' > /tmp/mypackage.txt
8480
- $NOMC || source activate testenv
8581
- $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
8682

83+
# TODO - remove after fix of libgsl.a location in pdffit2
84+
- $NOAPT || sudo ln -si /usr/lib/x86_64-linux-gnu/libgsl.a /usr/lib/libgsl.a
85+
8786
- $NOAPT || pip install $MYPIPFLAGS coverage
88-
# TODO - remove after fixup release of PyCifRW following 4.3.
89-
- $NOAPT || pip install $MYPIPFLAGS "pycifrw==4.2.1"
90-
- $NOAPT || easy_install --user "${MYTARBUNDLE}"
87+
- $NOAPT || pip install $MYPIPFLAGS "${MYTARBUNDLE}"
9188

9289
- cd ${MYRUNDIR}
9390
- MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__git_commit__)")

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. image:: https://travis-ci.org/diffpy/diffpy.pdfgui.svg?branch=master
22
:target: https://travis-ci.org/diffpy/diffpy.pdfgui
33

4-
.. image:: http://codecov.io/github/diffpy/diffpy.pdfgui/coverage.svg?branch=master
5-
:target: http://codecov.io/github/diffpy/diffpy.pdfgui?branch=master
4+
.. image:: https://codecov.io/gh/diffpy/diffpy.pdfgui/branch/master/graph/badge.svg
5+
:target: https://codecov.io/gh/diffpy/diffpy.pdfgui
66

77

88
PDFgui

conda-recipe/bld.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%PYTHON% setup.py install
1+
%PYTHON% -m pip install --no-deps -vv .
22
if errorlevel 1 exit 1
33

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

conda-recipe/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
$PYTHON setup.py install
3+
$PYTHON -m pip install --no-deps -vv .
44

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python:
2+
- 2.7

conda-recipe/meta.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ app:
2727
summary: materials structure analysis from Pair Distribution Function
2828

2929
requirements:
30-
build:
31-
- python
30+
host:
31+
- python {{ python }}
32+
- pip
3233
- setuptools
33-
- diffpy.pdffit2
34-
- diffpy.structure 1.*
35-
- diffpy.utils 1.*
3634

3735
run:
3836
- python
@@ -41,8 +39,8 @@ requirements:
4139
- wxpython 3.*
4240
- menuinst [win]
4341
- diffpy.pdffit2
44-
- diffpy.structure 1.*
45-
- diffpy.utils 1.*
42+
- diffpy.structure
43+
- diffpy.utils
4644

4745
test:
4846
# Python imports

conda-recipe/run_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22

3-
import diffpy.pdffit2.tests
4-
assert diffpy.pdffit2.tests.testdeps().wasSuccessful()
3+
import diffpy.pdfgui.tests
4+
assert diffpy.pdfgui.tests.testdeps().wasSuccessful()

setup.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
"""
1010

1111
import os
12+
import re
13+
import sys
1214
from setuptools import setup, find_packages
1315

1416
# Use this version when git data are not available, like in git zip archive.
1517
# Update when tagging a new release.
1618
FALLBACK_VERSION = '1.1.2.post0'
1719

20+
# determine if we run with Python 3.
21+
PY3 = (sys.version_info[0] == 3)
22+
1823
# versioncfgfile holds version data for git commit hash and date.
1924
# It must reside in the same directory as version.py.
2025
MYDIR = os.path.dirname(os.path.abspath(__file__))
@@ -23,7 +28,7 @@
2328

2429
def gitinfo():
2530
from subprocess import Popen, PIPE
26-
kw = dict(stdout=PIPE, cwd=MYDIR)
31+
kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True)
2732
proc = Popen(['git', 'describe', '--match=v[[:digit:]]*'], **kw)
2833
desc = proc.stdout.read()
2934
proc = Popen(['git', 'log', '-1', '--format=%H %ct %ci'], **kw)
@@ -35,8 +40,10 @@ def gitinfo():
3540

3641

3742
def getversioncfg():
38-
import re
39-
from ConfigParser import RawConfigParser
43+
if PY3:
44+
from configparser import RawConfigParser
45+
else:
46+
from ConfigParser import RawConfigParser
4047
vd0 = dict(version=FALLBACK_VERSION, commit='', date='', timestamp=0)
4148
# first fetch data from gitarchivecfgfile, ignore if it is unexpanded
4249
g = vd0.copy()
@@ -65,18 +72,24 @@ def getversioncfg():
6572
cp.set('DEFAULT', 'commit', g['commit'])
6673
cp.set('DEFAULT', 'date', g['date'])
6774
cp.set('DEFAULT', 'timestamp', g['timestamp'])
68-
cp.write(open(versioncfgfile, 'w'))
75+
with open(versioncfgfile, 'w') as fp:
76+
cp.write(fp)
6977
return cp
7078

7179
versiondata = getversioncfg()
7280

81+
7382
def dirglob(d, *patterns):
7483
from glob import glob
7584
rv = []
7685
for p in patterns:
7786
rv += glob(os.path.join(d, p))
7887
return rv
7988

89+
90+
with open(os.path.join(MYDIR, 'README.rst')) as fp:
91+
long_description = fp.read()
92+
8093
# define distribution
8194
setup_args = dict(
8295
name = 'diffpy.pdfgui',
@@ -100,9 +113,9 @@ def dirglob(d, *patterns):
100113
# manual and tutorial files should not be zipped
101114
zip_safe = False,
102115
install_requires = [
103-
'diffpy.Structure>=1.2',
104-
'diffpy.pdffit2>=1.1a0',
105-
'diffpy.utils>=1.1',
116+
'diffpy.structure',
117+
'diffpy.pdffit2',
118+
'diffpy.utils',
106119
],
107120

108121
author = 'Simon J.L. Billinge',
@@ -111,6 +124,8 @@ def dirglob(d, *patterns):
111124
maintainer_email = 'pavol.juhas@gmail.com',
112125
url = 'https://github.com/diffpy/diffpy.pdfgui',
113126
description = "GUI for PDF simulation and structure refinement.",
127+
long_description = long_description,
128+
long_description_content_type = 'text/x-rst',
114129
license = 'BSD',
115130
keywords = 'PDF structure refinement GUI',
116131
classifiers = [

0 commit comments

Comments
 (0)