Skip to content

Commit

Permalink
Merge pull request #99 from ZLLentz/noarch
Browse files Browse the repository at this point in the history
MNT: noarch, python 3.7+, linkage script cleanup
  • Loading branch information
ZLLentz authored Jan 9, 2021
2 parents 841a175 + 890baf0 commit 8e84e83
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 197 deletions.
104 changes: 40 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,48 @@
language: python
sudo: false
version: ~> 1.0

env:
global:
- OFFICIAL_REPO="pcdshub/pcdsdaq"
- secure: "BrDoqAjZeFnW5vGe3AtVSHgXWb16DthqQwiefN+lNhcllQw6WXFx4PvpwNGM1PI3voLg6YJM/9mOrVOk5nSYjh65DQmlJ6jNX1ezJoI30hURhykoXJNrKr25JTF54GhgMgk/KiR3fhGQYJgpXUxPxYPBt3PvXd7uY0cMIYCFAW8gwrupVfHbPo1zGbxHzxysBlxpQQAclBj4pVMIX5chkVM/Yviv72mEkyoKPJpQgCCn7CstQSLhHtM+EK+bHpqjIk37cnGi/lTZYxlmrMjEeU/UXxL2/y2uA43W8sdsD2vCEiMcexjD2cqhjOr1Qn1zZgzHchSapkHsju1KHdCOeiWE/yV9Ni/fteb4doKnSQOIY/hqofqkyETFfNarOa9Zsm5i03QUyFNub2hr6k6lWRal5MaOErGiUAVlKCYj5KBe/AYHC758rmm1YIukYXKn2cBfApt+sCSc50WGEqjiT1iiUBD6dCP1p4Skd6RpLbwIL6f9THvzAqpQRJpZAtOmffIKpQ0+RUjEQF9UlwPKOgpdAOw2XrK0asrgfh9goiiB7QrzJ0GPa0Wy7BTfi3ksNXskdnatGAFAJiRPBkmcshRFrLx4UIlLx5pTW88G2T0yYXNGi+mEQHXY9rcozZJlVIESYSL1NgRV5aW/gfYC4hqmFfB+93MFG5g05HJ/dlA="

matrix:
include:
- python: 3.6
env: BUILD_DOCS=1
- python: 3.7
dist: xenial
sudo: true
allow_failures:
- python: 3.7
dist: xenial
sudo: true
# enable the usage of versions menu which allow versioning of the docs
# pages and not only the master branch
- DOCTR_VERSIONS_MENU="1"
# Dependency files used to build the documentation (space separated)
- DOCS_REQUIREMENTS="docs-requirements.txt dev-requirements.txt requirements.txt"
# Options to be passed to flake8 for package linting. Usually this is just
# the package name but you can enable other flake8 options via this config
- PYTHON_LINT_OPTIONS="pcdsdaq"

# The name of the conda package
- CONDA_PACKAGE="pcdsdaq"
# The folder containing the conda recipe (meta.yaml)
- CONDA_RECIPE_FOLDER="conda-recipe"
# Extra dependencies needed to run the tests which are not included
# at the recipe and dev-requirements.txt. E.g. PyQt
- CONDA_EXTRAS="pip"
# Requirements file with contents for tests dependencies
- CONDA_REQUIREMENTS="dev-requirements.txt"

install:
- sudo apt-get update
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no --set channel_priority strict
- conda install conda-build anaconda-client
- conda update -q conda conda-build
- conda config --add channels pcds-tag
- conda config --add channels conda-forge
# Useful for debugging any issues with conda
- conda info -a
# Test conda build
- conda build -q conda-recipe --python $TRAVIS_PYTHON_VERSION --output-folder bld-dir
- conda config --add channels "file://`pwd`/bld-dir"
# Create test environment
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pcdsdaq --file dev-requirements.txt
- source activate test-environment
# Test uninstall, reinstall linker scripts
- conda uninstall pcdsdaq
- conda install pcdsdaq
# Extra dependencies needed to run the test with Pip (similar to
# CONDA_EXTRAS) but for pip
- PIP_EXTRAS=""

