Skip to content

Commit d486bb5

Browse files
committed
Merge branch 'common-diffpy-patches' into maint
2 parents 92c5406 + ead5aef commit d486bb5

4 files changed

Lines changed: 27 additions & 10 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ before_install:
3333
NOAPT=false; NOMC=true;
3434
MYPIPFLAGS="--user";
3535
fi
36-
- MYMCREPO=https://repo.continuum.io/miniconda
36+
- MYMCREPO=https://repo.anaconda.com/miniconda
3737
- case ${TRAVIS_OS_NAME} in
3838
linux)
39-
MYMCBUNDLE=Miniconda2-latest-Linux-x86_64.sh ;;
39+
MYMCBUNDLE=Miniconda3-latest-Linux-x86_64.sh ;;
4040
osx)
41-
MYMCBUNDLE=Miniconda2-latest-MacOSX-x86_64.sh ;;
41+
MYMCBUNDLE=Miniconda3-latest-MacOSX-x86_64.sh ;;
4242
*)
4343
echo "Unsupported operating system." >&2;
4444
exit 2 ;;
@@ -55,7 +55,7 @@ before_install:
5555
- $NOMC || popd
5656
- $NOMC || source ~/mc/bin/activate base
5757
- $NOMC || conda update --yes conda
58-
- $NOMC || conda install --yes conda-build jinja2
58+
- $NOMC || conda install --yes conda-build conda-verify jinja2
5959
- $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
6060
- $NOMC || conda config --add channels diffpy
6161

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

setup.py

Lines changed: 19 additions & 4 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',
@@ -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)