Skip to content

Commit

Permalink
Release 3.9.2, Merge pull request #485 from sentinel-hub/develop
Browse files Browse the repository at this point in the history
Release 3.9.2
  • Loading branch information
zigaLuksic authored Oct 24, 2023
2 parents 98d0327 + e757999 commit 7760095
Show file tree
Hide file tree
Showing 108 changed files with 1,864 additions and 1,113 deletions.
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ on:
branches:
- "master"
- "develop"
schedule:
# Schedule events are triggered by whoever last changed the cron schedule
- cron: "5 0 * * *"
workflow_call:

concurrency:
# This will cancel outdated runs on the same pull-request, but not runs for other triggers
Expand Down Expand Up @@ -98,7 +96,11 @@ jobs:
--instance_id "${{ secrets.INSTANCE_ID }}" \
--aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" \
--aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
pytest --cov --cov-report=term --cov-report=xml
if [ ${{ github.event_name }} == 'push' ]; then
pytest --cov --cov-report=term --cov-report=xml
else
pytest
fi
- name: Run reduced tests
if: ${{ !matrix.full_test_suite }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/scheduled_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: scheduled build caller

on:
schedule:
# Schedule events are triggered by whoever last changed the cron schedule
- cron: "0 0 * * *"

jobs:
call-workflow:
uses: sentinel-hub/sentinelhub-py/.github/workflows/ci_action.yml@develop
secrets: inherit
37 changes: 7 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
Expand All @@ -13,41 +13,18 @@ repos:
- id: debug-statements

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.10.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.1"
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/PyCQA/autoflake
rev: v2.0.1
hooks:
- id: autoflake
args:
[
--remove-all-unused-imports,
--in-place,
--ignore-init-module-imports,
]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.2.13
- flake8-comprehensions==3.10.1
- flake8-simplify==0.19.3
- flake8-typing-imports==1.14.0
- id: ruff

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-isort
- id: nbqa-flake8
- id: nbqa-ruff
14 changes: 9 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/source/conf.py

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
- method: pip
path: .
extra_requirements:
- docs
530 changes: 530 additions & 0 deletions CHANGELOG.MD

Large diffs are not rendered by default.

140 changes: 11 additions & 129 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*- # noqa: UP009
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# 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.
#
import contextlib
import os
import shutil
Expand All @@ -20,7 +14,6 @@

# -- Project information -----------------------------------------------------

# General information about the project.
project = "Sentinel Hub"
project_copyright = "2017, Sinergise"
author = "Sinergise EO research team"
Expand All @@ -41,13 +34,6 @@

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

# If your documentation needs a minimal Sphinx version, state it here.
#
# 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.doctest",
Expand All @@ -66,7 +52,7 @@
# Include typehints in descriptions
autodoc_typehints = "description"

# Both the class and the __init__ methods docstring are concatenated and inserted.
# Both the class' and the __init__ method's docstring are concatenated and inserted.
autoclass_content = "both"

# Content is in the same order as in module
Expand All @@ -77,21 +63,12 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# General information about the project.


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
# The language for content autogenerated by Sphinx.
language = "en"

# List of patterns, relative to source directory, that match files and
Expand All @@ -102,123 +79,32 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Mock imports that won't and don't have to be installed in ReadTheDocs environment
autodoc_mock_imports = ["boto3", "botocore", "pytest"]

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

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

html_logo = "./sentinel-hub-by_sinergise-dark_background.png"

# 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 = {
# "rightsidebar": "true",
# "relbarbgcolor": "black"}

# 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']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'about.html',
# 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# 'donate.html',
# ]
# }

# analytics
# Analytics
html_js_files = [("https://cdn.usefathom.com/script.js", {"data-site": "BILSIGFB", "defer": "defer"})]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "sentinelhub_doc"
# show/hide links for source
# Show/hide links for source
html_show_sourcelink = False

# -- 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',
}

# 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, "sentinelhub.tex", doc_title, author, "manual"),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "sentinelhub", doc_title, [author], 1)]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, "sentinelhub", doc_title, author, "sentinelhub", "One line description of project.", "Miscellaneous"),
]

# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = project_copyright
# -- Automatic generation of docs -----------------------------------------

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/3.8/": None}

# copy examples
# Copy examples
with contextlib.suppress(FileExistsError):
shutil.copytree("../../examples", "./examples")

Expand All @@ -228,9 +114,10 @@
os.mkdir(MARKDOWNS_FOLDER)


# Readme
def process_readme():
"""Function which will process README.md file and create INTRO.md"""
with open("../../README.md", "r") as file:
with open("../../README.md") as file:
readme = file.read()

readme = readme.replace("[`", "[").replace("`]", "]")
Expand All @@ -246,13 +133,7 @@ def process_readme():

chapters = ["\n".join(chapter) for chapter in chapters]

intro = "\n".join(
[
chapter
for chapter in chapters
if not (chapter.startswith("## Install") or chapter.startswith("## Documentation"))
]
)
intro = "\n".join([chapter for chapter in chapters if not (chapter.startswith(("## Install", "## Documentation")))])

with open(os.path.join(MARKDOWNS_FOLDER, "INTRO.md"), "w") as file:
file.write(intro)
Expand Down Expand Up @@ -284,6 +165,7 @@ def run_apidoc(_):
main(["-e", "-o", reference_dir, module, *APIDOC_EXCLUDE, *APIDOC_OPTIONS])


# Fix github links for moved files
def configure_github_link(_app: Any, pagename: str, _templatename: Any, context: Dict[str, Any], _doctree: Any) -> None:
"""Because some pages are auto-generated and some are copied from their original location the link "Edit on GitHub"
of a page is wrong. This function computes a custom link for such pages and saves it to a custom meta parameter
Expand Down
4 changes: 2 additions & 2 deletions docs/source/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Sentinel Hub Configuration

In order to use Sentinel Hub services you will need a Sentinel Hub account. If you do not have one yet, you can
create a free trial account at `Sentinel Hub`_. If you are a researcher you can even apply for a free non-commercial
account at `ESA OSEO page`_. The following configurations are then linked to your account.
account through `ESA Network of Resources`_. The following configurations are then linked to your account.

Parameter ``instance_id`` is used when using OGC endpoints of the `Sentinel Hub services`_. It is the identifier of a
configuration users can set up in the `Sentinel Hub Dashboard`_ under "Configuration Utility".
Expand Down Expand Up @@ -130,7 +130,7 @@ $ sentinelhub.config --help


.. _`Sentinel Hub`: https://www.sentinel-hub.com/trial
.. _`ESA OSEO page`: https://earth.esa.int/aos/OSEO
.. _`ESA Network of Resources`: https://www.sentinel-hub.com/Network-of-Resources/
.. _`Sentinel Hub Dashboard`: https://apps.sentinel-hub.com/dashboard/
.. _`Sentinel Hub services`: https://www.sentinel-hub.com/develop/documentation/api/ogc_api/
.. _`Sentinel Hub webinar`: https://www.youtube.com/watch?v=CBIlTOl2po4&t=1760s
Expand Down
Loading

0 comments on commit 7760095

Please sign in to comment.