Skip to content

Commit

Permalink
Merge pull request #2 from MolSSI/travis
Browse files Browse the repository at this point in the history
Setting up Travis-CI, codecov, PyUp
  • Loading branch information
emarinri authored Sep 26, 2019
2 parents 2810915 + b9f79ad commit ec9b858
Show file tree
Hide file tree
Showing 20 changed files with 801 additions and 291 deletions.
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,90 @@
# -*- mode: gitignore; -*-

# Other
*.vscode
*.swp
scratch/

## emacs: https://github.com/github/gitignore/blob/master/Global/Emacs.gitignore
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data
## end of emacs

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

## macOS useful to ignore https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
*.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
## end of macOS

# C extensions
*.so

Expand Down Expand Up @@ -70,6 +147,15 @@ instance/
# Sphinx documentation
docs/_build/

# IntelliJ Idea family of suites
.idea
*.iml
## File-based project format:
*.ipr
*.iws
## mpeltonen/sbt-idea plugin
.idea_modules/

# PyBuilder
target/

Expand Down
64 changes: 64 additions & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# configure updates globally
# default: all
# allowed: all, insecure, False
update: insecure

# configure dependency pinning globally
# default: True
# allowed: True, False
pin: False

# set the default branch
# default: empty, the default branch on GitHub
# branch: dev

# update schedule
# default: empty
# allowed: "every day", "every week", ..
schedule: "every week on monday"

# search for requirement files
# default: True
# allowed: True, False
search: False

# Specify requirement files by hand, default is empty
# default: empty
# allowed: list
requirements:
- requirements_install.txt:
# update insecure only
update: insecure
pin: False
- requirements.txt:
# update all dependencies and pin them
update: all
pin: True
- requirements_dev.txt:
# update insecure only
update: insecure
pin: False

# add a label to pull requests, default is not set
# requires private repo permissions, even on public repos
# default: empty
# label_prs: update

# assign users to pull requests, default is not set
# requires private repo permissions, even on public repos
# default: empty
# assignees:
# - carl
# - carlsen

# configure the branch prefix the bot is using
# default: pyup-
# branch_prefix: pyup/

# set a global prefix for PRs
# default: empty
# pr_prefix: "Bug #12345"

# allow to close stale PRs
# default: True
close_prs: True
121 changes: 74 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,78 @@
language: python

# Run jobs on container-based infrastructure, can be overridden per job

matrix:
include:
# Extra includes for OSX since python language is not available by default on OSX
- os: osx
language: generic
env: PYTHON_VER=3.6
- os: osx
language: generic
env: PYTHON_VER=3.7


- os: linux
language: generic # No need to set Python version since its conda
env: PYTHON_VER=3.6
- os: linux
language: generic
env: PYTHON_VER=3.7


before_install:
# Additional info about the build
- uname -a
- df -h
- ulimit -a

# Install the Python environment
- source devtools/travis-ci/before_install.sh
- python -V

- uname -a
- df -h
- ulimit -a
- source devtools/travis-ci/before_install.sh
- python -V
install:

# Create test environment for package
- python devtools/scripts/create_conda_env.py -n=test -p=$PYTHON_VER devtools/conda-envs/test_env.yaml
# Activate the test environment
- conda activate test
# Build and install package
- python setup.py develop --no-deps


script:
- pytest -v --cov=reference_handler reference_handler/tests/

- python devtools/scripts/create_conda_env.py -n=test -p=$PYTHON_VER devtools/conda-envs/test_env.yaml
- conda activate test
- pip install -e .
- conda list
- pip freeze
matrix:
fast_finish: true
notifications:
email: false

