diff --git a/.ci/appveyor/anaconda_upload.py b/.ci/appveyor/anaconda_upload.py deleted file mode 100644 index 733b706..0000000 --- a/.ci/appveyor/anaconda_upload.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import print_function - -import os -import sys -import subprocess -import traceback -import glob - - -def this_is_a_release(): - repo_tag = os.environ.get('APPVEYOR_REPO_TAG', 'false') - tag_name = os.environ.get('APPVEYOR_REPO_TAG_NAME', '') - - return repo_tag == 'true' and tag_name.startswith('v') - - -def conda_package_filename(recipe): - conda_build = ' '.join(['conda', 'build', '--output', recipe]) - try: - resp = subprocess.check_output(conda_build, shell=True) - except subprocess.CalledProcessError: - traceback.print_exc() - else: - file_to_upload = resp.strip().split()[-1] - - # (dirname, filename) = os.path.split(file_to_upload) - # try: - # file_to_upload = glob.glob(dirname + b'\\' + b'standard_names*.tar.bz2')[0] - # except IndexError: - # raise RuntimeError('{name}: not a file'.format(name=dirname)) - - if not os.path.isfile(file_to_upload): - raise RuntimeError('{name}: not a file'.format(name=file_to_upload)) - - return file_to_upload - - -def upload_to_anaconda_cloud(fname, channel='main'): - token = os.environ.get('ANACONDA_TOKEN', 'NOT_A_TOKEN') - anaconda_upload = ' '.join(['anaconda', '-t', token, 'upload', '--force', - '--user', 'csdms', '--channel', channel, - fname.decode('utf-8')]) - - print('Uploading {name} to {channel} channel'.format( - name=fname, channel=channel)) - - try: - subprocess.check_call(anaconda_upload, shell=True) - except subprocess.CalledProcessError: - traceback.print_exc() - - -def main(): - print('Using python: {prefix}'.format(prefix=sys.prefix)) - - if this_is_a_release(): - os.environ['BUILD_STR'] = '' - else: - os.environ['BUILD_STR'] = 'dev' - - file_to_upload = conda_package_filename('conda-recipe') - - if this_is_a_release(): - upload_to_anaconda_cloud(file_to_upload, channel='main') - else: - upload_to_anaconda_cloud(file_to_upload, channel='dev') - - -if __name__ == '__main__': - main() diff --git a/.ci/appveyor/install.ps1 b/.ci/appveyor/install.ps1 deleted file mode 100644 index 18d543e..0000000 --- a/.ci/appveyor/install.ps1 +++ /dev/null @@ -1,103 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -$MINICONDA_URL = "http://repo.continuum.io/miniconda/" -$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -$GET_PIP_PATH = "C:\get-pip.py" - -function RunCommand ($command, $command_args) { - Write-Host $command $command_args - Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru -} - -function DownloadMiniconda ($python_version, $platform_suffix) { - $webclient = New-Object System.Net.WebClient - if ($python_version -like "2.*") { - $filename = "Miniconda2-latest-Windows-" + $platform_suffix + ".exe" - } ElseIf ($python_version -like "3.*") { - $filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe" - } Else { - $filename = "Miniconda-latest-Windows-" + $platform_suffix + ".exe" - } - $url = $MINICONDA_URL + $filename - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function InstallMiniconda ($python_version, $architecture, $python_home) { - # if ($architecture -eq "32") { - if ($architecture -eq "x86") { - $platform_suffix = "x86" - $python_home = $python_home + "_32" - } else { - $platform_suffix = "x86_64" - $python_home = $python_home + "_64" - } - - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - - $filepath = DownloadMiniconda $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $install_log = $python_home + ".log" - $args = "/S /D=$python_home" - Write-Host $filepath $args - Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - -function InstallMinicondaPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $conda_path = $python_home + "\Scripts\conda.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $args = "install --yes pip" - Write-Host $conda_path $args - Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - -function main () { - InstallMiniconda $env:PYTHON_VERSION $env:PLATFORM $env:PYTHON - # InstallMinicondaPip $env:PYTHON -} - -main diff --git a/.ci/appveyor/run_with_env.cmd b/.ci/appveyor/run_with_env.cmd deleted file mode 100644 index 72de7ca..0000000 --- a/.ci/appveyor/run_with_env.cmd +++ /dev/null @@ -1,36 +0,0 @@ -@echo off -:: To build extensions for 64 bit Python 3, we need to configure environment -:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 4 -:: -:: More details at: -:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows -:: -SET COMMAND_TO_RUN=%* -SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows -SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" -SET WINDOWS_SDK_VERSION="v7.0" -IF %MAJOR_PYTHON_VERSION%=="3" ( - SET WINDOWS_SDK_VERSION="v7.1" -) -ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% - -IF "%DISTUTILS_USE_SDK%"=="1" ( - - IF "%PLATFORM%"=="x64" ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) -) ELSE ( - ECHO Using default MSVC build environment - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) diff --git a/.ci/travis/deploy_to_anaconda.sh b/.ci/travis/deploy_to_anaconda.sh deleted file mode 100644 index 37affa7..0000000 --- a/.ci/travis/deploy_to_anaconda.sh +++ /dev/null @@ -1,10 +0,0 @@ -if [[ "$TRAVIS_TAG" == v* ]]; then - export CHANNEL="main" -else - export CHANNEL="dev" -fi - -echo "Uploading to $CHANNEL" -anaconda -t $ANACONDA_TOKEN upload --force --user csdms --channel $CHANNEL $HOME/miniconda/conda-bld/**/standard_names*bz2 - -echo "Done." diff --git a/.ci/travis/install_python.sh b/.ci/travis/install_python.sh deleted file mode 100644 index c4e7cd7..0000000 --- a/.ci/travis/install_python.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash - -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - OS="MacOSX-x86_64"; -else - OS="Linux-x86_64"; -fi -if [[ "$TRAVIS_PYTHON_VERSION" == 2.* ]]; then - wget http://repo.continuum.io/miniconda/Miniconda-latest-$OS.sh -O miniconda.sh; -else - wget http://repo.continuum.io/miniconda/Miniconda3-latest-$OS.sh -O miniconda.sh; -fi -bash miniconda.sh -b -p $HOME/miniconda -export PATH="$HOME/miniconda/bin:$PATH" -hash -r -conda config --set always_yes yes --set changeps1 no -conda info -a -conda install python=$TRAVIS_PYTHON_VERSION -conda install -q conda-build -conda install -q anaconda-client -conda install -q coverage -conda install -q sphinx diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..5d32f64 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,19 @@ +name: Format + +on: [push, pull_request] + +jobs: + + format: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: psf/black@stable + with: + args: ". --check" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a953d13 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint + +on: [push, pull_request] + +jobs: + + lint: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + + - name: Lint + run: | + pip install flake8 + flake8 . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b25c4ec --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test + +on: [push, pull_request] + +jobs: + build-and-test: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash -l {0} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python-version }} + miniforge-variant: Miniforge3 + miniforge-version: latest + auto-update-conda: true + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Install package + run: | + pip install -e . + + - name: Test + run: | + pytest -vvv diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d882ca9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -language: generic -os: -- linux -- osx -env: - matrix: - - CONDA_ENV=py36 - - CONDA_ENV=py37 - - CONDA_ENV=lint -matrix: - exclude: - - os: osx - env: CONDA_ENV=lint -sudo: false -jobs: - include: - - stage: deploy - if: tag =~ v.*$ - script: skip - os: linux - deploy: - on: - all_branches: true - provider: pypi - user: mcflugen - password: - secure: dbebH+nSyyeqIBov9XDxl3IGGjQk5TSimW8tQKf5aC0W7xY6cexsya34ar/F0AmDWmpy7MlQHQSZkcVPVqHpObcLNW9m6cHXfaLyASG5TgcVOkqTgTtufrdqQb/q084e2Af3CLVn/iSicmntgsAiKt/QIhKpD9HE4qlbcExMNPo= -before_install: -- | - if [[ $TRAVIS_OS_NAME == "osx" ]]; then - brew remove --force $(brew list) - brew cleanup -s - rm -rf $(brew --cache) - fi -install: -- | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > $HOME/miniconda.sh - else - curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > $HOME/miniconda.sh - fi -- bash $HOME/miniconda.sh -b -p $HOME/anaconda -- export PATH="$HOME/anaconda/bin:$PATH" -- hash -r -- conda config --set always_yes yes --set changeps1 no -- | - if [[ "$CONDA_ENV" == "docs" ]]; then - conda env create -n test_env --file docs/environment.yml - else - conda env create -n test_env --file ci/requirements-$CONDA_ENV-$TRAVIS_OS_NAME.yml - fi -- source activate test_env -- pip install . -r requirements.txt -script: -- | - if [[ "$CONDA_ENV" == "lint" ]]; then - make lint - elif [[ "$CONDA_ENV" == "docs" ]]; then - sphinx-apidoc --force -o docs/api model_metadata *tests - make -C docs clean html - else - pytest --cov=model_metadata --cov-report=xml:$(pwd)/coverage.xml -vvv - fi -after_success: coveralls diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 392fe5d..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,37 +0,0 @@ -environment: - - matrix: - - TARGET_ARCH: x64 - CONDA_INSTALL_LOCN: C:\\Miniconda37-x64 - CONDA_ENV: py37-windows - - - TARGET_ARCH: x64 - CONDA_INSTALL_LOCN: C:\\Miniconda36-x64 - CONDA_ENV: py36-windows - -platform: - - x64 - -os: Previous Visual Studio 2015 - -init: - - "ECHO %CONDA_INSTALL_LOCN% %CONDA_PY% %HOME% %PLATFORM%" - - "ECHO %APPVEYOR_REPO_BRANCH%" - -install: - - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat - - cmd: conda update --yes --quiet conda - - cmd: set PYTHONUNBUFFERED=1 - - cmd: conda config --set always_yes yes - - cmd: conda update conda - - cmd: conda config --append channels conda-forge - - cmd: conda env create -n test_env --file ci/requirements-$CONDA_ENV.yml - - cmd: conda activate test_env - - cmd: python --version - - cmd: pip install . -r requirements.txt - - -build: false - -test_script: - - pytest diff --git a/ci/requirements-lint-linux.yml b/ci/requirements-lint-linux.yml deleted file mode 100644 index fa3d791..0000000 --- a/ci/requirements-lint-linux.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.7 - - flake8 diff --git a/ci/requirements-py36-linux.yml b/ci/requirements-py36-linux.yml deleted file mode 100644 index 2bc187c..0000000 --- a/ci/requirements-py36-linux.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.6 diff --git a/ci/requirements-py36-osx.yml b/ci/requirements-py36-osx.yml deleted file mode 100644 index 2bc187c..0000000 --- a/ci/requirements-py36-osx.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.6 diff --git a/ci/requirements-py36-windows.yml b/ci/requirements-py36-windows.yml deleted file mode 100644 index 2bc187c..0000000 --- a/ci/requirements-py36-windows.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.6 diff --git a/ci/requirements-py37-linux.yml b/ci/requirements-py37-linux.yml deleted file mode 100644 index 77efc3a..0000000 --- a/ci/requirements-py37-linux.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.7 diff --git a/ci/requirements-py37-osx.yml b/ci/requirements-py37-osx.yml deleted file mode 100644 index 77efc3a..0000000 --- a/ci/requirements-py37-osx.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.7 diff --git a/ci/requirements-py37-windows.yml b/ci/requirements-py37-windows.yml deleted file mode 100644 index 77efc3a..0000000 --- a/ci/requirements-py37-windows.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.7 diff --git a/docs/source/conf.py b/docs/source/conf.py index ff5ae73..3497e58 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,59 +16,60 @@ import os import shlex -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), - os.pardir, os.pardir))) +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) +) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - 'numpydoc', + "sphinx.ext.autodoc", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "numpydoc", ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'standard_names' -copyright = u'2016, Eric Hutton' -author = u'Eric Hutton' +project = "standard_names" +copyright = "2016, Eric Hutton" +author = "Eric Hutton" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.2.2' +version = "0.2.2" # The full version, including alpha/beta/rc tags. -release = '0.2.2' +release = "0.2.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -79,9 +80,9 @@ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -89,27 +90,27 @@ # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False +# keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True @@ -119,143 +120,145 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'alabaster' +html_theme = "alabaster" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +# html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -#html_search_language = 'en' +# html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} +# html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' +# html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'standard_namesdoc' +htmlhelp_basename = "standard_namesdoc" # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', - -# Latex figure (float) alignment -#'figure_align': 'htbp', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', + # Latex figure (float) alignment + #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'standard_names.tex', u'standard\\_names Documentation', - u'Eric Hutton', 'manual'), + ( + master_doc, + "standard_names.tex", + "standard\\_names Documentation", + "Eric Hutton", + "manual", + ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output --------------------------------------- @@ -263,12 +266,11 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'standard_names', u'standard_names Documentation', - [author], 1) + (master_doc, "standard_names", "standard_names Documentation", [author], 1) ] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------- @@ -277,19 +279,25 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'standard_names', u'standard_names Documentation', - author, 'standard_names', 'One line description of project.', - 'Miscellaneous'), + ( + master_doc, + "standard_names", + "standard_names Documentation", + author, + "standard_names", + "One line description of project.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False +# texinfo_no_detailmenu = False diff --git a/setup.cfg b/setup.cfg index 31988b9..c6a245c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,9 @@ -[pylint] -disable = missing-docstring,line-too-long,bad-continuation - [flake8] -exclude = docs -ignore = - E203 - E501 - W503 +exclude = docs, script +ignore = C901, E203, E266, E501, W503, B905 max-line-length = 88 +max-complexity = 18 +select = B,C,E,F,W,T4,B9 [tool:pytest] minversion = 3.0 @@ -16,7 +12,7 @@ norecursedirs = .* *.egg* build dist addopts = --ignore setup.py --tb native - --strict + --strict-markers --durations 16 --doctest-modules doctest_optionflags = diff --git a/standard_names/cmd/snscrape.py b/standard_names/cmd/snscrape.py index 87ec6b3..b72d56d 100644 --- a/standard_names/cmd/snscrape.py +++ b/standard_names/cmd/snscrape.py @@ -63,7 +63,7 @@ def snscrape(files, with_headers=False, regex=None, format="url", newline=None): docs[file_name] = scrape(file_name, regex=regex, format=format) documents = [] - for (name, name_list) in docs.items(): + for name, name_list in docs.items(): if with_headers: heading = "Scraped from %s" % name else: