Skip to content

Commit f70d78b

Browse files
committed
DOC and BLD: fixed doc and conda package build
1 parent 4c3363e commit f70d78b

File tree

9 files changed

+40
-73
lines changed

9 files changed

+40
-73
lines changed

.conda-recipe/meta.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ source:
66
git_url: ..
77

88
build:
9-
# noarch: python # TODO Add back noarch when it works properly on Windows,
10-
# we are converting packages manually now
11-
script:
12-
# TODO remove this and add back quantities as conda package once its updated with the new numpy API
13-
- pip install git+https://github.com/python-quantities/python-quantities.git
14-
- python setup.py install
15-
# - coverage run --source exdir -m py.test -s --doctest-glob='*.rst'
16-
# - coverage report
9+
noarch: python
10+
script: python setup.py install
11+
1712
requirements:
1813
build:
1914
- python
@@ -22,7 +17,6 @@ requirements:
2217
run:
2318
- python
2419
- setuptools
25-
- pip
2620
- numpy
2721
- scipy
2822
- ruamel_yaml
@@ -33,13 +27,22 @@ test:
3327
- pytest-benchmark
3428
- h5py
3529
- six
30+
- coverage
31+
- codecov
32+
- sphinx
33+
- quantities
34+
3635
source_files:
3736
- tests
37+
- docs
3838
imports:
3939
- exdir
4040
commands:
4141
- python -c "import exdir; print(exdir.__version__)"
42-
- pytest -s
42+
- coverage run --source tests -m py.test -s
43+
- coverage report
44+
- codecov
45+
- cd docs ; make doctest
4346

4447
about:
4548
home: https://github.com/CINPLA/exdir/

.travis.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,10 @@ python:
44
# - "3.5" # NOTE an issue with pathlib.resolve breaks our tests on 3.5
55
- "3.6"
66
install:
7-
- source libs/travis-conda-scripts/scripts/config.sh
87
- bash -ex libs/travis-conda-scripts/scripts/travis_install.sh
9-
before_script:
10-
# this is for running test coverage on travis
11-
# - pip install numpy
12-
# - pip install git+https://github.com/python-quantities/python-quantities.git
13-
# - pip install pytest pyyaml coverage codecov
14-
- python setup.py install
158
script:
16-
# TODO run coverage in meta.yaml instead
17-
# - coverage run --source exdir -m py.test -s --doctest-glob='*.rst'
18-
# - coverage report
199
- source libs/travis-conda-scripts/scripts/config.sh
2010
- bash -ex libs/travis-conda-scripts/scripts/build.sh
21-
after_success:
22-
- codecov
2311
deploy:
2412
- provider: script
2513
skip_cleanup: true

docs/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import os
2525
import re
2626
import sys
27+
# import exdir
2728
sys.path.insert(0, os.path.abspath("../"))
28-
import exdir
2929

3030
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
3131
if not on_rtd: # only import and set the theme if we're building docs locally
@@ -93,14 +93,14 @@
9393
# built documents.
9494
#
9595
# The full version, including alpha/beta/rc tags.
96-
release = exdir.__version__.replace("v", "")
97-
print("Release", release)
98-
# The short X.Y version.
99-
version = release
100-
result = re.match(r"\d+\.\d+\.?\d*", release)
101-
if result:
102-
version = result.group()
103-
print("Version", version)
96+
# release = exdir.__version__.replace("v", "")
97+
# print("Release", release)
98+
# # The short X.Y version.
99+
# version = release
100+
# result = re.match(r"\d+\.\d+\.?\d*", release)
101+
# if result:
102+
# version = result.group()
103+
# print("Version", version)
104104

105105
# The language for content autogenerated by Sphinx. Refer to documentation
106106
# for a list of supported languages.

docs/environment.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
channels:
2-
- conda-forge
3-
- cinpla
2+
- conda-forge
3+
44
dependencies:
5-
- exdir
6-
- python=3.5
5+
- python=3.5
6+
- setuptools
7+
- numpy
8+
- scipy
9+
- ruamel_yaml