after_success:
- codecov
email: false
stages:
- lint
- test
- deploy
jobs:
include:
- stage: lint
name: Check formatting of code for PEP-8
os: linux
language: generic
env: PYTHON_VER=3.7
script:
- flake8 reference_handler
- yapf --diff --recursive reference_handler
- stage: test
name: Tests on MacOS Python 3.6
script:
- pytest -v reference_handler/tests/
os: osx
language: generic
env: PYTHON_VER=3.6
- stage: test
name: Tests on MacOS Python 3.7
script:
- pytest -v reference_handler/tests/
os: osx
language: generic
env: PYTHON_VER=3.7
- stage: test
name: Tests on Linux Python 3.6
script:
- pytest -v reference_handler/tests/
os: linux
language: generic
env: PYTHON_VER=3.6
- stage: test
name: Tests and coverage on Linux Python 3.7
script:
- pytest -v --cov=reference_handler reference_handler/tests/
after_success:
- codecov
os: linux
language: generic
env: PYTHON_VER=3.7
- stage: deploy
name: Deploy to PyPi
if: tag IS present
dist: xenial
python: 3.7
script: skip
deploy:
provider: pypi
distributions: sdist bdist_wheel
skip_existing: true
on:
condition: "$TRAVIS_OS_NAME = linux"
repo: molssi/reference_handler
tags: true
user: seamm
password:
secure: mmfK4KCLK2yxP2hgxTsNGlegjU+CpfxZrqqQXo0YbMgZzcC4aEBMK1hw6v68GEMlnU2GuT3Zxqfem0sK0ILTJfsjagh459Yd+SJzsvVZGOiBFGN1a6n1eCS2fr7tY8C5UzIVCJGg2mDpJolHs8vYN4tVFASP0E3WHf/d1ysN+ht8Bmq6M1U3/0qz9AD8tlI+DRHQO2IcyZzFsJADpqWK9VPGJmMJGxnDYeKdqWM9NbI+vhZLMcUn0FSJwlRBZGPqc4x80cJxJeOCyWpb/Fy2xDJCqyfWKqgbmE27QcAPeI4tBgqmxNY3azcGe12TeiIJ20OJyiyfdjAMPrmOXesY9mkFn/Jb1bRXdEb40kBVSI4B0iOYKbI0/MH8/Hu9dhYIIp0Th/Kupqx+WQrgXsv5aeKzUBoyxF+jfOb99CvZ4r8Cuk2GTdOnl8Q5BInKD+HogN75fHBlf9tYnBieeWOaeEZbr2VDmeCL+3jp8ok+38jFKdjTDKFilRBI9OWd0CG3eqS/pKEDzf1E+q6q3fjQeePFwmSOnLTDamVvghwaWRs1pZbMFhZFK1/CVCcxc4F9Wp1BOWp/aNvaNFERmMKvJ4K/cVIoroIzW+sBypiAYZbftBCAHwy9AH8r9TjuA1hzM1Hdsbjr1u7axWyoWdG3o8t4H50WAa2s/Qmx0vxVdKk=
1 change: 1 addition & 0 deletions .yapfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packmol_step/_version.py
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@ clean-test: ## remove test and coverage artifacts
find . -name '.pytype' -exec rm -fr {} +

lint: ## check style with yapf
yapf --diff --recursive reference_handler tests
flake8 reference_handler tests
yapf --diff --recursive reference_handler
flake8 reference_handler

flake: ## check the style with flake8
flake8 reference_handler tests
flake8 reference_handler reference_handler/tests

format: ## reformat with with yapf and isort
yapf --recursive --in-place reference_handler tests
#isort --recursive --atomic reference_handler tests
yapf --recursive --in-place reference_handler

typing: ## check typing
pytype reference_handler_ff_util
# mypy -p reference_handler_ff_util

test: ## run tests quickly with the default Python
pytest
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
reference_handler
==============================
[//]: # (Badges)
[![Travis Build Status](https://travis-ci.org/REPLACE_WITH_OWNER_ACCOUNT/reference_handler.png)](https://travis-ci.org/REPLACE_WITH_OWNER_ACCOUNT/reference_handler)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/REPLACE_WITH_APPVEYOR_LINK/branch/master?svg=true)](https://ci.appveyor.com/project/REPLACE_WITH_OWNER_ACCOUNT/reference_handler/branch/master)
[![codecov](https://codecov.io/gh/REPLACE_WITH_OWNER_ACCOUNT/reference_handler/branch/master/graph/badge.svg)](https://codecov.io/gh/REPLACE_WITH_OWNER_ACCOUNT/reference_handler/branch/master)
[![Travis Build Status](https://travis-ci.org/molssi/reference_handler.png)](https://travis-ci.org/molssi/reference_handler)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/REPLACE_WITH_APPVEYOR_LINK/branch/master?svg=true)](https://ci.appveyor.com/project/molssi/reference_handler/branch/master)
[![codecov](https://codecov.io/gh/molssi/reference_handler/branch/master/graph/badge.svg)](https://codecov.io/gh/molssi/reference_handler/branch/master)

A Python package that creates a consolidated list of references (BibTex, RIS) of scientific material
used in a Python package.
Expand Down
9 changes: 6 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ dependencies:
- pip

# Testing
- coverage
- flake8
- pytest
- pytest-cov
- codecov
- pytest-runner

# Pip-only installs
#- pip:
# - codecov
- pip:
# Testing
- yapf

2 changes: 1 addition & 1 deletion reference_handler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

# Add imports here
from .reference_handler import Reference_Handler
from .reference_handler import Reference_Handler # noqa: F401

# Handle versioneer
from ._version import get_versions
Expand Down
Loading

0 comments on commit ec9b858

Please sign in to comment.