Skip to content

Commit

Permalink
Merge 3c55145 into e3dfafe
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Apr 23, 2019
2 parents e3dfafe + 3c55145 commit 7bb4ff9
Show file tree
Hide file tree
Showing 211 changed files with 12,470 additions and 46,154 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
.idea/vcs.xml
postgres*.log
.aiida_envs.yaml
aiida_workdir/
logfile
.ropeproject
_archive/
.ipynb_checkpoints/
databases/
31 changes: 20 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# Install pre-commit hooks via
# pre-commit install

# yapf = yet another python formatter
- repo: git://github.com/pre-commit/mirrors-yapf
sha: v0.22.0

# modernizer: make sure our code-base is Python 3 ready
#- repo: https://github.com/python-modernize/python-modernize.git
# sha: a234ce4e185cf77a55632888f1811d83b4ad9ef2
# hooks:
# - id: python-modernize
# exclude: ^docs/
# args:
# - --write
# - --nobackups

- repo: local
hooks:
# yapf = yet another python formatter
- id: yapf
name: yapf
entry: yapf
language: system
exclude: '^(aiida_crystal17/tests/)'

# prospector: collection of python linters
- repo: git://github.com/guykisel/prospector-mirror
sha: b27f281eb9398fc8504415d7fbdabf119ea8c5e1
hooks:
# prospector: collection of linters
- id: prospector
language: system
types: [file, python]
name: prospector
description: "This hook runs Prospector: https://github.com/landscapeio/prospector"
entry: prospector
exclude: '^(aiida_crystal17/tests/)|(examples/)'


- repo: local
hooks:
- id: version-number
name: Check version numbers
entry: python ./.travis-data/check_version.py
Expand Down
4 changes: 0 additions & 4 deletions .prospector.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

conda:
environment: docs/environment.yaml

python:
version: 3.6
install:
- method: pip
path: .
extra_requirements:
- docs

# default
# sphinx:
# builder: html
# configuration: conf.py
# fail_on_warning: true

8 changes: 4 additions & 4 deletions .travis-data/check_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Get version from python package
sys.path.insert(0, os.path.join(this_path, os.pardir))
import aiida_crystal17 # pylint: disable=wrong-import-position
import aiida_crystal17 # noqa
version = aiida_crystal17.__version__

if version != setup_content['version']:
Expand All @@ -29,6 +29,6 @@
sys.exit(1)

# Overwrite version in setup.json
#setup_content['version'] = version
#with open(setup_path, 'w') as f:
# json.dump(setup_content, f, indent=4, sort_keys=True)
# setup_content['version'] = version
# with open(setup_path, 'w') as f:
# json.dump(setup_content, f, indent=4, sort_keys=True)
114 changes: 66 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,89 @@
language: python
python:
- "2.7"

cache: pip

services:
- postgresql
- rabbitmq # required for aiida >= 1.0
- rabbitmq

addons:
postgresql: "9.5"

env:
matrix:
- TEST_TYPE: tests
TEST_AIIDA_BACKEND: django
MOCK_EXECUTABLES: true
PYPI_DEPLOY: true
- TEST_TYPE: tests
TEST_AIIDA_BACKEND: sqlalchemy
MOCK_EXECUTABLES: true
- TEST_TYPE: pre-commit
- TEST_TYPE: docs
READTHEDOCS: 'True'
# TODO for aiida v1 test pytest is failing on setup at present (dependency version clash?)
- TEST_TYPE="tests" AIIDA_BRANCH="develop" TEST_AIIDA_BACKEND="django" MOCK_EXECUTABLES=true
- TEST_TYPE="tests" AIIDA_BRANCH="develop" TEST_AIIDA_BACKEND="sqlalchemy" MOCK_EXECUTABLES=true
postgresql: "10.6"
apt:
packages:
- graphviz

matrix:
allow_failures:
- env: TEST_TYPE="tests" AIIDA_BRANCH="develop" TEST_AIIDA_BACKEND="django" MOCK_EXECUTABLES=true
- env: TEST_TYPE="tests" AIIDA_BRANCH="develop" TEST_AIIDA_BACKEND="sqlalchemy" MOCK_EXECUTABLES=true
include:
- python: 3.6
env: TEST_TYPE="code-style"
- python: 3.6
env: TEST_TYPE="version"
- python: 3.6
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="django" MOCK_CRY17_EXECUTABLES=true PYPI_DEPLOY=true
- python: 2.7
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="django" MOCK_CRY17_EXECUTABLES=true PYPI_DEPLOY=true
- python: 3.6
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="sqlalchemy" MOCK_CRY17_EXECUTABLES=true
- python: 3.6
env: TEST_TYPE="docs" READTHEDOCS="True"

