Skip to content

Commit

Permalink
DOC: Update RTD config
Browse files Browse the repository at this point in the history
DOC: Update version parsing in conf.py

TST: Remove build_docs from CI

TST: Fix bandit YAML

TST: Move flake8 settings to setup.cfg

MNT: Remove unused imports in app.py
  • Loading branch information
pllim committed Jan 21, 2021
1 parent 9ce9b1f commit 6751e9d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .bandit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exclude_dirs:
- jdaviz/tests

skips: ['B101' # skip warning about asserts - they are used as behavior checks not as code tools
]
# skip warning about asserts - they are used as behavior checks not as code tools
skips: ['B101']
6 changes: 0 additions & 6 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ jobs:
toxenv: py38-test
allow_failure: false

- name: Documentation build
os: ubuntu-latest
python: 3.8
toxenv: build_docs
allow_failure: false

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
9 changes: 7 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ version: 2
build:
image: latest

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true

python:
version: 3.7
version: 3.8
system_packages: true
install:
- method: pip
path: .
extra_requirements:
- docs
- all

formats: []
20 changes: 8 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import os
import sys
import datetime
from importlib import import_module
from pkg_resources import get_distribution

try:
from sphinx_astropy.conf.v1 import * # noqa
Expand All @@ -40,8 +40,8 @@
from configparser import ConfigParser
conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
conf.read(os.path.join(os.pardir, 'setup.cfg'))
setup_cfg = conf['metadata']

# -- General configuration ----------------------------------------------------

Expand Down Expand Up @@ -70,20 +70,18 @@
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
datetime.datetime.now().year, author)

# 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.

import_module(setup_cfg['name'])
package = sys.modules[setup_cfg['name']]
package = get_distribution(project)

# The short X.Y version.
version = package.__version__.split('-', 1)[0]
# The full version, including alpha/beta/rc tags.
release = package.__version__

release = package.version
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

# -- Options for HTML output --------------------------------------------------

Expand All @@ -104,10 +102,8 @@
# name of a builtin theme or the name of a custom theme in html_theme_path.
#html_theme = None


html_theme = "sphinx_rtd_theme"


# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

Expand Down
12 changes: 4 additions & 8 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import logging
import os
import pathlib
import pkg_resources
import re
import uuid
from inspect import isclass

import ipywidgets as w
import numpy as np
from astropy import units as u
import pkg_resources

from astropy.nddata import CCDData
from spectral_cube import SpectralCube
from echo import CallbackProperty, DictCallbackProperty, ListCallbackProperty
from ipygoldenlayout import GoldenLayout
from ipysplitpanes import SplitPanes
Expand All @@ -20,7 +18,6 @@

from glue.config import data_translator
from glue.core import BaseData, HubListener, Data, DataCollection
from glue.core.autolinking import find_possible_links
from glue.core.link_helpers import LinkSame
from glue.core.message import (DataCollectionAddMessage,
DataCollectionDeleteMessage)
Expand All @@ -32,13 +29,12 @@

from .core.config import read_configuration, get_configuration
from .core.events import (LoadDataMessage, NewViewerMessage, AddDataMessage,
SnackbarMessage, RemoveDataMessage, ConfigurationLoadedMessage, AddDataToViewerMessage, RemoveDataFromViewerMessage)
SnackbarMessage, RemoveDataMessage,
AddDataToViewerMessage, RemoveDataFromViewerMessage)
from .core.registries import (tool_registry, tray_registry, viewer_registry,
data_parser_registry)
from .utils import load_template

#from .configs.mosviz.plugins.viewers import MOSVizProfile2DView

__all__ = ['Application']

SplitPanes()
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ doctest_plus = enabled
text_file_format = rst
addopts = --doctest-rst

[flake8]
max-line-length = 100
select = E101,W191,W291,W292,W293,W391,E111,E112,E113,E502,E722,E901,E902

[coverage:run]
omit =
jdaviz/_astropy_init*
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ skip_install = true
changedir = .
description = check code style, e.g. with flake8
deps = flake8
commands = flake8 jdaviz --count --max-line-length=100 --select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E502,E722,E901,E902
commands = flake8 jdaviz --count

[testenv:securityaudit]
skip_install = true
Expand Down

0 comments on commit 6751e9d

Please sign in to comment.