From ff0505e8f61d47abf442217b25028fda5fc0285e Mon Sep 17 00:00:00 2001 From: Stuart Read Date: Thu, 14 Nov 2024 14:20:30 -0600 Subject: [PATCH] [MAINT] pre-commit run --- .github/workflows/release.yml | 3 - .gitignore | 2 +- .pre-commit-config.yaml | 1 + README.md | 2 +- README.pypi | 2 +- doc/conf.py | 144 +++++++++++--------- doc/index.rst | 1 - orangecontrib/__init__.py | 1 - orangecontrib/protospec/__init__.py | 5 +- orangecontrib/protospec/tests/__init__.py | 1 + orangecontrib/protospec/widgets/__init__.py | 8 +- pyproject.toml | 3 + 12 files changed, 93 insertions(+), 80 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17cfb55..91d3a14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,3 @@ jobs: python -m build - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - - - diff --git a/.gitignore b/.gitignore index 375feb2..515d601 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,4 @@ htmlcov/* .pylint_cache # venv -venv \ No newline at end of file +venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f260f06..0cada22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,4 @@ repos: - flake8-comprehensions - pep8-naming - flake8-black + - flake8-pyproject diff --git a/README.md b/README.md index b89c5e7..71268dd 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,4 @@ directory (do not copy it to Python's site-packages directory), run pip install -e . -Further details can be found in orange-spectroscopy [CONTRIBUTING.md](https://github.com/Quasars/orange-spectroscopy/blob/master/CONTRIBUTING.md) \ No newline at end of file +Further details can be found in orange-spectroscopy [CONTRIBUTING.md](https://github.com/Quasars/orange-spectroscopy/blob/master/CONTRIBUTING.md) diff --git a/README.pypi b/README.pypi index 8214dac..19a9206 100644 --- a/README.pypi +++ b/README.pypi @@ -1,4 +1,4 @@ orange-spectroscopy-prototypes ============================== -Prototypes for orange-spectroscopy Orange add-on for spectral data analysis. \ No newline at end of file +Prototypes for orange-spectroscopy Orange add-on for spectral data analysis. diff --git a/doc/conf.py b/doc/conf.py index c4749dd..9809769 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # # Orange3 Example Add-on documentation build configuration file, created by # sphinx-quickstart on Fri Aug 21 11:28:31 2015. @@ -13,19 +12,19 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os -import shlex +# import sys +# import os +# import shlex # 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 @@ -44,7 +43,7 @@ source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' @@ -72,9 +71,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. @@ -82,27 +81,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' # 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 = False @@ -117,26 +116,26 @@ # 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, @@ -146,62 +145,62 @@ # 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', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', '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 = 'InfraredOrangeAdd-on' @@ -209,46 +208,48 @@ # -- 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, 'InfraredOrangeAdd-on', 'Infrared Orange Add-on Documentation', - 'Biolab', 'manual'), + ( + master_doc, + 'InfraredOrangeAdd-on', + 'Infrared Orange Add-on Documentation', + 'Biolab', + '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 --------------------------------------- @@ -256,12 +257,17 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'infraredorangeadd-on', 'Infrared Orange Add-on Documentation', - [author], 1) + ( + master_doc, + 'infraredorangeadd-on', + 'Infrared Orange Add-on Documentation', + [author], + 1, + ) ] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------- @@ -270,19 +276,25 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'Infrared Orange Add-on', 'Infrared Orange Add-on Documentation', - author, 'InfraredOrangeAdd-on', 'Spectral analysis with Orange.', - 'Miscellaneous'), + ( + master_doc, + 'Infrared Orange Add-on', + 'Infrared Orange Add-on Documentation', + author, + 'InfraredOrangeAdd-on', + 'Spectral analysis with Orange.', + '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/doc/index.rst b/doc/index.rst index dc90646..4081018 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -20,4 +20,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/orangecontrib/__init__.py b/orangecontrib/__init__.py index 8b13789..e69de29 100644 --- a/orangecontrib/__init__.py +++ b/orangecontrib/__init__.py @@ -1 +0,0 @@ - diff --git a/orangecontrib/protospec/__init__.py b/orangecontrib/protospec/__init__.py index 60b47b1..9d06af2 100644 --- a/orangecontrib/protospec/__init__.py +++ b/orangecontrib/protospec/__init__.py @@ -1,3 +1,2 @@ -import Orange.data -import os.path -from . import data #register file formats +# Register file formats: +from . import data # noqa: F401 diff --git a/orangecontrib/protospec/tests/__init__.py b/orangecontrib/protospec/tests/__init__.py index d9c30c7..ab628d1 100644 --- a/orangecontrib/protospec/tests/__init__.py +++ b/orangecontrib/protospec/tests/__init__.py @@ -1,6 +1,7 @@ import os import unittest + def suite(loader=None, pattern='test*.py'): test_dir = os.path.dirname(__file__) if loader is None: diff --git a/orangecontrib/protospec/widgets/__init__.py b/orangecontrib/protospec/widgets/__init__.py index 09fad60..baa14da 100644 --- a/orangecontrib/protospec/widgets/__init__.py +++ b/orangecontrib/protospec/widgets/__init__.py @@ -1,4 +1,5 @@ import sysconfig + # Category metadata. # Category icon show in the menu @@ -15,15 +16,16 @@ # make htmlhelp # inside doc folder ("{DEVELOP_ROOT}/doc/build/htmlhelp/index.html", None), - # Documentation included in wheel # Correct DATA_FILES entry is needed in setup.py and documentation has to be built # before the wheel is created. ("{}/help/orange-spectroscopy/index.html".format(sysconfig.get_path("data")), None), - # Online documentation url, used when the local documentation is not available. # Url should point to a page with a section Widgets. This section should # includes links to documentation pages of each widget. Matching is # performed by comparing link caption to widget name. - ("http://orange-spectroscopy.readthedocs.io/en/latest/", "") # FIXME upload documentation + ( + "http://orange-spectroscopy.readthedocs.io/en/latest/", + "", + ), # FIXME upload documentation ) diff --git a/pyproject.toml b/pyproject.toml index e50b093..c009fdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,9 @@ test = [ "flake8-pyproject", "black", ] +dev = [ + "pre-commit", +] [project.urls] Homepage = "https://github.com/Quasars/orange-spectroscopy-prototypes"