├── pycydemo ├── tests │ ├── __init__.py │ └── test_extension.py ├── __init__.py └── extension.pyx ├── .coveragerc ├── .pycodestylerc ├── .pydocstylerc ├── doc └── Makefile ├── .cardboardlint.yml ├── .gitignore ├── tools ├── conda.recipe │ └── meta.yaml ├── travis_before_install.sh ├── appveyor │ └── run_with_env.cmd ├── gitversion.py └── template.py ├── setup.py ├── README.rst ├── .appveyor.yml ├── LICENSE ├── .travis.yml └── .pylintrc /pycydemo/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pycydemo/__init__.py: -------------------------------------------------------------------------------- 1 | """Pycydemo package.""" 2 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | plugins = Cython.Coverage 3 | -------------------------------------------------------------------------------- /.pycodestylerc: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | max-line-length=100 3 | -------------------------------------------------------------------------------- /.pydocstylerc: -------------------------------------------------------------------------------- 1 | [pydocstyle] 2 | add_ignore=D100,D101,D102,D103,D104,D105 3 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Stub to mimic sphinx doc build 2 | html: 3 | mkdir -p _build/html 4 | echo "It works!" >> _build/html/index.html 5 | touch _build/html/.nojekyll 6 | -------------------------------------------------------------------------------- /pycydemo/extension.pyx: -------------------------------------------------------------------------------- 1 | # Needed for coverage analysis: 2 | # cython: linetrace=True 3 | 4 | import numpy as np 5 | 6 | __all__ = ['some_function'] 7 | 8 | 9 | def some_function(int a, int b): 10 | return (a + b) % 42 11 | -------------------------------------------------------------------------------- /.cardboardlint.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | - import: 3 | packages: ['cellcutoff'] 4 | - namespace: 5 | filefilter: ['- */__init__.py', '- */test_*.py', '- *setup.py', '- tools/*', 6 | '+ *.py', '+ *.pyx'] 7 | - pylint: 8 | - pycodestyle: 9 | - pydocstyle: 10 | config: .pycodestylerc 11 | - whitespace: 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | build/ 10 | dist/ 11 | *.egg-info/ 12 | 13 | # Sphinx documentation 14 | doc/_build/ 15 | 16 | pycydemo/extension.c 17 | pycydemo/version.py 18 | 19 | #PyCharm 20 | .idea 21 | -------------------------------------------------------------------------------- /pycydemo/tests/test_extension.py: -------------------------------------------------------------------------------- 1 | """Unit tests for pycydemo.""" 2 | 3 | from pycydemo.extension import some_function 4 | from nose.tools import assert_equal 5 | 6 | 7 | def test_some_function(): 8 | assert_equal(some_function(0, 0), 0) 9 | assert_equal(some_function(0, 42), 0) 10 | assert_equal(some_function(41, 2), 1) 11 | assert_equal(some_function(1, 2), 3) 12 | -------------------------------------------------------------------------------- /tools/conda.recipe/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | version: "{{ PROJECT_VERSION }}" 3 | name: 'pycydemo' 4 | 5 | source: 6 | path: ../../ 7 | 8 | build: 9 | script_env: 10 | - PROJECT_VERSION 11 | number: 0 12 | script: python setup.py install 13 | 14 | requirements: 15 | build: 16 | - {{ compiler('c') }} 17 | - {{ compiler('cxx') }} 18 | host: 19 | - python 20 | - numpy 21 | - cython >=0.24.1 22 | - setuptools 23 | - nose 24 | run: 25 | - numpy 26 | test: 27 | requires: 28 | - python 29 | - nose 30 | commands: 31 | - conda inspect linkages pycydemo 32 | - nosetests -v --detailed-errors pycydemo 33 | 34 | about: 35 | description: Demo python+cython project 36 | home: https://github.com/theochem/python-cython-ci-example 37 | license: MIT 38 | 39 | extra: 40 | recipe-maintainers: Toon Verstraelen 41 | -------------------------------------------------------------------------------- /tools/travis_before_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ev 4 | 5 | # Install miniconda to avoid compiling scipy 6 | if test -e $HOME/miniconda/bin ; then 7 | echo "miniconda already installed." 8 | else 9 | echo "Installing miniconda." 10 | rm -rf $HOME/miniconda 11 | mkdir -p $HOME/download 12 | if [[ -d $HOME/download/miniconda.sh ]] ; then rm -rf $HOME/download/miniconda.sh ; fi 13 | if [ "${MYCONDAPY}" = "2.7" ]; then 14 | if [ "${TRAVIS_OS_NAME}" = "linux" ]; then 15 | wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh; 16 | else 17 | wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh; 18 | fi; 19 | else 20 | if [ "${TRAVIS_OS_NAME}" = "linux" ]; then 21 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh; 22 | else 23 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh; 24 | fi; 25 | fi 26 | 27 | bash $HOME/download/miniconda.sh -b -p $HOME/miniconda 28 | fi 29 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Package build and install script.""" 3 | 4 | import numpy as np 5 | from setuptools import setup, Extension 6 | import Cython.Build 7 | 8 | 9 | def get_version(): 10 | """Load the version from version.py, without importing it. 11 | 12 | This function assumes that the last line in the file contains a variable defining the 13 | version string with single quotes. 14 | 15 | """ 16 | try: 17 | with open('pycydemo/version.py', 'r') as f: 18 | return f.read().split('=')[-1].replace('\'', '').strip() 19 | except IOError: 20 | return "0.0.0a1" 21 | 22 | 23 | def get_readme(): 24 | """Load README.rst for display on PyPI.""" 25 | with open('README.rst') as f: 26 | return f.read() 27 | 28 | 29 | setup( 30 | name='pycydemo', 31 | version=get_version(), 32 | description='Demo python+cython project', 33 | long_description=get_readme(), 34 | author='Toon Verstraelen', 35 | author_email='Toon.Verstraelen@UGent.be', 36 | url='https://github.com/theochem/python-cython-ci-example', 37 | cmdclass={'build_ext': Cython.Build.build_ext}, 38 | package_dir={'pycydemo': 'pycydemo'}, 39 | packages=['pycydemo', 'pycydemo.tests'], 40 | ext_modules=[Extension( 41 | 'pycydemo.extension', 42 | sources=['pycydemo/extension.pyx'], 43 | include_dirs=[np.get_include()], 44 | )], 45 | zip_safe=False, 46 | setup_requires=['numpy>=1.0', 'cython>=0.24.1'], 47 | install_requires=['numpy>=1.0', 'nose>=0.11', 'cython>=0.24.1'], 48 | ) 49 | -------------------------------------------------------------------------------- /tools/appveyor/run_with_env.cmd: -------------------------------------------------------------------------------- 1 | :: To build extensions for 64 bit Python 3, we need to configure environment 2 | :: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: 3 | :: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) 4 | :: 5 | :: To build extensions for 64 bit Python 2, we need to configure environment 6 | :: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: 7 | :: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) 8 | :: 9 | :: 32 bit builds do not require specific environment configurations. 10 | :: 11 | :: Note: this script needs to be run with the /E:ON and /V:ON flags for the 12 | :: cmd interpreter, at least for (SDK v7.0) 13 | :: 14 | :: More details at: 15 | :: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows 16 | :: http://stackoverflow.com/a/13751649/163740 17 | :: 18 | :: Author: Olivier Grisel 19 | :: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ 20 | @ECHO OFF 21 | 22 | SET COMMAND_TO_RUN=%* 23 | SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows 24 | 25 | SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" 26 | IF %MAJOR_PYTHON_VERSION% == "2" ( 27 | SET WINDOWS_SDK_VERSION="v7.0" 28 | ) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( 29 | SET WINDOWS_SDK_VERSION="v7.1" 30 | ) ELSE ( 31 | ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" 32 | EXIT 1 33 | ) 34 | 35 | IF "%PLATFORM%"=="X64" ( 36 | ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture 37 | SET DISTUTILS_USE_SDK=1 38 | SET MSSdk=1 39 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% 40 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release 41 | ECHO Executing: %COMMAND_TO_RUN% 42 | call %COMMAND_TO_RUN% || EXIT 1 43 | ) ELSE ( 44 | ECHO Using default MSVC build environment for 32 bit architecture 45 | ECHO Executing: %COMMAND_TO_RUN% 46 | call %COMMAND_TO_RUN% || EXIT 1 47 | ) 48 | -------------------------------------------------------------------------------- /tools/gitversion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Get the version string from the git tag.""" 3 | 4 | from __future__ import print_function 5 | 6 | import subprocess 7 | 8 | 9 | __all__ = ['get_gitversion'] 10 | 11 | 12 | TEMPLATES = { 13 | 'python': """\ 14 | \"""Do not edit this file because it will be overwritten before packaging. 15 | 16 | The output of git describe was: {git_describe} 17 | \""" 18 | __version__ = '{git_tag_version}'""", 19 | 'cmake': """\ 20 | # This file is automatically generated. Changes will be overwritten before packaging. 21 | set(GIT_DESCRIBE "{git_describe}") 22 | set(GIT_TAG_VERSION "{git_tag_version}") 23 | set(GIT_TAG_SOVERSION "{git_tag_soversion}") 24 | set(GIT_TAG_VERSION_MAJOR "{git_tag_version_major}") 25 | set(GIT_TAG_VERSION_MINOR "{git_tag_version_minor}") 26 | set(GIT_TAG_VERSION_PATCH "{git_tag_version_patch}")"""} 27 | 28 | 29 | def get_gitversion(): 30 | """Return a conda-compatible version string derived from git describe --tags.""" 31 | git_describe = subprocess.check_output(['git', 'describe', '--tags']).strip() 32 | version_words = git_describe.decode('utf-8').strip().split('-') 33 | version = version_words[0] 34 | if len(version_words) > 1: 35 | version += '.post' + version_words[1] 36 | return version, git_describe 37 | 38 | 39 | def main(): 40 | """Print the version derived from ``git describe --tags`` in a useful format.""" 41 | from argparse import ArgumentParser 42 | parser = ArgumentParser('Determine version string from `git describe --tags`') 43 | parser.add_argument('output', choices=['plain', 'python', 'cmake'], default='plain', nargs='?', 44 | help='format of the output.') 45 | args = parser.parse_args() 46 | version, git_describe = get_gitversion() 47 | if args.output == 'plain': 48 | print(version) 49 | else: 50 | major, minor, patch = version.split('.', 2) 51 | print(TEMPLATES[args.output].format( 52 | git_describe=git_describe, 53 | git_tag_version=version, 54 | git_tag_soversion='.'.join([major, minor]), 55 | git_tag_version_major=major, 56 | git_tag_version_minor=minor, 57 | git_tag_version_patch=patch, 58 | )) 59 | 60 | 61 | if __name__ == '__main__': 62 | main() 63 | -------------------------------------------------------------------------------- /tools/template.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | template_dict = { 4 | "TPL_ANACONDA_TOKEN": "j9gWsoi5KIJexLobwzyB8U8gWDRxvUgoEgQINevzCdc6tdNr2ZeVBM5Q7Xw5kCb2o0MvF4V7+xMLBOuvMjXS7dLMJ0Rnh2gCpojnXNzNzXpL/PaG7dTE+CKEDjSEzs2qNDsHGoFXx3lTrACm7Ol6Bl4OnppRpKUwJNDvJI0PUvJqNlBCZgecorzVm4ucvBcloFEmy7WF7WbRHBoTQrdujq4ziZ5c5F3vFWvNmHGQqU94FqroLBz05ie4gHgMaRip0l9TVOYEyw9qBEFHssPpux4yd0aijpvZnrS/ze4XvT8JkY9eGyU3M+OS7A+aq1wBC/lhZnx8M/Aygz3hfn2b8ZGGDsskGCrBKVjSwLzm+ZLb1tHugnYaI3WRYLFWK5+4cadVTgBTgkyJQMeX61lx/IwL3YcrhsBfneI/6vAu2DmGUoeiDhd4DpVq7Y+FBZ1F188HZpMmVlsFaTKrHJL/aUiEJd0d0ooN8cJbOJSCr4IlN5036cNUQsUu8Kwr6ncwifIq2sx0eM0dmUemP9hUYd069tW9gwapYt9E7aTlHQpxwdr8chS0vWsl+OZvdmiR0xD7vMHzaGtmG8YvSH7o7sr7z0DIxIKJBVzd93tgC1b9oZrySuSEQByZqsia9ZYBTCT3aJ2MfqbYXL6dZxpFnxrH8ntrBBh4KIdcZAzGTXU=", 5 | "TPL_GITHUB_TOKEN": "dG5ClYlMT/EADB7tdCsuM/8blSopvYu9CLCnKMtRasbeZ8EjuVIpq8v+p+vbeg7KFIuFqFuFjsfTKVOOWhzIYhNMvrsGpWl8HjVcDx4PhIooEix465efF99bFMQudd7FpZ1HHuNyXhsmrbx+xVdieEMfJVH5yX8e2dCQu01hbPEbCVzaFnez6iOOPcACqLaoZg7ofZ7F/mc2wJPMfzouGKotl7FhSsaoIJ3g0cwJ8BF4kxmM4J6WYjGV4MfGf3JTK8pUwkfqRPigpZITchT48sS6yT0qnCNHs6Nic/RHB0cJlHFRlA2Gpi7OafVIQXBPaQpLxidZ7oN6JH0ztfq/RYIfrCaGNWjd6G7PfPPJbtT5lQlRGF7FOX/U6syy7pzSe+sFiHmlEZKYKc6jW+xwCXYOXoPB0ikjC9HMjI2jyVCYZzAcfdJThDDYU0IdgNn99ejbmBXefzQMLJAZLf+JTbRpxjh93KM7Xv46pn8cirRaT3Sun/g2U24/K63NN8jJIuxrzSsH9EURSg27J9O65Z3M0r98ru9IGau4j9ge0FD+K/YiOiOSnm/mNkpmiuap5vhX0C5vT54QCgIPeP1ERRyuYI+V2tzIUSUYgGmOt/zX+QF2qBy0ZUiyDXgA9awhQupxEbbXsLA/XOuidV1ODxqob193dGFKLayhwsJR78M=", 6 | "TPL_PYPI_PASSWORD": "Qh6JLMS4EklyRXNptUwim9ZcJvJxGfR0Lmd+W9tLaQ9d+c11wr376pZDzzbaGv7fM/tscWRYaCk8qVveSzGbLHi3Fy7NTFDIpXCpuV1ZSgCEyTmQLtoJPLK6fZc/iNOZdg5vk2QDn7Mk11xWoPwekagMsl0+IOAZu+JEGBw14pTrqMAXkLL7xI34dGfuJaOAQHo7GprU2bIgV0vcJIV3wgifo79ouZGVLWoS9iJkJ73coKji86LN/QV8PGqDp/aqNwdQCu0WUz1WuG6DBCQMtdohKROpu97HFhvdPICIM7d58Pyi1JBVrjSlKHw/Sz8ThCDPRBP2UZnjc5xn7IA5zuAeOLxaXbdxdLGMvKYa897+gNXRgMRTryVo4O/9IbkYIPGM2fHAarhyDzuTjyjIhG1fwi13iWz6ub02hrHWnXNJ6eGwXdtqS0o0uu4RZ1SrAxjYxrPNbLgq29Df/ywyYqJl0aZ2hAbswwUM6GQip4n3V/gkKjlDo6BSM4Ja/TyIOyq+m7u40NfYuRCkkKio3Khg//YUCySmLZ/7Cup7LSP++U/Cewd6ycWafj/y0yfSEo9x5UzK74ilq3UGK684NXlw8A9Cp1PZa+Y0Ka+M2ycE1L9c6d19F5VqeQqivces1lmG59Zv2EJ/CkSw9n/Oyg/3IrxZ06KpunpOwVRiwAk=", 7 | "PROJECT_NAME": "pycydemo", 8 | "GITHUB_REPO_NAME": "theochem/python-cython-ci-example", 9 | } 10 | 11 | import sys 12 | from string import Template 13 | 14 | template_fn = sys.argv[1] 15 | 16 | with open(template_fn) as fh: 17 | l = fh.read() 18 | 19 | t = Template(l) 20 | s = t.safe_substitute(**template_dict) 21 | with open(".travis.yml", "w") as fh: 22 | fh.write( 23 | "#\n# THIS FILE IS AUTOGENERATED. DO NOT EDIT DIRECTLY. CHANGES IN \".travis.yml.tpl\" INSTEAD.\n#\n") 24 | fh.write(s) 25 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://travis-ci.org/theochem/python-cython-ci-example.svg?branch=master 2 | :target: https://travis-ci.org/theochem/python-cython-ci-example 3 | .. image:: https://ci.appveyor.com/api/projects/status/ora4yr7kot2ffr8x/branch/master?svg=true 4 | :target: https://ci.appveyor.com/project/theochem-travis-uploader/python-cython-ci-example 5 | .. image:: https://anaconda.org/theochem/pycydemo/badges/version.svg 6 | :target: https://anaconda.org/theochem/pycydemo 7 | .. image:: https://codecov.io/gh/theochem/python-cython-ci-example/branch/master/graph/badge.svg 8 | :target: https://codecov.io/gh/theochem/python-cython-ci-example 9 | 10 | Demo project for building and deploying a Python+Cython packages with AppVeyor 11 | CI and Travis CI. 12 | 13 | This is based on a similar demo: https://github.com/theochem/python-appveyor-conda-example 14 | Additional features: 15 | 16 | - Less auxiliary scripts, making more use of recent Travis and AppVeyor built-in 17 | features. This should be easier to understand and adapt. 18 | - Conda packages for win-32, win-64, linux-64, osx-64. 19 | - Python 2.7, 3.5, 3.6. 20 | - Upload to alpha, beta and main channels on Anaconda cloud. 21 | - Github stable and prerelease source release. 22 | - PyPI source release. Stable releases only stable only, because others are not 23 | safe to upload to PyPI. 24 | - Documentation deployment to gh-pages (Travis). 25 | - CI Testing after installation on Travis or AppVeyor instance. 26 | - Code coverage with codecov.io. 27 | 28 | 29 | The CI machinery in this project is "easily" used in other projects. The following files/parts need to be copied over (and modified): 30 | 31 | - The version stuff from ``setup.py`` and ``pycydemo/__init__.py``. This extracts the version from the latest git tag. Ideally, no other places in your project should define (another) version. Also mind the following in ``setup.py``: 32 | - ``zip_safe=False`` (for nosetests and conda packaging) See https://github.com/nose-devs/nose/issues/1057 33 | - Order of importing ``setuptools`` and ``Cython`` matters. 34 | - Copy ``tools/conda.recipe/meta.yaml`` and change the package name and dependencies. 35 | - Copy ``.travis.yml`` and update the ``env`` block, including new encrypted tokens and passwords. 36 | - For windows testing: copy ``.appveyor.yml`` and update the ``env`` block, including new encrypted tokens and passwords. 37 | 38 | Making tokens: 39 | 40 | - Github: https://github.com/settings/tokens (scopes repo:public_repo) 41 | - Anaconda: https://anaconda.org/theochem/settings/access Scopes: 42 | - api:read (Allow read access to the API site) 43 | - api:write (Allow write access to the API site) 44 | 45 | Encrypting tokens (Github, Anaconda) and passwords (PyPI) on Travis-CI: 46 | 47 | - Basic documentation: https://docs.travis-ci.com/user/encryption-keys/ 48 | - Best usage is to just run `travis encrypt` without arguments. Then enter a variable and content in the form ``VAR=pass``. Press enter. Press Ctrl-d. 49 | - Copy the encrypted stuff to the ``env`` section of ``.travis.yml`` 50 | 51 | Encrypting tokens (Anaconda) and passwords on AppVeyor: 52 | 53 | - Use https://ci.appveyor.com/tools/encrypt 54 | - Only enter the password or token itself, so only the ``pass`` part of ``VAR=pass``. The ``VAR`` is still visible in .appveyor.tml``. 55 | - Copy to ``.appveyor.yml``. 56 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | global: 3 | # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the 4 | # /E:ON and /V:ON options are not enabled in the batch script intepreter 5 | # See: http://stackoverflow.com/a/13751649/163740 6 | CMD_IN_ENV: 'cmd /E:ON /V:ON /C .\tools\appveyor\run_with_env.cmd' 7 | ANACONDA_TOKEN: 8 | secure: hNorKC0ZG2MdYxyGDiHwVrsB45vIupeSNVpdJ5q0jdEzdyCPi/Y7n1zMjYyqZ2co 9 | PROJECT_NAME: pycydemo 10 | GITHUB_REPO_NAME: theochem/python-cython-ci-example 11 | 12 | matrix: 13 | - PYTHON_VERSION: 2.7 14 | CONDA: C:\Miniconda 15 | 16 | - PYTHON_VERSION: 3.6 17 | CONDA: C:\Miniconda36 18 | 19 | version: '{build}' 20 | image: Visual Studio 2015 21 | 22 | # For testing only... 23 | #skip_non_tags: true 24 | 25 | platform: 26 | - x86 27 | - x64 28 | 29 | branches: 30 | only: 31 | - master 32 | 33 | init: 34 | - ps: if ($Env:PLATFORM -eq "x64") { $Env:CONDA = "${Env:CONDA}-x64" } 35 | - ps: Write-Host $Env:PYTHON_VERSION 36 | - ps: Write-Host $Env:CONDA 37 | - ps: Write-Host $Env:GITHUB_REPO_NAME 38 | - ps: Write-Host $Env:PLATFORM 39 | - ps: Write-Host $Env:APPVEYOR_REPO_TAG 40 | - ps: Write-Host $Env:APPVEYOR_REPO_TAG_NAME 41 | - ps: Write-Host $Env:APPVEYOR_REPO_NAME 42 | 43 | install: 44 | # Make sure the compiler is accessible 45 | - '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%' 46 | 47 | # Load the conda root environment, configure and install some packages 48 | - '"%CONDA%\Scripts\activate.bat"' 49 | - conda config --set always_yes yes --set changeps1 no 50 | - conda update -q conda 51 | - conda install conda-build anaconda-client numpy cython 52 | # Install codecov tool for uploading coverage reports 53 | - pip install codecov coverage 54 | # Show conda info for debugging 55 | - conda info -a 56 | 57 | # Set the version info from the git tag 58 | - git fetch origin --tags 59 | - python tools\\gitversion.py > version.txt 60 | - set /P PROJECT_VERSION= %PROJECT_NAME%\\version.py 62 | 63 | build: false 64 | 65 | test_script: 66 | # Build the package 67 | - "%CMD_IN_ENV% conda build tools/conda.recipe" 68 | 69 | # Install the package 70 | - conda install --use-local %PROJECT_NAME% 71 | 72 | # Run the tests outside the source tree. 73 | - pushd "%HOMEPATH%" && (nosetests %PROJECT_NAME% -v --detailed-errors --with-coverage --cover-package=%PROJECT_NAME% --cover-tests --cover-erase --cover-inclusive --cover-branches --cover-xml & popd) 74 | 75 | after_test: 76 | # Copy the conda build to the home dir, such that it can be registerd as an artifact 77 | - move %CONDA%\conda-bld . 78 | 79 | # Upload coverage reports 80 | - 'codecov -f "%HOMEPATH%\coverage.xml"' 81 | 82 | artifacts: 83 | # Files to be uploaded 84 | - path: 'conda-bld\win-*\*.tar.bz2' 85 | 86 | on_success: 87 | # Upload to anaconda, with the correct label derived from the version tag. 88 | # This is virtually impossible with a normal dos batch script... 89 | # It also contains an incredibly clunky way to avoid build failure when anaconda writes 90 | # something harmless to stderr. The normal way does not work! 91 | # & anaconda $parameters 2>&1 92 | # Powershell should be called Powerhell! 93 | - ps: 94 | if (($Env:APPVEYOR_REPO_TAG -eq "true") -and 95 | ($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) { 96 | $tar_glob = ".\conda-bld\win-*\${Env:PYPKG}-${Env:APPVEYOR_REPO_TAG_NAME}-*.tar.bz2"; 97 | Write-Host "tar_glob $tar_glob"; 98 | if ($Env:APPVEYOR_REPO_TAG_NAME -like "*a*") { 99 | $anaconda_label = "alpha" 100 | } elseif ($Env:APPVEYOR_REPO_TAG_NAME -like "*b*") { 101 | $anaconda_label = "beta" 102 | } else { 103 | $anaconda_label = "main" 104 | }; 105 | Write-Host "anaconda_label $anaconda_label"; 106 | $parameters = '-t', "$Env:ANACONDA_TOKEN", 'upload', "$tar_glob", '-l', 107 | "$anaconda_label", '--force', '--no-progress'; 108 | & cmd /c 'anaconda 2>&1' $parameters; 109 | } 110 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | matrix: 3 | - MYCONDAPY=2.7 4 | - MYCONDAPY=3.6 5 | - MYCONDAPY=3.7 6 | global: 7 | - secure: j9gWsoi5KIJexLobwzyB8U8gWDRxvUgoEgQINevzCdc6tdNr2ZeVBM5Q7Xw5kCb2o0MvF4V7+xMLBOuvMjXS7dLMJ0Rnh2gCpojnXNzNzXpL/PaG7dTE+CKEDjSEzs2qNDsHGoFXx3lTrACm7Ol6Bl4OnppRpKUwJNDvJI0PUvJqNlBCZgecorzVm4ucvBcloFEmy7WF7WbRHBoTQrdujq4ziZ5c5F3vFWvNmHGQqU94FqroLBz05ie4gHgMaRip0l9TVOYEyw9qBEFHssPpux4yd0aijpvZnrS/ze4XvT8JkY9eGyU3M+OS7A+aq1wBC/lhZnx8M/Aygz3hfn2b8ZGGDsskGCrBKVjSwLzm+ZLb1tHugnYaI3WRYLFWK5+4cadVTgBTgkyJQMeX61lx/IwL3YcrhsBfneI/6vAu2DmGUoeiDhd4DpVq7Y+FBZ1F188HZpMmVlsFaTKrHJL/aUiEJd0d0ooN8cJbOJSCr4IlN5036cNUQsUu8Kwr6ncwifIq2sx0eM0dmUemP9hUYd069tW9gwapYt9E7aTlHQpxwdr8chS0vWsl+OZvdmiR0xD7vMHzaGtmG8YvSH7o7sr7z0DIxIKJBVzd93tgC1b9oZrySuSEQByZqsia9ZYBTCT3aJ2MfqbYXL6dZxpFnxrH8ntrBBh4KIdcZAzGTXU= 8 | - secure: dG5ClYlMT/EADB7tdCsuM/8blSopvYu9CLCnKMtRasbeZ8EjuVIpq8v+p+vbeg7KFIuFqFuFjsfTKVOOWhzIYhNMvrsGpWl8HjVcDx4PhIooEix465efF99bFMQudd7FpZ1HHuNyXhsmrbx+xVdieEMfJVH5yX8e2dCQu01hbPEbCVzaFnez6iOOPcACqLaoZg7ofZ7F/mc2wJPMfzouGKotl7FhSsaoIJ3g0cwJ8BF4kxmM4J6WYjGV4MfGf3JTK8pUwkfqRPigpZITchT48sS6yT0qnCNHs6Nic/RHB0cJlHFRlA2Gpi7OafVIQXBPaQpLxidZ7oN6JH0ztfq/RYIfrCaGNWjd6G7PfPPJbtT5lQlRGF7FOX/U6syy7pzSe+sFiHmlEZKYKc6jW+xwCXYOXoPB0ikjC9HMjI2jyVCYZzAcfdJThDDYU0IdgNn99ejbmBXefzQMLJAZLf+JTbRpxjh93KM7Xv46pn8cirRaT3Sun/g2U24/K63NN8jJIuxrzSsH9EURSg27J9O65Z3M0r98ru9IGau4j9ge0FD+K/YiOiOSnm/mNkpmiuap5vhX0C5vT54QCgIPeP1ERRyuYI+V2tzIUSUYgGmOt/zX+QF2qBy0ZUiyDXgA9awhQupxEbbXsLA/XOuidV1ODxqob193dGFKLayhwsJR78M= 9 | - secure: Qh6JLMS4EklyRXNptUwim9ZcJvJxGfR0Lmd+W9tLaQ9d+c11wr376pZDzzbaGv7fM/tscWRYaCk8qVveSzGbLHi3Fy7NTFDIpXCpuV1ZSgCEyTmQLtoJPLK6fZc/iNOZdg5vk2QDn7Mk11xWoPwekagMsl0+IOAZu+JEGBw14pTrqMAXkLL7xI34dGfuJaOAQHo7GprU2bIgV0vcJIV3wgifo79ouZGVLWoS9iJkJ73coKji86LN/QV8PGqDp/aqNwdQCu0WUz1WuG6DBCQMtdohKROpu97HFhvdPICIM7d58Pyi1JBVrjSlKHw/Sz8ThCDPRBP2UZnjc5xn7IA5zuAeOLxaXbdxdLGMvKYa897+gNXRgMRTryVo4O/9IbkYIPGM2fHAarhyDzuTjyjIhG1fwi13iWz6ub02hrHWnXNJ6eGwXdtqS0o0uu4RZ1SrAxjYxrPNbLgq29Df/ywyYqJl0aZ2hAbswwUM6GQip4n3V/gkKjlDo6BSM4Ja/TyIOyq+m7u40NfYuRCkkKio3Khg//YUCySmLZ/7Cup7LSP++U/Cewd6ycWafj/y0yfSEo9x5UzK74ilq3UGK684NXlw8A9Cp1PZa+Y0Ka+M2ycE1L9c6d19F5VqeQqivces1lmG59Zv2EJ/CkSw9n/Oyg/3IrxZ06KpunpOwVRiwAk= 10 | - PROJECT_NAME=pycydemo 11 | - GITHUB_REPO_NAME=theochem/python-cython-ci-example 12 | - CONDA_PKG_NAME_PY=pycydemo 13 | - PYPI_LOGIN=theochem 14 | 15 | #### 16 | # EVERYTHING BELOW THIS LINE WILL BE COPIED INTO OTHER YMLs 17 | #### 18 | # v1.0 19 | 20 | # Do not use Travis Python to save some time. 21 | language: generic 22 | os: 23 | - linux 24 | - osx 25 | dist: trusty 26 | sudo: false 27 | 28 | matrix: 29 | # We only test on Linux with one specific Python version, unless we make a release. All 30 | # other cases are allowed to fail and will exit early. With the fast_finish option, 31 | # travis will send a status update to github as soon as the non-allowed-to-fail has 32 | # finished. This speeds up testing in PRs. 33 | # 34 | # This is not ideal. It would be better to run just one item from the build matrix when 35 | # not preparing a release. This is not possible on Travis. There are several tickets on 36 | # travis-ci related to this limitation. 37 | # 38 | # https://github.com/travis-ci/travis-ci/issues/7451 39 | # https://github.com/travis-ci/travis-ci/issues/7149 40 | # https://github.com/travis-ci/travis-ci/issues/2778 41 | # ... 42 | fast_finish: true 43 | allow_failures: 44 | - os: osx 45 | 46 | 47 | cache: 48 | directories: 49 | - $HOME/download # Sufficient to add miniconda.sh to TRAVIS cache. 50 | - $HOME/miniconda # Add the installation to TRAVIS cache. 51 | 52 | before_cache: 53 | - if ! [[ $TRAVIS_TAG ]]; then rm -rf $HOME/miniconda/conda-bld; fi 54 | - rm -rf $HOME/miniconda/locks $HOME/miniconda/pkgs $HOME/miniconda/var $HOME/miniconda/conda-meta/history 55 | - pip uninstall -y cardboardlint # Cardboardlint always installs even if no changes are made. 56 | 57 | branches: 58 | only: 59 | - master 60 | - /^[0-9]+\.[0-9]+(\.[0-9]+)?([ab][0-9]+)?$/ 61 | 62 | before_install: 63 | - if ! [[ $TRAVIS_TAG || $TRAVIS_OS_NAME == "linux" && $MYCONDAPY == "3.6" ]]; then exit 0; fi 64 | # Get miniconda. Take the right version, so re-installing python is hopefully not needed. 65 | - if test -e $HOME/miniconda/bin; then 66 | echo "miniconda already installed."; 67 | else 68 | echo "Installing miniconda."; 69 | rm -rf $HOME/miniconda; 70 | mkdir -p $HOME/download; 71 | if [[ -d $HOME/download/miniconda.sh ]]; then rm -rf $HOME/download/miniconda.sh; fi; 72 | if [ "${MYCONDAPY}" = "2.7" ]; then 73 | if [ "${TRAVIS_OS_NAME}" = "linux" ]; then 74 | wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh; 75 | else 76 | wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh; 77 | fi; 78 | else 79 | if [ "${TRAVIS_OS_NAME}" = "linux" ]; then 80 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh; 81 | else 82 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh; 83 | fi; 84 | fi; 85 | bash $HOME/download/miniconda.sh -b -p $HOME/miniconda; 86 | fi 87 | 88 | 89 | install: 90 | - source $HOME/miniconda/bin/activate 91 | - hash -r 92 | # Configure conda and get a few essentials 93 | - conda config --set always_yes yes 94 | - conda config --add channels theochem 95 | - conda install -q conda conda-build conda-verify 96 | 97 | # Set the version info from the git tag 98 | - git fetch origin --tags && 99 | export PROJECT_VERSION=$(python tools/gitversion.py) && 100 | python tools/gitversion.py python > ${PROJECT_NAME}/version.py; 101 | 102 | # Get a list of all build and runtime dependencies. 103 | # This should become easier, without the copy to conda.recipe.ugly. 104 | - conda render -f tools/conda.recipe/rendered.yaml tools/conda.recipe 105 | - CONDA_DEPENDENCIES=$(python -c "from yaml import load; 106 | req1 = load(open('tools/conda.recipe/rendered.yaml'))['requirements']; 107 | deps = req1['build'] + req1['run'] + req1['host']; 108 | print(' '.join(set(dep.split()[0] for dep in deps)))") 109 | 110 | # Get the right python version for building. This only does something for 3.5. 111 | # Install extra package needed to make things work. Most things can be listed as 112 | # dependencies on meta.yaml and setup.py, unless setup.py already imports them. 113 | # Install conda tools for packaging and uploading 114 | - conda install -q python=${MYCONDAPY} anaconda-client numpy setuptools cython 115 | - if ! [[ $TRAVIS_TAG ]]; then 116 | conda install -q ${CONDA_DEPENDENCIES}; 117 | pip install --upgrade pylint codecov coverage pycodestyle pydocstyle; 118 | fi 119 | # Show conda info for debugging 120 | - conda info -a 121 | 122 | # Install the latest cardboardlinter 123 | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 124 | pip install --upgrade git+https://github.com/theochem/cardboardlint.git@master#egg=cardboardlint; 125 | fi 126 | 127 | script: 128 | # Static linting 129 | # -------------- 130 | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 131 | cardboardlinter --refspec $TRAVIS_BRANCH -f static; 132 | fi 133 | 134 | # Unit tests and dynamic linting 135 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | - if [[ $TRAVIS_TAG ]]; then 137 | conda build -q tools/conda.recipe; 138 | else 139 | python setup.py build_ext -i --define CYTHON_TRACE_NOGIL && 140 | nosetests ${PROJECT_NAME} 141 | -v --detailed-errors --with-coverage --cover-package=${PROJECT_NAME} 142 | --cover-tests --cover-inclusive --cover-branches && 143 | coverage xml -i && 144 | 145 | if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 146 | cardboardlinter --refspec $TRAVIS_BRANCH -f 'dynamic'; 147 | fi 148 | fi 149 | 150 | # Make CPP and PY source package for github deployment 151 | - if [[ $TRAVIS_TAG ]]; then 152 | python setup.py sdist; 153 | fi 154 | 155 | # Some other stuff 156 | # ---------------- 157 | 158 | # Compile documentation 159 | - if [[ -e doc ]]; then 160 | (cd doc; make html); 161 | fi 162 | 163 | after_success: 164 | # Upload the coverage analysis 165 | - codecov -f coverage.xml 166 | 167 | before_deploy: 168 | # Try to set some env vars to configure deployment. 169 | # Please keep the following lines. They will be used again as soon as it is supported on 170 | # travis. See https://github.com/travis-ci/dpl/issues/613 171 | #- export IS_PRERELEASE=$(python -c 'import os; tt=os.environ["TRAVIS_TAG"]; print("true" if ("a" in tt or "b" in tt) else "false")') 172 | #- echo ${IS_PRERELEASE} 173 | - export ANACONDA_LABEL=$(python -c 'import os; tt=os.environ["TRAVIS_TAG"]; print("dev" if ("a" in tt) else ("test" if "b" in tt else "main"))') 174 | - echo ${ANACONDA_LABEL} 175 | 176 | # In deployment, the env var TRAVIS_TAG contains the name of the current version, if any. 177 | deploy: 178 | - provider: releases 179 | skip_cleanup: true 180 | api_key: ${GITHUB_TOKEN} 181 | file: dist/${PROJECT_NAME}-${TRAVIS_TAG}.tar.gz 182 | on: 183 | repo: ${GITHUB_REPO_NAME} 184 | tags: true 185 | condition: "$MYCONDAPY == 3.6 && $TRAVIS_OS_NAME == linux && $TRAVIS_TAG == *[ab]*" 186 | prerelease: true 187 | 188 | - provider: releases 189 | skip_cleanup: true 190 | api_key: ${GITHUB_TOKEN} 191 | file: dist/${PROJECT_NAME}-${TRAVIS_TAG}.tar.gz 192 | on: 193 | repo: ${GITHUB_REPO_NAME} 194 | tags: true 195 | condition: "$MYCONDAPY == 3.6 && $TRAVIS_OS_NAME == linux && $TRAVIS_TAG != *[ab]*" 196 | prerelease: false 197 | 198 | - provider: script 199 | skip_cleanup: true 200 | script: anaconda -t $ANACONDA_TOKEN upload --force -l ${ANACONDA_LABEL} ${HOME}/miniconda/conda-bld/*/${PROJECT_NAME}-*.tar.bz2 201 | on: 202 | repo: ${GITHUB_REPO_NAME} 203 | tags: true 204 | 205 | #- provider: pypi 206 | # skip_cleanup: true 207 | # user: ${PYPI_LOGIN} 208 | # password: ${PYPI_PASSWD} 209 | # on: 210 | # repo: ${GITHUB_REPO_NAME} 211 | # tags: true 212 | # condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 3.6 && $TRAVIS_OS_NAME == linux" 213 | 214 | - provider: pages 215 | skip_cleanup: true 216 | github_token: ${GITHUB_TOKEN} 217 | project_name: ${PROJECT_NAME} 218 | local_dir: doc/_build/html 219 | on: 220 | repo: ${GITHUB_REPO_NAME} 221 | condition: "-e doc && $TRAVIS_TAG != *[ab]* && $MYCONDAPY == 3.6 && $TRAVIS_OS_NAME == linux" 222 | tags: true 223 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | # A comma-separated list of package or module names from where C extensions may 4 | # be loaded. Extensions are loading into the active Python interpreter and may 5 | # run arbitrary code 6 | extension-pkg-whitelist=numpy,pycydemo.extension 7 | 8 | # Add files or directories to the blacklist. They should be base names, not 9 | # paths. 10 | ignore=CVS 11 | 12 | # Add files or directories matching the regex patterns to the blacklist. The 13 | # regex matches against base names, not paths. 14 | ignore-patterns= 15 | 16 | # Python code to execute, usually for sys.path manipulation such as 17 | # pygtk.require(). 18 | #init-hook= 19 | 20 | # Use multiple processes to speed up Pylint. 21 | jobs=1 22 | 23 | # List of plugins (as comma separated values of python modules names) to load, 24 | # usually to register additional checkers. 25 | load-plugins= 26 | 27 | # Pickle collected data for later comparisons. 28 | persistent=yes 29 | 30 | # Specify a configuration file. 31 | #rcfile= 32 | 33 | # Allow loading of arbitrary C extensions. Extensions are imported into the 34 | # active Python interpreter and may run arbitrary code. 35 | unsafe-load-any-extension=no 36 | 37 | 38 | [MESSAGES CONTROL] 39 | 40 | # Only show warnings with the listed confidence levels. Leave empty to show 41 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED 42 | confidence= 43 | 44 | # Disable the message, report, category or checker with the given id(s). You 45 | # can either give multiple identifiers separated by comma (,) or put this 46 | # option multiple times (only on the command line, not in the configuration 47 | # file where it should appear only once).You can also use "--disable=all" to 48 | # disable everything first and then reenable specific checks. For example, if 49 | # you want to run only the similarities checker, you can use "--disable=all 50 | # --enable=similarities". If you want to run only the classes checker, but have 51 | # no Warning level messages displayed, use"--disable=all --enable=classes 52 | # --disable=W" 53 | disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,too-many-arguments,too-many-locals,too-few-public-methods,len-as-condition,no-else-return 54 | 55 | # Enable the message, report, category or checker with the given id(s). You can 56 | # either give multiple identifier separated by comma (,) or put this option 57 | # multiple time (only on the command line, not in the configuration file where 58 | # it should appear only once). See also the "--disable" option for examples. 59 | enable= 60 | 61 | 62 | [REPORTS] 63 | 64 | # Python expression which should return a note less than 10 (10 is the highest 65 | # note). You have access to the variables errors warning, statement which 66 | # respectively contain the number of errors / warnings messages and the total 67 | # number of statements analyzed. This is used by the global evaluation report 68 | # (RP0004). 69 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 70 | 71 | # Template used to display messages. This is a python new-style format string 72 | # used to format the message information. See doc for all details 73 | #msg-template= 74 | 75 | # Set the output format. Available formats are text, parseable, colorized, json 76 | # and msvs (visual studio).You can also give a reporter class, eg 77 | # mypackage.mymodule.MyReporterClass. 78 | output-format=text 79 | 80 | # Tells whether to display a full report or only the messages 81 | reports=no 82 | 83 | # Activate the evaluation score. 84 | score=yes 85 | 86 | 87 | [REFACTORING] 88 | 89 | # Maximum number of nested blocks for function / method body 90 | max-nested-blocks=5 91 | 92 | 93 | [MISCELLANEOUS] 94 | 95 | # List of note tags to take in consideration, separated by a comma. 96 | notes=FIXME,XXX,TODO 97 | 98 | 99 | [TYPECHECK] 100 | 101 | # List of decorators that produce context managers, such as 102 | # contextlib.contextmanager. Add to this list to register other decorators that 103 | # produce valid context managers. 104 | contextmanager-decorators=contextlib.contextmanager 105 | 106 | # List of members which are set dynamically and missed by pylint inference 107 | # system, and so shouldn't trigger E1101 when accessed. Python regular 108 | # expressions are accepted. 109 | generated-members= 110 | 111 | # Tells whether missing members accessed in mixin class should be ignored. A 112 | # mixin class is detected if its name ends with "mixin" (case insensitive). 113 | ignore-mixin-members=yes 114 | 115 | # This flag controls whether pylint should warn about no-member and similar 116 | # checks whenever an opaque object is returned when inferring. The inference 117 | # can return multiple potential results while evaluating a Python object, but 118 | # some branches might not be evaluated, which results in partial inference. In 119 | # that case, it might be useful to still emit no-member and other checks for 120 | # the rest of the inferred objects. 121 | ignore-on-opaque-inference=yes 122 | 123 | # List of class names for which member attributes should not be checked (useful 124 | # for classes with dynamically set attributes). This supports the use of 125 | # qualified names. 126 | ignored-classes=optparse.Values,thread._local,_thread._local,numpy 127 | 128 | # List of module names for which member attributes should not be checked 129 | # (useful for modules/projects where namespaces are manipulated during runtime 130 | # and thus existing member attributes cannot be deduced by static analysis. It 131 | # supports qualified module names, as well as Unix pattern matching. 132 | ignored-modules=numpy 133 | 134 | # Show a hint with possible names when a member name was not found. The aspect 135 | # of finding the hint is based on edit distance. 136 | missing-member-hint=yes 137 | 138 | # The minimum edit distance a name should have in order to be considered a 139 | # similar match for a missing member name. 140 | missing-member-hint-distance=1 141 | 142 | # The total number of similar names that should be taken in consideration when 143 | # showing a hint for a missing member. 144 | missing-member-max-choices=1 145 | 146 | 147 | [LOGGING] 148 | 149 | # Logging modules to check that the string format arguments are in logging 150 | # function parameter format 151 | logging-modules=logging 152 | 153 | 154 | [SIMILARITIES] 155 | 156 | # Ignore comments when computing similarities. 157 | ignore-comments=yes 158 | 159 | # Ignore docstrings when computing similarities. 160 | ignore-docstrings=yes 161 | 162 | # Ignore imports when computing similarities. 163 | ignore-imports=no 164 | 165 | # Minimum lines number of a similarity. 166 | min-similarity-lines=4 167 | 168 | 169 | [SPELLING] 170 | 171 | # Spelling dictionary name. Available dictionaries: none. To make it working 172 | # install python-enchant package. 173 | spelling-dict= 174 | 175 | # List of comma separated words that should not be checked. 176 | spelling-ignore-words= 177 | 178 | # A path to a file that contains private dictionary; one word per line. 179 | spelling-private-dict-file= 180 | 181 | # Tells whether to store unknown words to indicated private dictionary in 182 | # --spelling-private-dict-file option instead of raising a message. 183 | spelling-store-unknown-words=no 184 | 185 | 186 | [FORMAT] 187 | 188 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 189 | expected-line-ending-format= 190 | 191 | # Regexp for a line that is allowed to be longer than the limit. 192 | ignore-long-lines=^\s*(# )??$ 193 | 194 | # Number of spaces of indent required inside a hanging or continued line. 195 | indent-after-paren=4 196 | 197 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 198 | # tab). 199 | indent-string=' ' 200 | 201 | # Maximum number of characters on a single line. 202 | max-line-length=100 203 | 204 | # Maximum number of lines in a module 205 | max-module-lines=1000 206 | 207 | # List of optional constructs for which whitespace checking is disabled. `dict- 208 | # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. 209 | # `trailing-comma` allows a space between comma and closing bracket: (a, ). 210 | # `empty-line` allows space-only lines. 211 | no-space-check=trailing-comma,dict-separator 212 | 213 | # Allow the body of a class to be on the same line as the declaration if body 214 | # contains single statement. 215 | single-line-class-stmt=no 216 | 217 | # Allow the body of an if to be on the same line as the test if there is no 218 | # else. 219 | single-line-if-stmt=no 220 | 221 | 222 | [VARIABLES] 223 | 224 | # List of additional names supposed to be defined in builtins. Remember that 225 | # you should avoid to define new builtins when possible. 226 | additional-builtins= 227 | 228 | # Tells whether unused global variables should be treated as a violation. 229 | allow-global-unused-variables=yes 230 | 231 | # List of strings which can identify a callback function by name. A callback 232 | # name must start or end with one of those strings. 233 | callbacks=cb_,_cb 234 | 235 | # A regular expression matching the name of dummy variables (i.e. expectedly 236 | # not used). 237 | dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ 238 | 239 | # Argument names that match this expression will be ignored. Default to name 240 | # with leading underscore 241 | ignored-argument-names=_.*|^ignored_|^unused_ 242 | 243 | # Tells whether we should check for unused import in __init__ files. 244 | init-import=no 245 | 246 | # List of qualified module names which can have objects that can redefine 247 | # builtins. 248 | redefining-builtins-modules=six.moves,future.builtins 249 | 250 | 251 | [BASIC] 252 | 253 | # Naming hint for argument names 254 | argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 255 | 256 | # Regular expression matching correct argument names 257 | argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 258 | 259 | # Naming hint for attribute names 260 | attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 261 | 262 | # Regular expression matching correct attribute names 263 | attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 264 | 265 | # Bad variable names which should always be refused, separated by a comma 266 | bad-names=foo,bar,baz,toto,tutu,tata 267 | 268 | # Naming hint for class attribute names 269 | class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 270 | 271 | # Regular expression matching correct class attribute names 272 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 273 | 274 | # Naming hint for class names 275 | class-name-hint=[A-Z_][a-zA-Z0-9]+$ 276 | 277 | # Regular expression matching correct class names 278 | class-rgx=[A-Z_][a-zA-Z0-9]+$ 279 | 280 | # Naming hint for constant names 281 | const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 282 | 283 | # Regular expression matching correct constant names 284 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 285 | 286 | # Minimum line length for functions/classes that require docstrings, shorter 287 | # ones are exempt. 288 | docstring-min-length=-1 289 | 290 | # Naming hint for function names 291 | function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 292 | 293 | # Regular expression matching correct function names 294 | function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 295 | 296 | # Good variable names which should always be accepted, separated by a comma 297 | good-names=i,j,k,_,f 298 | 299 | # Include a hint for the correct naming format with invalid-name 300 | include-naming-hint=no 301 | 302 | # Naming hint for inline iteration names 303 | inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ 304 | 305 | # Regular expression matching correct inline iteration names 306 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 307 | 308 | # Naming hint for method names 309 | method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 310 | 311 | # Regular expression matching correct method names 312 | method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 313 | 314 | # Naming hint for module names 315 | module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 316 | 317 | # Regular expression matching correct module names 318 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 319 | 320 | # Colon-delimited sets of names that determine each other's naming style when 321 | # the name regexes allow several styles. 322 | name-group= 323 | 324 | # Regular expression which should only match function or class names that do 325 | # not require a docstring. 326 | no-docstring-rgx=((^_)|(^test_)) 327 | 328 | # List of decorators that produce properties, such as abc.abstractproperty. Add 329 | # to this list to register other decorators that produce valid properties. 330 | property-classes=abc.abstractproperty 331 | 332 | # Naming hint for variable names 333 | variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 334 | 335 | # Regular expression matching correct variable names 336 | variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ 337 | 338 | 339 | [DESIGN] 340 | 341 | # Maximum number of arguments for function / method 342 | max-args=5 343 | 344 | # Maximum number of attributes for a class (see R0902). 345 | max-attributes=7 346 | 347 | # Maximum number of boolean expressions in a if statement 348 | max-bool-expr=5 349 | 350 | # Maximum number of branch for function / method body 351 | max-branches=12 352 | 353 | # Maximum number of locals for function / method body 354 | max-locals=15 355 | 356 | # Maximum number of parents for a class (see R0901). 357 | max-parents=7 358 | 359 | # Maximum number of public methods for a class (see R0904). 360 | max-public-methods=20 361 | 362 | # Maximum number of return / yield for function / method body 363 | max-returns=6 364 | 365 | # Maximum number of statements in function / method body 366 | max-statements=50 367 | 368 | # Minimum number of public methods for a class (see R0903). 369 | min-public-methods=2 370 | 371 | 372 | [IMPORTS] 373 | 374 | # Allow wildcard imports from modules that define __all__. 375 | allow-wildcard-with-all=no 376 | 377 | # Analyse import fallback blocks. This can be used to support both Python 2 and 378 | # 3 compatible code, which means that the block might have code that exists 379 | # only in one or another interpreter, leading to false positives when analysed. 380 | analyse-fallback-blocks=no 381 | 382 | # Deprecated modules which should not be used, separated by a comma 383 | deprecated-modules=regsub,TERMIOS,Bastion,rexec 384 | 385 | # Create a graph of external dependencies in the given file (report RP0402 must 386 | # not be disabled) 387 | ext-import-graph= 388 | 389 | # Create a graph of every (i.e. internal and external) dependencies in the 390 | # given file (report RP0402 must not be disabled) 391 | import-graph= 392 | 393 | # Create a graph of internal dependencies in the given file (report RP0402 must 394 | # not be disabled) 395 | int-import-graph= 396 | 397 | # Force import order to recognize a module as part of the standard 398 | # compatibility libraries. 399 | known-standard-library= 400 | 401 | # Force import order to recognize a module as part of a third party library. 402 | known-third-party=enchant 403 | 404 | 405 | [CLASSES] 406 | 407 | # List of method names used to declare (i.e. assign) instance attributes. 408 | defining-attr-methods=__init__,__new__,setUp 409 | 410 | # List of member names, which should be excluded from the protected access 411 | # warning. 412 | exclude-protected=_asdict,_fields,_replace,_source,_make 413 | 414 | # List of valid names for the first argument in a class method. 415 | valid-classmethod-first-arg=cls 416 | 417 | # List of valid names for the first argument in a metaclass class method. 418 | valid-metaclass-classmethod-first-arg=mcs 419 | 420 | 421 | [EXCEPTIONS] 422 | 423 | # Exceptions that will emit a warning when being caught. Defaults to 424 | # "Exception" 425 | overgeneral-exceptions=Exception 426 | --------------------------------------------------------------------------------