# allow_failures:
# - env: TEST_TYPE="docs" READTHEDOCS="True"

install:
# Upgrade pip setuptools and wheel
- pip install -U pip wheel setuptools
- pip uninstall -y numpy
- pip install -e .[pre-commit,testing,docs]
- >
if [[ ! -z "${AIIDA_BRANCH}" ]]; then
cur_path="$(pwd)";
cd ..;
git clone --branch=${AIIDA_BRANCH} https://github.com/aiidateam/aiida_core.git;
cd aiida_core;
pip install -U -e .[testing];
cd "$cur_path";
fi
- pip install coveralls
- pip install -U pip wheel setuptools "reentry>=1.3.0"
- |
if [[ "$TEST_TYPE" == "code-style" ]]; then
pip install "flake8<3.8.0,>=3.7.0"
fi
- |
if [[ "$TEST_TYPE" == "pytest" ]]; then
pip uninstall -y numpy
pip install -e .[testing]
pip install coveralls
fi
- |
if [[ "$TEST_TYPE" == "docs" ]]; then
pip uninstall -y numpy
pip install -e .[docs]
url="https://github.com/jgm/pandoc/releases/tag/2.6"
path=$(curl -L $url | grep -o '/jgm/pandoc/releases/download/.*-amd64\.deb')
downloadUrl="https://github.com$path"
file=${path##*/}
wget $downloadUrl && sudo dpkg -i $file
fi
# - |
# if [[ ! -z "${AIIDA_BRANCH}" ]]; then
# cur_path="$(pwd)"
# cd ..
# git clone --branch=${AIIDA_BRANCH} https://github.com/aiidateam/aiida_core.git
# cd aiida_core
# pip install -U -e .
# cd "$cur_path"
# fi

before_script:
- reentry scan

script:
- >
if [[ "$TEST_TYPE" == "tests" ]]; then
if [[ ! -z "${AIIDA_BRANCH}" ]]; then
pytest -v aiida_crystal17 examples;
else
pytest -v --cov=aiida_crystal17 --cov=examples --cov-config .coveragerc --cov-report= aiida_crystal17 examples;
fi
- |
if [[ "$TEST_TYPE" == "pytest" ]]; then
pytest -v --cov=aiida_crystal17 --cov=examples --cov-config .coveragerc --cov-report= aiida_crystal17
fi
- |
if [[ "$TEST_TYPE" == "code-style" ]]; then
flake8 .
fi
- |
if [[ "$TEST_TYPE" == "docs" ]]; then
cd docs
make
fi
- >
if [[ "$TEST_TYPE" == "pre-commit" ]]; then
pre-commit install;
pre-commit run --all-files || ( git status --short; git diff ; exit 1 ) ;
- |
if [[ "$TEST_TYPE" == "version" ]]; then
python ./.travis-data/check_version.py
fi
- if [[ "$TEST_TYPE" == "docs" ]]; then cd docs; make; fi
after_success:
- coveralls
Expand Down
25 changes: 23 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
{
"editor.rulers": [80, 120],
"python.pythonPath": "/anaconda/envs/aiida_0_12_2_py27/bin/python",
"editor.rulers": [
80, 120
],
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/__pycache__": true,
"**/.ipynb_checkpoints": true,
"**/.pytest_cache": true,
"**/.eggs": true
},

"python.pythonPath": "/anaconda/envs/aiida-workshop/bin/python",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.unitTest.pyTestArgs": [
"aiida_crystal17"
],
"python.unitTest.unittestEnabled": false,
"python.unitTest.nosetestsEnabled": false,
"python.unitTest.pyTestEnabled": true,
"restructuredtext.preview.sphinx.disabled": true,
"restructuredtext.confPath": "${workspaceFolder}/docs/source"
}

0 comments on commit 7bb4ff9

Please sign in to comment.