Skip to content

Commit

Permalink
FIX docs: code-block with TOML warning
Browse files Browse the repository at this point in the history
* Support newer Sphinx versions (>= 7.3.7)
* Tweak dependencies to silence Sphinx warnings for v8 deprecation

READTHEDOCS:
* Use os: ubuntu-lts-latest
* Use python 3.12
  • Loading branch information
jenisys committed May 12, 2024
1 parent f76f4d6 commit 951f293
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

version: 2
build:
os: ubuntu-20.04
os: ubuntu-lts-latest
tools:
python: "3.11"
python: "3.12"

python:
install:
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
extlinks = {
"behave": ("https://github.com/behave/behave", None),
"behave.example": ("https://github.com/behave/behave.example", None),
"issue": ("https://github.com/behave/behave/issues/%s", "issue #"),
"pull": ("https://github.com/behave/behave/issues/%s", "PR #"),
"issue": ("https://github.com/behave/behave/issues/%s", "issue #%s"),
"pull": ("https://github.com/behave/behave/issues/%s", "PR #%s"),
"github": ("https://github.com/%s", "github:/"),
"pypi": ("https://pypi.org/project/%s", ""),
"youtube": ("https://www.youtube.com/watch?v=%s", "youtube:video="),
"behave": ("https://github.com/behave/behave", None),
"pypi": ("https://pypi.org/project/%s", None),
"youtube": ("https://www.youtube.com/watch?v=%s", "youtube:video=%s"),

# -- CUCUMBER RELATED:
"cucumber": ("https://github.com/cucumber/common/", None),
"cucumber.issue": ("https://github.com/cucumber/common/issues/%s", "cucumber issue #"),
"cucumber.issue": ("https://github.com/cucumber/common/issues/%s", "cucumber issue #%s"),
}