environment.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

libs/travis-conda-scripts/.gitrepo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
[subrepo]
77
remote = [email protected]:CINPLA/travis-conda-scripts.git
88
branch = master
9-
commit = 0187a2302604816237e3b3a86959aa8696b9a121
10-
parent = ed78a1487be8d1d28e9aa739a46f78cd7d4e042c
9+
commit = 02e37ccf390b322ad9b876d49674d1e605313740
10+
parent = 1ddd49fa7c04f124bfa5f4e1717e974c19ad0f58
1111
cmdver = 0.3.0

libs/travis-conda-scripts/scripts/config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export GIT_TAG=$(git describe --always --tags --abbrev=0)
55
export TAG_AND_TRAVIS_BUILD=${GIT_TAG}_b${TRAVIS_BUILD_NUMBER}
66
export TAG_TRAVIS_BUILD_AND_COMMIT=${TAG_AND_TRAVIS_BUILD}_g${TRAVIS_COMMIT}
77
export CONDA_BLD_PATH=/tmp/conda-bld
8-
export PACKAGE=$(conda build . --output --python "$TRAVIS_PYTHON_VERSION" --old-build-string)
8+
export PACKAGE=$(conda build . --output --old-build-string --python "$TRAVIS_PYTHON_VERSION" 2> conda-errors.log | tail -1)
99
export EXTRA_CONDA_CHANNELS="-c defaults -c conda-forge -c cinpla"
1010
export GIT_STRING=${GIT_TAG}
1111
if [ -z $TRAVIS_TAG ]; then
@@ -21,3 +21,5 @@ echo TAG_AND_TRAVIS_BUILD $TAG_AND_TRAVIS_BUILD
2121
echo TAG_TRAVIS_BUILD_AND_COMMIT $TAG_TRAVIS_BUILD_AND_COMMIT
2222
echo PACKAGE $PACKAGE
2323
echo CONDA_CHANNELS $EXTRA_CONDA_CHANNELS
24+
echo conda-errors:
25+
cat conda-errors.log

libs/travis-conda-scripts/scripts/travis_install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ else
44
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
55
fi
66
bash miniconda.sh -b -p $HOME/miniconda
7+
export PATH="$HOME/miniconda/bin:$PATH"
78
hash -r
89
conda config --set always_yes yes --set changeps1 no
910
conda update -q conda

libs/travis-conda-scripts/scripts/upload.sh

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,14 @@ if [ -z "$1" ]; then
44
exit
55
fi
66
if [ $TRAVIS_TEST_RESULT -eq 0 ]; then
7-
echo "Package name $PACKAGE"
8-
conda convert "$PACKAGE" --platform win-64 -o packages
9-
conda convert "$PACKAGE" --platform osx-64 -o packages
10-
conda convert "$PACKAGE" --platform linux-64 -o packages
11-
cd packages
127
LABEL=${2:-main}
138

14-
echo "Uploading source platform to anaconda with anaconda upload..."
15-
set +x # hide token
16-
anaconda -t "$CONDA_UPLOAD_TOKEN" upload -u "$1" --force "$PACKAGE" -l "$LABEL"
17-
set -x
18-
for os in $(ls); do
19-
cd $os
20-
for package in $(ls); do
21-
echo "Uploading $package to anaconda with anaconda upload..."
22-
set +x # hide token
23-
anaconda -t "$CONDA_UPLOAD_TOKEN" upload -u "$1" --force "$package" -l "$LABEL"
24-
set -x
25-
done
26-
cd ..
9+
for TARBALL in $CONDA_BLD_PATH/noarch/*.tar.bz2; do
10+
echo "Uploading $TARBALL to anaconda with anaconda upload..."
11+
set +x # hide token
12+
anaconda -t "$CONDA_UPLOAD_TOKEN" upload -u "$1" --force "$TARBALL" -l "$LABEL"
13+
set -x
2714
done
28-
cd ..
2915
echo "Upload command complete!"
3016
else
3117
echo "Upload cancelled due to failed test."

0 commit comments

Comments
 (0)