script:
- coverage run run_tests.py
- coverage report -m
- flake8 pcdsdaq
# Make sure the links folder was created
- ls "$(dirname $(which python))/../lib/python3.6/site-packages/pcdsdaq/pydaq_links/links"
# Build docs
- set -e
- |
if [[ -n "$DOCTR_DEPLOY_ENCRYPTION_KEY_PCDSHUB_PCDSDAQ" && $BUILD_DOCS ]]; then
conda install --file docs-requirements.txt
pushd docs
make html
popd
doctr deploy . --built-docs docs/build/html --deploy-branch-name gh-pages
fi
jobs:
allow_failures:
- name: "Python 3.6 - PIP"

after_success:
- codecov
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == $OFFICIAL_REPO && $TRAVIS_BRANCH == $TRAVIS_TAG && $TRAVIS_TAG != '' && $CONDA_UPLOAD_TOKEN_TAG != '' ]]; then
export ANACONDA_API_TOKEN=$CONDA_UPLOAD_TOKEN_TAG
anaconda upload bld-dir/linux-64/*.tar.bz2
fi
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == $OFFICIAL_REPO && $TRAVIS_BRANCH == 'master' && $TRAVIS_TAG == '' && $CONDA_UPLOAD_TOKEN_DEV != '' ]]; then
export ANACONDA_API_TOKEN=$CONDA_UPLOAD_TOKEN_DEV
anaconda upload bld-dir/linux-64/*.tar.bz2
fi
import:
# This import enables a set of standard python jobs including:
# - Build
# - Anaconda Package Build
# - Tests
# - Python Linter
# - Package Linter
# - Documentation
# - Python 3.6 - PIP based
# - Python 3.6, 3.7 & 3.8 - Conda base
# - Deploy
# - Documentation using doctr
# - Conda Package - uploaded to pcds-dev and pcds-tag
# - PyPI
- pcdshub/pcds-ci-helpers:travis/shared_configs/standard-python-conda.yml
17 changes: 9 additions & 8 deletions bin/pcdsdaq_lib_setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@ fi

OS_VER="$(uname -r | rev | cut -d . -f 2 | rev)"
if [ "${OS_VER}" = el6 ]; then
OS_DIR=x86_64-linux
OS_DIR=x86_64-linux-opt
elif [ "${OS_VER}" = el7 ]; then
OS_DIR=x86_64-rhel7
OS_DIR=x86_64-rhel7-opt
fi

if [ -z "${OS_DIR}" ]; then
echo "OS must be rhel6 or rhel7"
else
# Expand pythonpath with correct link
pcdsdaq_init="$(python -c 'import pcdsdaq; print(pcdsdaq.__file__)')"
pydaq_links="$(dirname ${pcdsdaq_init})/pydaq_links/links/${HUTCH}/${OS_DIR}"
export PYTHONPATH="${PYTHONPATH}:${pydaq_links}"
# Add pydaq, pydcb, pyami to the python path
export PYTHONPATH="${PYTHONPATH}:${DAQREL}/pdsapp/lib/${OS_DIR}"

# Add pyami to the python path
export PYTHONPATH="${PYTHONPATH}:${AMIREL}/ami/lib/${OS_DIR}"

# Add ami libraries
for dir in ami gsl qt
do
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${AMIREL}/${dir}/lib/${OS_DIR}-opt"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${AMIREL}/${dir}/lib/${OS_DIR}"
done

# Add daq libraries
for dir in pdsapp psalg pds pdsdata offlinedb
do
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DAQREL}/${dir}/lib/${OS_DIR}-opt"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DAQREL}/${dir}/lib/${OS_DIR}"
done
fi
7 changes: 3 additions & 4 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ source:

build:
number: 1
noarch: python

requirements:
build:
- python {{PY_VER}}*,>=3
- python >=3.6
- setuptools

run:
- python {{PY_VER}}*,>=3
- python >=3.6
- ophyd >=1.5.0
- bluesky >=1.6.0
- toolz
- matplotlib <3

test:
imports:
Expand Down
3 changes: 0 additions & 3 deletions conda-recipe/post-link.sh

This file was deleted.

3 changes: 0 additions & 3 deletions conda-recipe/pre-unlink.sh

This file was deleted.

34 changes: 0 additions & 34 deletions pcdsdaq/pydaq_links/generate_linker

This file was deleted.

80 changes: 0 additions & 80 deletions pcdsdaq/pydaq_links/linker

This file was deleted.

1 change: 0 additions & 1 deletion pcdsdaq/pydaq_links/unlinker

This file was deleted.

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ophyd
bluesky
toolz

0 comments on commit 8e84e83

Please sign in to comment.