Skip to content

Commit

Permalink
Maintenance cleanup (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 25, 2022
1 parent a5aaa97 commit 21dba7f
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 30 deletions.
17 changes: 0 additions & 17 deletions .flake8

This file was deleted.

9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
pip check
- name: Run the tests
run: |
python -m pytest -vv || python -m pytest -vv --lf
hatch run test:test || hatch run test:test --lf
test_minimum_versions:
name: Test Minimum Versions
Expand Down Expand Up @@ -118,3 +118,10 @@ jobs:
- uses: actions/checkout@v2
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- run: hatch run docs:build
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ repos:
args: [--max-line-length=200]
stages: [manual]

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.0.1
hooks:
- id: flake8
- id: Flake8-pyproject
alias: flake8
additional_dependencies:
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
stages: [manual]
Expand Down
9 changes: 9 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
sphinx:
configuration: doc/conf.py
python:
version: 3.8
install:
# install itself with pip install .
- method: pip
path: .
18 changes: 14 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys

HERE = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(HERE, ".."))

# 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
Expand Down Expand Up @@ -50,10 +55,15 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# Get information from _version.py and use it to generate version and release
_version_py = os.path.join(HERE, "../terminado/_version.py")
version_ns: dict = {}
exec(compile(open(_version_py).read(), _version_py, "exec"), version_ns)
# The short X.Y version.
version = "0.7"
version = "%s.%s" % tuple(version_ns["__version__"].split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = version
release = version_ns["__version__"]


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -98,7 +108,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
html_theme = "pydata_sphinx_theme"

# 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
Expand Down Expand Up @@ -127,7 +137,7 @@
# 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
Expand Down
2 changes: 0 additions & 2 deletions doc/requirements.txt

This file was deleted.

34 changes: 33 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@ Homepage = "https://github.com/jupyter/terminado"
test = [ "pytest>=7.0", "pre-commit", "pytest-timeout",]

[tool.hatch.version]
path = "terminado/__init__.py"
path = "terminado/_version.py"

[tool.hatch.envs.docs]
dependencies = ["sphinx", "pydata-sphinx-theme"]
[tool.hatch.envs.docs.scripts]
build = "make -C doc html SPHINXOPTS='-W'"

[tool.hatch.envs.test]
features = ["test"]
[tool.hatch.envs.test.scripts]
test = "python -m pytest -vv {args}"
nowarn = "python -m pytest -vv -W default {args}"

[tool.pytest.ini_options]
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
Expand All @@ -51,3 +62,24 @@ warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
warn_redundant_casts = true

[tool.flake8]
ignore = "E501, W503, E402"
builtins = "c, get_config"
exclude = [
".cache",
".github",
"docs",
"setup.py",
]
enable-extensions = "G"
extend-ignore = [
"G001", "G002", "G004", "G200", "G201", "G202",
# black adds spaces around ':'
"E203",
]
per-file-ignores = [
# B011: Do not call assert False since python -O removes these calls
# F841 local variable 'foo' is assigned to but never used
"terminado/tests/*: B011", "F841",
]
3 changes: 1 addition & 2 deletions terminado/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
# Copyright (c) 2014, Ramalingam Saravanan <[email protected]>
# Distributed under the terms of the Simplified BSD License.

from ._version import __version__ # noqa
from .management import NamedTermManager # noqa
from .management import SingleTermManager # noqa
from .management import TermManagerBase # noqa
from .management import UniqueTermManager # noqa
from .websocket import TermSocket # noqa

__version__ = "0.16.0"
1 change: 1 addition & 0 deletions terminado/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.16.0"

0 comments on commit 21dba7f

Please sign in to comment.