intersphinx_mapping = {
Expand Down
3 changes: 1 addition & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ EXAMPLE:
[project]
name = "my-project"
...
dependencies = [
"behave @ git+https://github.com/behave/behave.git@v1.2.7.dev5",
# OR: "behave[develop] @ git+https://github.com/behave/behave.git@main",
...
]
.. _behave: https://github.com/behave/behave
8 changes: 3 additions & 5 deletions py.requirements/basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ contextlib2; python_version < '3.5'
win_unicode_console >= 0.5; python_version < '3.6'
colorama >= 0.3.7

# -- DISABLED PYTHON 2.6 SUPPORT:
# REQUIRES: pip >= 6.0
# argparse; python_version <= '2.6'
# ordereddict; python_version <= '2.6'
# importlib; python_version <= '2.6'
# -- SUPPORT: "pyproject.toml" (or: "behave.toml")
tomli>=1.1.0; python_version >= '3.0' and python_version < '3.11'
toml>=0.10.2; python_version < '3.0' # py27 support
20 changes: 14 additions & 6 deletions py.requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
# urllib3 v2.0+ only supports OpenSSL 1.1.1+, 'ssl' module is compiled with
# v1.0.2, see: https://github.com/urllib3/urllib3/issues/2168

sphinx >=1.6,<4.4
# -- NEEDS:
-r basic.txt

# -- DOCUMENTATION DEPENDENCIES:
sphinx >= 7.3.7; python_version >= '3.7'
sphinx >=1.6,<4.4; python_version < '3.7'
sphinx-autobuild
sphinx_bootstrap_theme >= 0.6.0

Expand All @@ -19,8 +24,11 @@ sphinx-intl >= 0.9.11
# -- CONSTRAINTS UNTIL: sphinx > 5.0 can be used
# PROBLEM: sphinxcontrib-applehelp v1.0.8 requires sphinx > 5.0
# SEE: https://stackoverflow.com/questions/77848565/sphinxcontrib-applehelp-breaking-sphinx-builds-with-sphinx-version-less-than-5-0
sphinxcontrib-applehelp==1.0.4; python_version >= '3.7'
sphinxcontrib-devhelp==1.0.2; python_version >= '3.7'
sphinxcontrib-htmlhelp==2.0.1; python_version >= '3.7'
sphinxcontrib-qthelp==1.0.3; python_version >= '3.7'
sphinxcontrib-serializinghtml==1.1.5; python_version >= '3.7'
# DISABLED: sphinxcontrib-applehelp==1.0.4; python_version >= '3.7'
# DISABLED: sphinxcontrib-devhelp==1.0.2; python_version >= '3.7'
# DISABLED: sphinxcontrib-htmlhelp==2.0.1; python_version >= '3.7'
# DISABLED: sphinxcontrib-qthelp==1.0.3; python_version >= '3.7'
# DISABLED: sphinxcontrib-serializinghtml==1.1.5; python_version >= '3.7'

sphinxcontrib-applehelp >= 1.0.8; python_version >= '3.7'
sphinxcontrib-htmlhelp >= 2.0.5; python_version >= '3.7'
7 changes: 2 additions & 5 deletions py.requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# PYTHON PACKAGE REQUIREMENTS FOR: behave -- For testing only
# ============================================================================

-r basic.txt

# -- TESTING: Unit tests and behave self-tests.
# PREPARED-FUTURE: behave4cmd0, behave4cmd
pytest < 5.0; python_version < '3.0' # pytest >= 4.2
Expand All @@ -22,11 +24,6 @@ assertpy >= 1.1
path.py >=11.5.0,<13.0; python_version < '3.5'
path >= 13.1.0; python_version >= '3.5'

# NOTE: toml extra for pyproject.toml-based config
# DISABLED: .[toml]
tomli >= 1.1.0; python_version >= '3.0' and python_version < '3.11'
toml >= 0.10.2; python_version < '3.0'

# -- PYTHON2 BACKPORTS:
pathlib; python_version <= '3.4'

Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,19 @@ develop = [
"ruff; python_version >= '3.7'",
]
docs = [
"Sphinx >=1.6,<4.4",
"sphinx >= 7.3.7; python_version >= '3.7'",
"sphinx >=1.6,<4.4; python_version < '3.7'",
"sphinx_bootstrap_theme >= 0.6.0",
# -- CONSTRAINTS UNTIL: sphinx > 5.0 is usable -- 2024-01
# PROBLEM: sphinxcontrib-applehelp v1.0.8 requires sphinx > 5.0
# SEE: https://stackoverflow.com/questions/77848565/sphinxcontrib-applehelp-breaking-sphinx-builds-with-sphinx-version-less-than-5-0
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.5",
"sphinxcontrib-applehelp >= 1.0.8; python_version >= '3.7'",
"sphinxcontrib-htmlhelp >= 2.0.5; python_version >= '3.7'",
# DISABLED: "sphinxcontrib-applehelp==1.0.4",
# DISABLED: "sphinxcontrib-devhelp==1.0.2",
# DISABLED: "sphinxcontrib-htmlhelp==2.0.1",
# DISABLED: "sphinxcontrib-qthelp==1.0.3",
# DISABLED: "sphinxcontrib-serializinghtml==1.1.5",
]
formatters = [
"behave-html-formatter >= 0.9.10; python_version >= '3.6'",
Expand Down
19 changes: 13 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def find_packages_by_root_package(where):
"contextlib2; python_version < '3.5'",
# DISABLED: "contextlib2 >= 21.6.0; python_version < '3.5'",
"colorama >= 0.3.7",

# -- SUPPORT: "pyproject.toml" (or: "behave.toml")
"tomli>=1.1.0; python_version >= '3.0' and python_version < '3.11'",
"toml>=0.10.2; python_version < '3.0'", # py27 support
],
tests_require=[
"pytest < 5.0; python_version < '3.0'", # USE: pytest >= 4.2
Expand All @@ -111,16 +115,19 @@ def find_packages_by_root_package(where):
},
extras_require={
"docs": [
"sphinx >= 1.6,<4.4",
"sphinx >= 7.3.7; python_version >= '3.7'",
"sphinx >=1.6,<4.4; python_version < '3.7'",
"sphinx_bootstrap_theme >= 0.6",
# -- CONSTRAINTS UNTIL: sphinx > 5.0 can be used -- 2024-01
# PROBLEM: sphinxcontrib-applehelp v1.0.8 requires sphinx > 5.0
# SEE: https://stackoverflow.com/questions/77848565/sphinxcontrib-applehelp-breaking-sphinx-builds-with-sphinx-version-less-than-5-0
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.5",
"sphinxcontrib-applehelp >= 1.0.8; python_version >= '3.7'",
"sphinxcontrib-htmlhelp >= 2.0.5; python_version >= '3.7'",
# DISABLED: "sphinxcontrib-applehelp==1.0.4",
# DISABLED: "sphinxcontrib-devhelp==1.0.2",
# DISABLED: "sphinxcontrib-htmlhelp==2.0.1",
# DISABLED: "sphinxcontrib-qthelp==1.0.3",
# DISABLED: "sphinxcontrib-serializinghtml==1.1.5",
],
"develop": [
"build >= 0.5.1",
Expand Down

0 comments on commit 951f293

Please sign in to comment.