From 9686a5450fd6c4f5948bd97f0f099d59bfc7e5f8 Mon Sep 17 00:00:00 2001 From: Jasper Spaans Date: Thu, 18 Jan 2024 16:25:45 +0100 Subject: [PATCH 1/7] use idiomatic python version check ... so we don't get into trouble when Python 4 is released. --- src/whoosh/filedb/filetables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/whoosh/filedb/filetables.py b/src/whoosh/filedb/filetables.py index 6d0ae66c..be75995f 100644 --- a/src/whoosh/filedb/filetables.py +++ b/src/whoosh/filedb/filetables.py @@ -56,7 +56,7 @@ def cdb_hash(key): def md5_hash(key): - if sys.version_info[0] < 3 or sys.version_info[1] < 9: + if sys.version_info < (3, 9): return int(md5(key).hexdigest(), 16) & 0xffffffff return int(md5(key, usedforsecurity=False).hexdigest(), 16) & 0xffffffff From 6ce55ee39be586ce2a473a41f3cd579d50e47791 Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 00:34:42 -0700 Subject: [PATCH 2/7] Added Read The Docs config file to later deploy the docs to RTD. --- .readthedocs.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..274eb141 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,29 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.7" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: +# - requirements: requirements.txt + - requirements: docs/requirements.txt \ No newline at end of file From d1f9f3b93f8f7e5c67c506831fd7588b678fefa4 Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 00:35:19 -0700 Subject: [PATCH 3/7] Added requirements.txt file for RTD. --- docs/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..856b3f4c --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx +sphinx_rtd_theme \ No newline at end of file From 62e50324894ed4b8485db0a290db900867e75aa7 Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 00:38:03 -0700 Subject: [PATCH 4/7] Added github workflow to deploy the Docs to Github Pages. --- .github/workflows/deploy-github-pages.yml | 41 ++++++++ docs/requirements.txt | 3 +- docs/source/conf.py | 121 ++++++++++++---------- 3 files changed, 110 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/deploy-github-pages.yml diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml new file mode 100644 index 00000000..5b4d919a --- /dev/null +++ b/.github/workflows/deploy-github-pages.yml @@ -0,0 +1,41 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - master + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + + workflow_dispatch: # This line allows manual triggering + +jobs: + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: '3.7' + + - name: Install dependencies + run: pip install -r requirements.txt && pip install -r docs/requirements.txt + - name: Build website + run: cd docs && make html + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Build output to publish to the `gh-pages` branch: + publish_dir: ./docs/build/html + # The following lines assign commit authorship to the official + # GH-Actions bot for deploys to `gh-pages` branch: + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + # The GH actions bot is used by default if you didn't specify the two fields. + # You can swap them out with your own user credentials. + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 856b3f4c..f063a0ad 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ sphinx -sphinx_rtd_theme \ No newline at end of file +sphinx_rtd_theme +sphinx-jsonschema \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index e106a33a..e820f85e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,3 @@ - import sys, os, os.path sys.path.append(os.path.abspath("../../src")) @@ -7,33 +6,42 @@ # 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.append(os.path.abspath('.')) +# sys.path.append(os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # 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.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.ifconfig'] +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx-jsonschema", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", + "sphinx.ext.githubpages", + "sphinx.ext.todo", +] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8' +# source_encoding = 'utf-8' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'Whoosh' -copyright = u'2007-2012 Matt Chaput' +project = "Whoosh" +copyright = "2007-2012 Matt Chaput" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -46,153 +54,158 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # 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 documents that shouldn't be included in the build. -#unused_docs = [] +# unused_docs = [] # List of directories, relative to source directory, that shouldn't be searched # for source files. exclude_trees = [] # 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 = [] + +# -- Options for sphinx_rtd_theme ----------------------------------------- +# https://github.com/snide/sphinx_rtd_theme +import sphinx_rtd_theme +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' +# html_theme = 'default' # 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 = { - "codebgcolor": "#CCC", - } +# html_theme_options = { +# "codebgcolor": "#CCC", +# } # 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'] # 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_use_modindex = True +# html_use_modindex = 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, 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 = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' +# html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'Whooshdoc' +htmlhelp_basename = "Whooshdoc" # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' +# latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' +# latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Whoosh.tex', u'Whoosh Documentation', - u'Matt Chaput', 'manual'), + ("index", "Whoosh.tex", "Whoosh Documentation", "Matt Chaput", "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 # Additional stuff for the LaTeX preamble. -#latex_preamble = '' +# latex_preamble = '' # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_use_modindex = True +# latex_use_modindex = True # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # Autodoc config autoclass_content = "both" From 61ebb81ac14f8d77d5ec6152df7cafd5e1795b9d Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 02:19:48 -0700 Subject: [PATCH 5/7] Added requirements.txt to root folder for additional dependencies. --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..a3c06aae --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pytest +. From ff25e702ec02c704fa21943db5e8031b2c296b7f Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 02:32:50 -0700 Subject: [PATCH 6/7] Allow running some workflows manually. --- .github/workflows/python-package.yml | 2 ++ .github/workflows/python-publish.yml | 45 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0707587f..556b0f20 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,6 +5,8 @@ on: branches: [ master ] pull_request: branches: [ master ] + + workflow_dispatch: # This line allows manual triggering jobs: build: diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 00000000..9bf1f660 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,45 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + + workflow_dispatch: # This line allows manual triggering + + #push: + # branches: + # - master + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 668112328eb7ed0d30e9d8ac96587de2e68e6b3e Mon Sep 17 00:00:00 2001 From: Alejandro Gil Date: Thu, 1 Feb 2024 03:02:06 -0700 Subject: [PATCH 7/7] Updated readme.md with new documentation links. --- README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5cd89f42..e8c47c73 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -[![Build Status](https://travis-ci.org/whoosh-community/whoosh.svg?branch=master)](https://travis-ci.org/whoosh-community/whoosh) +[![Build Status](https://travis-ci.org/Sygil-Dev/whoosh-reloaded.svg?branch=master)](https://travis-ci.org/Sygil-Dev/whoosh-reloaded) + +This repository (whoosh-reloaded) is a fork and continuation of the Whoosh project. The original Whoosh project is no longer maintained. This fork is maintained by the Sygil-Dev Organization. + +-------------------------------------- About Whoosh ============ @@ -51,18 +55,24 @@ or ``pip`` to download and install Whoosh automatically:: # Install the development version from Github. $ pip install git+https://github.com/Sygil-Dev/whoosh.git +Getting the source. +================== + +You can check out the latest version of the source code on GitHub using git: + + $ git clone https://github.com/Sygil-Dev/whoosh.git + Learning more ============= -* Read the online documentation at https://docs.red-dove.com/whoosh/ (Search DOES work). +* Online Documentation: + + *   [Github Pages](https://sygil-dev.github.io/whoosh-reloaded/) + + *   [Read the Docs](https://whoosh-reloaded.readthedocs.io/en/latest/) + +* Read the old online documentation at https://docs.red-dove.com/whoosh/ (Search work properly). * Read the old online documentation at https://whoosh.readthedocs.org/en/latest/ (Search DOES NOT work). * File bug reports and issues at https://github.com/Sygil-Dev/whoosh/issues - -Getting the source. -================== - -You can check out the latest version of the source code on GitHub using git: - - $ git clone https://github.com/Sygil-Dev/whoosh.git