From f028b21b595dd93a132fb3ef0d0858efa31403a6 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 26 Dec 2018 10:07:37 -0600 Subject: [PATCH 01/72] Update badges --- README.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1f9534f..ef43287 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,17 @@ sphinx-issues ============= -.. image:: https://travis-ci.org/sloria/sphinx-issues.svg?branch=master - :target: https://travis-ci.org/sloria/sphinx-issues +.. image:: https://badgen.net/pypi/v/sphinx-issues + :alt: pypi badge + :target: http://badge.fury.io/py/sphinx-issues + +.. image:: https://badgen.net/travis/sloria/sphinx-issues + :alt: travis-ci status + :target: https://travis-ci.org/sloria/sphinx-issues + +.. image:: https://badgen.net/badge/code%20style/black/000 + :target: https://github.com/ambv/black + :alt: Code style: Black A Sphinx extension for linking to your project's issue tracker. Includes roles for linking to issues, pull requests, user profiles, with built-in support for GitHub (though this works with other services). From 4c5d38f0d60857c62c68e9adf7eb05883eb706ee Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 26 Dec 2018 16:52:51 -0600 Subject: [PATCH 02/72] Add test with list including an external issue --- test_sphinx_issues.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test_sphinx_issues.py b/test_sphinx_issues.py index 684ebae..0df5d8f 100644 --- a/test_sphinx_issues.py +++ b/test_sphinx_issues.py @@ -140,3 +140,20 @@ def test_issue_role_multiple(inliner): link2 = result[0][2] assert link2.astext() == "#43" assert link2.attributes["refuri"] == issue_url + "43" + + +def test_issue_role_multiple_with_external(inliner): + result = issue_role( + "issue", rawtext="", text="42,sloria/konch#43", inliner=inliner, lineno=None + ) + link1 = result[0][0] + assert link1.astext() == "#42" + issue_url = "https://github.com/marshmallow-code/marshmallow/issues/42" + assert link1.attributes["refuri"] == issue_url + + sep = result[0][1] + assert sep.astext() == ", " + + link2 = result[0][2] + assert link2.astext() == "sloria/konch#43" + assert link2.attributes["refuri"] == "https://github.com/sloria/konch/issues/43" From f841c25e4ce665de4242e0d3b89e9903e1503e8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 9 Jan 2019 13:15:28 +0000 Subject: [PATCH 03/72] Bump pre-commit from 1.13.0 to 1.14.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.13.0 to 1.14.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.13.0...v1.14.0) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 setup.py diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index e019ee6..33dfb3d --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.6.0", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.13.0", + "pre-commit==1.14.0", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 76c7b8293510a92d7484a981e20d184f36a54247 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 11 Jan 2019 13:14:56 +0000 Subject: [PATCH 04/72] Bump pre-commit from 1.14.0 to 1.14.2 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.14.0 to 1.14.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.14.0...v1.14.2) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 33dfb3d..e43582d 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.6.0", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.14.0", + "pre-commit==1.14.2", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 5ddd5b695949afb0bb86e696500a6d6d7213504b Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 15 Jan 2019 22:29:42 -0500 Subject: [PATCH 05/72] Remove sudo: in .travis.yml https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration Committed via https://github.com/asottile/all-repos --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4e625c..ef0dd14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: python -sudo: false cache: pip install: travis_retry pip install -U tox script: tox @@ -11,7 +10,7 @@ jobs: - { python: '2.7', env: TOXENV=py27 } - { python: '3.5', env: TOXENV=py35 } - { python: '3.6', env: TOXENV=py36 } - - { python: '3.7', env: TOXENV=py37, dist: xenial, sudo: true } + - { python: '3.7', env: TOXENV=py37, dist: xenial } - stage: PyPI Release if: tag IS present From bf60230e454409fe8623489b4ad57af276f06f5a Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 15 Jan 2019 23:04:00 -0500 Subject: [PATCH 06/72] Only install pre-commit in lint env Committed via https://github.com/asottile/all-repos --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 8da62dd..cda7cec 100644 --- a/tox.ini +++ b/tox.ini @@ -6,8 +6,9 @@ extras = tests commands = pytest {posargs} [testenv:lint] -extras = lint -commands = pre-commit run --all-files --show-diff-on-failure +deps = pre-commit~=1.14 +skip_install = true +commands = pre-commit run --all-files ; Below tasks are for development only (not run in CI) [testenv:watch-readme] From 06a7eed95b7a07b5b197457ea4f9e5e02f3df00a Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 15 Jan 2019 23:12:32 -0500 Subject: [PATCH 07/72] Bump copyright year Committed via https://github.com/asottile/all-repos --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index dbf0b92..ca1dd8e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2018 Steven Loria +Copyright 2019 Steven Loria Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 82bbdd8c25cde2e6d4872f064ea988ccaca006b3 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 20 Jan 2019 10:21:51 -0500 Subject: [PATCH 08/72] Ran pre-commit autoupdate. Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fb96c8..5cb61ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 + rev: v2.1.0 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs From 0f912338ab0feb0f0aa9da534098786edc0306b5 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 20 Jan 2019 14:29:07 -0500 Subject: [PATCH 09/72] Update to black's recommended flake8 config https://github.com/ambv/black/blob/master/.flake8 Committed via https://github.com/asottile/all-repos --- setup.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 41c7358..d7081b3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,8 +6,7 @@ license_file = LICENSE universal = 1 [flake8] -ignore = E203, E266, E501, W503, E302, W504 -max-line-length = 100 +ignore = E203, E266, E501, W503 +max-line-length = 80 max-complexity = 18 select = B,C,E,F,W,T4,B9 -exclude = .git,.ropeproject,.tox,build,env,venv,__pycache__ From cdc5c296d336b53670da16ed48cf293e9d1a151f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 30 Jan 2019 13:13:11 +0000 Subject: [PATCH 10/72] Bump flake8 from 3.6.0 to 3.7.1 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.6.0 to 3.7.1. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.6.0...3.7.1) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e43582d..b640e03 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.6.0", + "flake8==3.7.1", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.2", ], From 60f0e2910c11d64afd8a5c34b260f169c6824d23 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 30 Jan 2019 20:39:52 -0500 Subject: [PATCH 11/72] Replace legacy license_file option https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file Committed via https://github.com/asottile/all-repos --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d7081b3..673f711 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] # This includes the license file in the wheel. -license_file = LICENSE +license_files = LICENSE [bdist_wheel] universal = 1 From 38f23e2859c7b9ee8998d50b7d10164e14e31311 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 31 Jan 2019 13:12:53 +0000 Subject: [PATCH 12/72] Bump flake8 from 3.7.1 to 3.7.3 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.1 to 3.7.3. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.1...3.7.3) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b640e03..97eb465 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.1", + "flake8==3.7.3", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.2", ], From 161d616fdfc5ebb03a3bff675d4f6bdcb0a7d46e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 13:13:19 +0000 Subject: [PATCH 13/72] Bump flake8 from 3.7.3 to 3.7.4 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.3 to 3.7.4. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.3...3.7.4) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 97eb465..efcb7df 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.3", + "flake8==3.7.4", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.2", ], From a5e40b24fc5e77ea9a7fc3e3d4f57208ddc22292 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 2 Feb 2019 15:25:37 -0500 Subject: [PATCH 14/72] Use direct PyPI link Committed via https://github.com/asottile/all-repos --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ef43287..6baafe6 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ sphinx-issues .. image:: https://badgen.net/pypi/v/sphinx-issues :alt: pypi badge - :target: http://badge.fury.io/py/sphinx-issues + :target: https://pypi.org/project/sphinx-issues/ .. image:: https://badgen.net/travis/sloria/sphinx-issues :alt: travis-ci status From 7a5355f7db5062279a640b3376e8f905df971fa7 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 3 Feb 2019 23:12:52 -0500 Subject: [PATCH 15/72] Migrate to official pycqa/flake8 hooks repo Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5cb61ba..7c40a0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,8 +4,8 @@ repos: hooks: - id: black language_version: python3.6 -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.1.0 +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.4 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs From 91ffe7e7920b1357c82d0e4aca7c903ab91b20aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 5 Feb 2019 13:13:29 +0000 Subject: [PATCH 16/72] Bump flake8 from 3.7.4 to 3.7.5 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.4 to 3.7.5. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.4...3.7.5) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index efcb7df..9fa8866 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.4", + "flake8==3.7.5", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.2", ], From 3910a0698d930e470247a4b2201d2a0017b95c40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 5 Feb 2019 13:22:59 +0000 Subject: [PATCH 17/72] Bump pre-commit from 1.14.2 to 1.14.3 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.14.2...v1.14.3) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9fa8866..5430564 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.5", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.14.2", + "pre-commit==1.14.3", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 0ba915b47cf26846525f6d41bf3877cf44a85929 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 5 Feb 2019 23:57:38 -0500 Subject: [PATCH 18/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c40a0a..887ce52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: black language_version: python3.6 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.4 + rev: 3.7.5 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs From 67406593ccc81526c6a5faaf8e6b05b401df512f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Feb 2019 13:13:00 +0000 Subject: [PATCH 19/72] Bump pre-commit from 1.14.3 to 1.14.4 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.14.3 to 1.14.4. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.14.3...v1.14.4) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5430564..97f28ee 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.5", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.14.3", + "pre-commit==1.14.4", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From c227c7b49458116c5d6a3229f88dc8fb20d2c05f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Feb 2019 13:20:56 +0000 Subject: [PATCH 20/72] Bump flake8 from 3.7.5 to 3.7.6 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.5 to 3.7.6. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.5...3.7.6) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 97f28ee..e04b77a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.5", + "flake8==3.7.6", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.4", ], From 9a39d7b9a1b5627e49267da14a47d95c2a9314a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 26 Feb 2019 13:13:06 +0000 Subject: [PATCH 21/72] Bump flake8 from 3.7.6 to 3.7.7 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.6 to 3.7.7. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.6...3.7.7) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e04b77a..856106f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.6", + "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', "pre-commit==1.14.4", ], From 6425bb56bb69288c440a9ba5a6a5d3eade41f659 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Thu, 14 Mar 2019 20:57:40 -0400 Subject: [PATCH 22/72] Use xenial for all builds Committed via https://github.com/asottile/all-repos --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef0dd14..dbdaf3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: python +dist: xenial cache: pip install: travis_retry pip install -U tox script: tox @@ -10,7 +11,7 @@ jobs: - { python: '2.7', env: TOXENV=py27 } - { python: '3.5', env: TOXENV=py35 } - { python: '3.6', env: TOXENV=py36 } - - { python: '3.7', env: TOXENV=py37, dist: xenial } + - { python: '3.7', env: TOXENV=py37 } - stage: PyPI Release if: tag IS present From c87e44dc2d5b14d9a3cfe5199942d73db08f4ae1 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 16 Mar 2019 18:04:14 -0400 Subject: [PATCH 23/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 887ce52..56b2e1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,15 @@ repos: - repo: https://github.com/ambv/black - rev: 18.9b0 + rev: 19.3b0 hooks: - id: black language_version: python3.6 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.5 + rev: 3.7.7 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs - rev: v0.3.0 + rev: v0.5.0 hooks: - id: blacken-docs - additional_dependencies: [black==18.9b0] + additional_dependencies: [black==19.3b0] From 86ec8a9e1eed71046c53d57d62afc7161fd25782 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 1 Apr 2019 12:12:03 +0000 Subject: [PATCH 24/72] Bump pre-commit from 1.14.4 to 1.15.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.14.4 to 1.15.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.14.4...v1.15.0) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 856106f..7d59b82 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.14.4", + "pre-commit==1.15.0", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From c8803b1547ab88bd1d8e026dce44c03a5d00c9ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 2 Apr 2019 12:11:38 +0000 Subject: [PATCH 25/72] Bump pre-commit from 1.15.0 to 1.15.1 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.15.0 to 1.15.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.15.0...v1.15.1) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7d59b82..8a05c23 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.15.0", + "pre-commit==1.15.1", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 0a9597472645dc728c2aef12e0653aabfdb68ab2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 17 Apr 2019 12:12:46 +0000 Subject: [PATCH 26/72] Bump pre-commit from 1.15.1 to 1.15.2 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.15.1 to 1.15.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.15.1...v1.15.2) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8a05c23..83610a3 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.15.1", + "pre-commit==1.15.2", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From d67ac8dc7c3be51822b6742b5adadae77f321035 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 May 2019 12:11:41 +0000 Subject: [PATCH 27/72] Bump pre-commit from 1.15.2 to 1.16.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.15.2 to 1.16.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.15.2...v1.16.0) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 83610a3..78c47ae 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.15.2", + "pre-commit==1.16.0", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From f0715ec17a633627dd92a30865a38391c1fc64cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 9 May 2019 12:13:04 +0000 Subject: [PATCH 28/72] Bump pre-commit from 1.16.0 to 1.16.1 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.16.0 to 1.16.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.16.0...v1.16.1) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 78c47ae..b064d7e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==18.8.0; python_version >= "3.5"', - "pre-commit==1.16.0", + "pre-commit==1.16.1", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 2c5bf5029c41c4fa196587881c816950545cf065 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 11 May 2019 12:42:26 -0400 Subject: [PATCH 29/72] Update black repo Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56b2e1d..c3d9370 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: -- repo: https://github.com/ambv/black +- repo: https://github.com/python/black rev: 19.3b0 hooks: - id: black From 0e748c7b065bc94af6a2391d83a2987a618b7954 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 11 May 2019 13:14:25 -0400 Subject: [PATCH 30/72] Allow using black in py37 Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3d9370..8b0a8a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: 19.3b0 hooks: - id: black - language_version: python3.6 + language_version: python3 - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.7 hooks: From 2a1c9052c4ded5b3b64c35f276c20b6a10fe8474 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Thu, 30 May 2019 13:48:05 +0000 Subject: [PATCH 31/72] Bump flake8-bugbear from 18.8.0 to 19.3.0 (#78) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b064d7e..d7cc76b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ "flake8==3.7.7", - 'flake8-bugbear==18.8.0; python_version >= "3.5"', + 'flake8-bugbear==19.3.0; python_version >= "3.5"', "pre-commit==1.16.1", ], } From 3e2b3a7ddb7bc597842e94efe326901f092f974e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Thu, 6 Jun 2019 16:55:46 +0000 Subject: [PATCH 32/72] Bump pre-commit from 1.16.1 to 1.17.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.16.1 to 1.17.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.16.1...v1.17.0) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d7cc76b..4e0e355 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.7", 'flake8-bugbear==19.3.0; python_version >= "3.5"', - "pre-commit==1.16.1", + "pre-commit==1.17.0", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From ada17e2c540d7c3b912b0365f9d8b74e0c6cc240 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2019 12:51:38 +0000 Subject: [PATCH 33/72] Bump flake8 from 3.7.7 to 3.7.8 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.7 to 3.7.8. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.7...3.7.8) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4e0e355..169978e 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.7", + "flake8==3.7.8", 'flake8-bugbear==19.3.0; python_version >= "3.5"', "pre-commit==1.17.0", ], From 79f60c983d8bc37e20d3e3254735e396a8440190 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 14:20:54 +0000 Subject: [PATCH 34/72] Bump pre-commit from 1.17.0 to 1.18.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.17.0...v1.18.0) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 169978e..a993a82 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.8", 'flake8-bugbear==19.3.0; python_version >= "3.5"', - "pre-commit==1.17.0", + "pre-commit==1.18.0", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 10750de9561692e2eb1150b08b71595cd3f94ade Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:36:57 +0000 Subject: [PATCH 35/72] Bump flake8-bugbear from 19.3.0 to 19.8.0 Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 19.3.0 to 19.8.0. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](https://github.com/PyCQA/flake8-bugbear/commits) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a993a82..bc9f7a4 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ "flake8==3.7.8", - 'flake8-bugbear==19.3.0; python_version >= "3.5"', + 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit==1.18.0", ], } From 8eaf1fa0ce7c23267e92f2cbff584992f4d0bbad Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:45:29 +0000 Subject: [PATCH 36/72] Bump pre-commit from 1.18.0 to 1.18.1 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.18.0 to 1.18.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.18.0...v1.18.1) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bc9f7a4..2a37369 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.8", 'flake8-bugbear==19.8.0; python_version >= "3.5"', - "pre-commit==1.18.0", + "pre-commit==1.18.1", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 9dc7c463599acbb80a938259fa26100044f5e2ad Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2019 14:14:32 +0000 Subject: [PATCH 37/72] Bump pre-commit from 1.18.1 to 1.18.2 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.18.1 to 1.18.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.18.1...v1.18.2) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2a37369..ac646c1 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.8", 'flake8-bugbear==19.8.0; python_version >= "3.5"', - "pre-commit==1.18.1", + "pre-commit==1.18.2", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 3252f3922e0a890af3d062b6418d537197ef5f03 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 21 Aug 2019 00:08:04 -0400 Subject: [PATCH 38/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b0a8a7..d126f71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,11 @@ repos: - id: black language_version: python3 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.7 + rev: 3.7.8 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs - rev: v0.5.0 + rev: v1.3.0 hooks: - id: blacken-docs additional_dependencies: [black==19.3b0] From a68d0e24cdecfa0f1fe85c3cc177051d166057db Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2019 14:06:37 +0000 Subject: [PATCH 39/72] Bump pre-commit from 1.18.2 to 1.18.3 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 1.18.2 to 1.18.3. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v1.18.2...v1.18.3) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ac646c1..31e4f9c 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.8", 'flake8-bugbear==19.8.0; python_version >= "3.5"', - "pre-commit==1.18.2", + "pre-commit==1.18.3", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] From 73403fb300007c69e12892d1433b01e424a1578b Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 15 Sep 2019 09:42:56 -0400 Subject: [PATCH 40/72] Fix GitHub casing --- README.rst | 11 ++++++----- sphinx_issues.py | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 6baafe6..d1be25b 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,8 @@ Installation and Configuration pip install sphinx-issues -Add ``sphinx_issues`` to ``extensions`` in your ``conf.py``. If your project is on GitHub, add the ``issues_github_path`` config variable. Otherwise, use ``issues_uri`` and ``issues_pr_uri``. +Add ``sphinx_issues`` to ``extensions`` in your ``conf.py``. If your project is on GitHub, add the ``issues_github_path`` config variable. +Otherwise, use ``issues_uri``, ``issues_pr_uri``, and ``issues_commit_uri``. .. code-block:: python @@ -41,7 +42,7 @@ Add ``sphinx_issues`` to ``extensions`` in your ``conf.py``. If your project is "sphinx_issues" ] - # Github repo + # GitHub repo issues_github_path = "sloria/marshmallow" # equivalent to @@ -65,7 +66,7 @@ Use the ``:issue:`` and ``:pr:`` roles in your docs like so: See PR :pr:`58` -Use the ``:user:`` role in your docs to link to user profiles (Github by default, but can be configured via the ``issues_user_uri`` config variable). +Use the ``:user:`` role in your docs to link to user profiles (GitHub by default, but can be configured via the ``issues_user_uri`` config variable). .. code-block:: rst @@ -93,7 +94,7 @@ Use the ``:cve:`` role to link to CVEs on https://cve.mitre.org. Credits ******* -Credit goes to Jeff Forcier for his work on the `releases `_ extension, which is a full-featured solution for generating changelogs. I just needed a quick way to reference Github issues in my docs, so I yoinked the bits that I needed. +Credit goes to Jeff Forcier for his work on the `releases `_ extension, which is a full-featured solution for generating changelogs. I just needed a quick way to reference GitHub issues in my docs, so I yoinked the bits that I needed. License ******* @@ -141,7 +142,7 @@ Changelog 0.2.0 (2014-12-22) ------------------ -- Add ``:user:`` role for linking to Github user profiles. +- Add ``:user:`` role for linking to GitHub user profiles. 0.1.0 (2014-12-21) ------------------ diff --git a/sphinx_issues.py b/sphinx_issues.py index 4ab3a5e..a3b05c8 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -12,7 +12,7 @@ def user_role(name, rawtext, text, lineno, inliner, options=None, content=None): """Sphinx role for linking to a user profile. Defaults to linking to - Github profiles, but the profile URIS can be configured via the + GitHub profiles, but the profile URIS can be configured via the ``issues_user_uri`` config value. Examples: :: @@ -189,7 +189,7 @@ def setup(app): # Format template for commit URI # e.g. 'https://github.com/sloria/marshmallow/commits/{commit} app.add_config_value("issues_commit_uri", default=None, rebuild="html") - # Shortcut for Github, e.g. 'sloria/marshmallow' + # Shortcut for GitHub, e.g. 'sloria/marshmallow' app.add_config_value("issues_github_path", default=None, rebuild="html") # Format template for user profile URI # e.g. 'https://github.com/{user}' From 437aba7b14470d31f99cdace802cd9e34842e5c2 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 15 Sep 2019 09:43:16 -0400 Subject: [PATCH 41/72] Sync pre-commit version --- setup.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 31e4f9c..1e96c34 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ "lint": [ "flake8==3.7.8", 'flake8-bugbear==19.8.0; python_version >= "3.5"', - "pre-commit==1.18.3", + "pre-commit~=1.18", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] diff --git a/tox.ini b/tox.ini index cda7cec..f10a9b0 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ extras = tests commands = pytest {posargs} [testenv:lint] -deps = pre-commit~=1.14 +deps = pre-commit~=1.18 skip_install = true commands = pre-commit run --all-files From 0a0ed3ceefd7c36b52693af6850eaf5b9c0bde90 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 15 Sep 2019 09:43:56 -0400 Subject: [PATCH 42/72] Fix typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1e96c34..af4fbab 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def read(fname): setup( name="sphinx-issues", version=find_version("sphinx_issues.py"), - description="A Sphinx extension for linking to your project's " "issue tracker", + description="A Sphinx extension for linking to your project's issue tracker", long_description=read("README.rst"), install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE, From 917a53d346486fce6a887555f5f2d876b1dffb21 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2019 12:18:53 +0000 Subject: [PATCH 43/72] Bump flake8 from 3.7.8 to 3.7.9 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.8 to 3.7.9. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.8...3.7.9) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index af4fbab..4e6d61c 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.8", + "flake8==3.7.9", 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit~=1.18", ], From ca72499ca38ddb1b7a5de3b0b007f1fe558ba54b Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 3 Nov 2019 13:32:37 -0500 Subject: [PATCH 44/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d126f71..a7ae4c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,15 @@ repos: - repo: https://github.com/python/black - rev: 19.3b0 + rev: 19.10b0 hooks: - id: black language_version: python3 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.8 + rev: 3.7.9 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs rev: v1.3.0 hooks: - id: blacken-docs - additional_dependencies: [black==19.3b0] + additional_dependencies: [black==19.10b0] From 5115a843fe269d8c44f454e4b18de5696026e8c3 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 14 Jan 2020 19:09:46 -0500 Subject: [PATCH 45/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7ae4c9..a79faf1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs - rev: v1.3.0 + rev: v1.5.0-1 hooks: - id: blacken-docs additional_dependencies: [black==19.10b0] From 23969c0934444deeafa806497b90c8d6674c5717 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 14 Jan 2020 19:12:15 -0500 Subject: [PATCH 46/72] Bump copyright year Committed via https://github.com/asottile/all-repos --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ca1dd8e..f42c016 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2019 Steven Loria +Copyright 2020 Steven Loria Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From d14f5d96311fd970509ec1a5d3ebc417b6e7e169 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 12 May 2020 12:12:25 +0000 Subject: [PATCH 47/72] Bump flake8 from 3.7.9 to 3.8.1 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.9 to 3.8.1. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.9...3.8.1) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4e6d61c..4518509 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.7.9", + "flake8==3.8.1", 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit~=1.18", ], From bab7d7aed58adcb0aecb7acfefabddfdc851dff4 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 16 May 2020 11:16:38 -0400 Subject: [PATCH 48/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a79faf1..071e2fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,11 @@ repos: - id: black language_version: python3 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + rev: 3.8.1 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs - rev: v1.5.0-1 + rev: v1.7.0 hooks: - id: blacken-docs additional_dependencies: [black==19.10b0] From 285ee17f799870da045413f09e5f48545fa5f594 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 12:12:11 +0000 Subject: [PATCH 49/72] Bump flake8 from 3.8.1 to 3.8.2 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.1 to 3.8.2. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.1...3.8.2) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4518509..ff6cc4d 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.8.1", + "flake8==3.8.2", 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit~=1.18", ], From 07bf2b900bebca17abe05dc4457a18cd47f3afca Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2020 12:12:31 +0000 Subject: [PATCH 50/72] Bump flake8 from 3.8.2 to 3.8.3 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.2 to 3.8.3. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.2...3.8.3) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ff6cc4d..aa0b64d 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.8.2", + "flake8==3.8.3", 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit~=1.18", ], From 8d4b8b922952c5dcd22f5b9049f600ffdde46f32 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 6 Sep 2020 12:25:47 -0400 Subject: [PATCH 51/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 071e2fa..82c00e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,15 @@ repos: - repo: https://github.com/python/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black language_version: python3 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.1 + rev: 3.8.3 hooks: - id: flake8 - repo: https://github.com/asottile/blacken-docs - rev: v1.7.0 + rev: v1.8.0 hooks: - id: blacken-docs - additional_dependencies: [black==19.10b0] + additional_dependencies: [black==20.8b1] From a3e26cd8317ea55a32b59f544dc11e36302a1bc3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2020 12:12:27 +0000 Subject: [PATCH 52/72] Bump flake8 from 3.8.3 to 3.8.4 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.3 to 3.8.4. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.3...3.8.4) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index aa0b64d..d667230 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest", 'mock; python_version < "3.0"'], "lint": [ - "flake8==3.8.3", + "flake8==3.8.4", 'flake8-bugbear==19.8.0; python_version >= "3.5"', "pre-commit~=1.18", ], From 29083da3c109b8d242924505ce9968bc283be146 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 18 Oct 2020 23:08:38 -0400 Subject: [PATCH 53/72] Test against Python 3.8 and 3.9 (#104) * Test against Pytoh 3.8 and 3.9 * Update tooling; add pyupgrade * Fix py38 * Increase max line length --- .pre-commit-config.yaml | 9 +++++++-- .travis.yml | 8 ++++---- README.rst | 6 ++++++ setup.cfg | 2 +- setup.py | 15 +++++++-------- sphinx_issues.py | 17 +++++++---------- test_sphinx_issues.py | 3 +-- tox.ini | 4 ++-- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82c00e5..e64e9f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,18 @@ repos: +- repo: https://github.com/asottile/pyupgrade + rev: v2.7.2 + hooks: + - id: pyupgrade + args: ["--py36-plus"] - repo: https://github.com/python/black rev: 20.8b1 hooks: - id: black - language_version: python3 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 + rev: 3.8.4 hooks: - id: flake8 + additional_dependencies: [flake8-bugbear==20.1.4] - repo: https://github.com/asottile/blacken-docs rev: v1.8.0 hooks: diff --git a/.travis.yml b/.travis.yml index dbdaf3e..5a90e10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,15 +7,15 @@ jobs: fast_finish: true include: - - { python: '3.6', env: TOXENV=lint } - - { python: '2.7', env: TOXENV=py27 } - - { python: '3.5', env: TOXENV=py35 } + - { python: '3.8', env: TOXENV=lint } - { python: '3.6', env: TOXENV=py36 } - { python: '3.7', env: TOXENV=py37 } + - { python: '3.8', env: TOXENV=py38 } + - { python: '3.9-dev', env: TOXENV=py39 } - stage: PyPI Release if: tag IS present - python: "3.6" + python: "3.8" env: [] install: skip script: skip diff --git a/README.rst b/README.rst index d1be25b..d09490b 100644 --- a/README.rst +++ b/README.rst @@ -105,6 +105,12 @@ MIT licensed. See the bundled `LICENSE = "3.5"', - "pre-commit~=1.18", + "flake8-bugbear==20.1.4", + "pre-commit~=2.7", ], } EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"] @@ -19,7 +18,7 @@ def find_version(fname): Raises RuntimeError if not found. """ version = "" - with open(fname, "r") as fp: + with open(fname) as fp: reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]') for line in fp: m = reg.match(line) @@ -49,15 +48,15 @@ def read(fname): url="https://github.com/sloria/sphinx-issues", license="MIT", keywords="sphinx issues github", + python_requires=">=3.6", classifiers=[ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Documentation", ], py_modules=["sphinx_issues"], diff --git a/sphinx_issues.py b/sphinx_issues.py index a3b05c8..e00edf6 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """A Sphinx extension for linking to your project's issue tracker.""" import re @@ -33,11 +32,11 @@ def user_role(name, rawtext, text, lineno, inliner, options=None, content=None): if config.issues_user_uri: ref = config.issues_user_uri.format(user=target) else: - ref = "https://github.com/{0}".format(target) + ref = f"https://github.com/{target}" if has_explicit_title: text = title else: - text = "@{0}".format(target) + text = f"@{target}" link = nodes.reference(text=text, refuri=ref, **options) return [link], [] @@ -57,13 +56,13 @@ def cve_role(name, rawtext, text, lineno, inliner, options=None, content=None): target = utils.unescape(target).strip() title = utils.unescape(title).strip() - ref = "https://cve.mitre.org/cgi-bin/cvename.cgi?name={0}".format(target) + ref = f"https://cve.mitre.org/cgi-bin/cvename.cgi?name={target}" text = title if has_explicit_title else target link = nodes.reference(text=text, refuri=ref, **options) return [link], [] -class IssueRole(object): +class IssueRole: EXTERNAL_REPO_REGEX = re.compile(r"^(\w+)/(.+)([#@])([\w]+)$") @@ -77,7 +76,7 @@ def __init__( @staticmethod def default_format_text(issue_no): - return "#{0}".format(issue_no) + return f"#{issue_no}" def make_node(self, name, issue_no, config, options=None): name_map = {"pr": "pull", "issue": "issues", "commit": "commit"} @@ -86,12 +85,10 @@ def make_node(self, name, issue_no, config, options=None): if repo_match: # External repo username, repo, symbol, issue = repo_match.groups() if name not in name_map: - raise ValueError( - "External repo linking not supported for :{}:".format(name) - ) + raise ValueError(f"External repo linking not supported for :{name}:") path = name_map.get(name) ref = "https://github.com/{issues_github_path}/{path}/{n}".format( - issues_github_path="{}/{}".format(username, repo), path=path, n=issue + issues_github_path=f"{username}/{repo}", path=path, n=issue ) formatted_issue = self.format_text(issue).lstrip("#") text = "{username}/{repo}{symbol}{formatted_issue}".format(**locals()) diff --git a/test_sphinx_issues.py b/test_sphinx_issues.py index 0df5d8f..a1cf6ab 100644 --- a/test_sphinx_issues.py +++ b/test_sphinx_issues.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- from tempfile import mkdtemp from shutil import rmtree try: from unittest.mock import Mock except ImportError: - from mock import Mock + from unittest.mock import Mock from sphinx.application import Sphinx from sphinx_issues import ( diff --git a/tox.ini b/tox.ini index f10a9b0..f46efed 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -envlist = lint,py27,py35,py36,py37 +envlist = lint,py36,py37,py38,py39 [testenv] extras = tests commands = pytest {posargs} [testenv:lint] -deps = pre-commit~=1.18 +deps = pre-commit~=2.7 skip_install = true commands = pre-commit run --all-files From ed6fe8b946b81d14ebabc4b57e08259f230f62af Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2020 13:12:03 +0000 Subject: [PATCH 54/72] Bump flake8-bugbear from 20.1.4 to 20.11.1 Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 20.1.4 to 20.11.1. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](https://github.com/PyCQA/flake8-bugbear/compare/20.1.4...20.11.1) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 087266c..20c258a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ "tests": ["pytest"], "lint": [ "flake8==3.8.4", - "flake8-bugbear==20.1.4", + "flake8-bugbear==20.11.1", "pre-commit~=2.7", ], } From 7842f3f157226513d2e273f98385adf4c13cfe22 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 13:09:08 +0000 Subject: [PATCH 55/72] Bump flake8 from 3.8.4 to 3.9.0 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.4 to 3.9.0. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 20c258a..748bfa2 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest"], "lint": [ - "flake8==3.8.4", + "flake8==3.9.0", "flake8-bugbear==20.11.1", "pre-commit~=2.7", ], From 48700e9e6af0fafe1b5c20850ee4f770bb014492 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 3 Apr 2021 13:25:41 -0400 Subject: [PATCH 56/72] Remove quotes in precommit config Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e64e9f7..b5a58f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: v2.7.2 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: [--py36-plus] - repo: https://github.com/python/black rev: 20.8b1 hooks: From 461664d86ad45c5f255e0751a5dd4162848ee58d Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 3 Apr 2021 13:43:18 -0400 Subject: [PATCH 57/72] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5a58f7..d8a4833 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.7.2 + rev: v2.11.0 hooks: - id: pyupgrade args: [--py36-plus] @@ -9,12 +9,12 @@ repos: hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==20.1.4] + additional_dependencies: [flake8-bugbear==21.4.3] - repo: https://github.com/asottile/blacken-docs - rev: v1.8.0 + rev: v1.10.0 hooks: - id: blacken-docs additional_dependencies: [black==20.8b1] From 74d2a3d4dca13e39bf83217b72cf2eae5c17e11f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 12:12:57 +0000 Subject: [PATCH 58/72] Bump flake8 from 3.9.0 to 3.9.1 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.0 to 3.9.1. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.0...3.9.1) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 748bfa2..6e2c273 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest"], "lint": [ - "flake8==3.9.0", + "flake8==3.9.1", "flake8-bugbear==20.11.1", "pre-commit~=2.7", ], From 81b44cfcc93ca2077e8430ac08062d409a4d4959 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 13:06:15 +0000 Subject: [PATCH 59/72] Bump flake8 from 3.9.1 to 3.9.2 Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.1 to 3.9.2. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.1...3.9.2) Signed-off-by: dependabot-preview[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6e2c273..e9a1f0e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ EXTRAS_REQUIRE = { "tests": ["pytest"], "lint": [ - "flake8==3.9.1", + "flake8==3.9.2", "flake8-bugbear==20.11.1", "pre-commit~=2.7", ], From 953bc376542811bfa6cf66b25123fb14847e4d65 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 13 Dec 2021 00:07:27 +0200 Subject: [PATCH 60/72] Support Python 3.10 (#118) --- .travis.yml | 3 ++- README.rst | 2 +- setup.py | 1 + tox.ini | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a90e10..fc5fcec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,8 @@ jobs: - { python: '3.6', env: TOXENV=py36 } - { python: '3.7', env: TOXENV=py37 } - { python: '3.8', env: TOXENV=py38 } - - { python: '3.9-dev', env: TOXENV=py39 } + - { python: '3.9', env: TOXENV=py39 } + - { python: '3.10-dev', env: TOXENV=py39 } - stage: PyPI Release if: tag IS present diff --git a/README.rst b/README.rst index d09490b..797de48 100644 --- a/README.rst +++ b/README.rst @@ -109,7 +109,7 @@ Changelog ------------------ - Drop support for Python 2.7 and 3.5. -- Test against Python 3.8 and 3.9. +- Test against Python 3.8 to 3.10. 1.2.0 (2018-12-26) ------------------ diff --git a/setup.py b/setup.py index e9a1f0e..bdbb3a1 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ def read(fname): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Software Development :: Documentation", ], py_modules=["sphinx_issues"], diff --git a/tox.ini b/tox.ini index f46efed..a676add 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint,py36,py37,py38,py39 +envlist = lint,py36,py37,py38,py39,py310 [testenv] extras = tests From 4504ddd66df74d7957b750df1e344d771929d220 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 13 Dec 2021 00:07:44 +0200 Subject: [PATCH 61/72] Fix PytestDeprecationWarning: @pytest.yield_fixture is deprecated. (#117) --- test_sphinx_issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_sphinx_issues.py b/test_sphinx_issues.py index a1cf6ab..f4bbbc8 100644 --- a/test_sphinx_issues.py +++ b/test_sphinx_issues.py @@ -19,7 +19,7 @@ import pytest -@pytest.yield_fixture( +@pytest.fixture( params=[ # Parametrize config {"issues_github_path": "marshmallow-code/marshmallow"}, From acac0d32bbe6f7d6316d6d59079c59249ef3c642 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 16 Dec 2021 17:50:52 +0200 Subject: [PATCH 62/72] Test on GitHub Actions (#119) * Test on GitHub Actions * Reduce test matrix --- .github/workflows/lint.yml | 12 ++++++++++++ .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1a7cb24 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: Lint + +on: [push, pull_request, workflow_dispatch] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0328fcf --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: [push, pull_request, workflow_dispatch] + +env: + FORCE_COLOR: 1 + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.6", "3.10"] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: "setup.py" + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U wheel + python -m pip install -U tox + + - name: Tox tests + run: | + tox -e py From 118fa78c41e3b75abe9aa8ac15a75d5b84487ba6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 1 Jan 2022 16:03:39 +0200 Subject: [PATCH 63/72] Support linking to CWEs (#122) * Support linking to CWEs * Update changelog Co-authored-by: Steven Loria --- README.rst | 8 ++++++++ sphinx_issues.py | 21 +++++++++++++++++++++ test_sphinx_issues.py | 14 +++++++++----- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 797de48..eac4bc0 100644 --- a/README.rst +++ b/README.rst @@ -91,6 +91,12 @@ Use the ``:cve:`` role to link to CVEs on https://cve.mitre.org. :cve:`CVE-2018-17175` - Addresses possible vulnerability when... +Use the ``:cwe:`` role to link to CWEs on https://cwe.mitre.org. + +.. code-block:: rst + + :cwe:`CWE-787` - The software writes data past the end, or... + Credits ******* @@ -110,6 +116,8 @@ Changelog - Drop support for Python 2.7 and 3.5. - Test against Python 3.8 to 3.10. +- Add ``:cwe:`` role for linking to CVEs on https://cwe.mitre.org. + Thanks @hugovk for the PR. 1.2.0 (2018-12-26) ------------------ diff --git a/sphinx_issues.py b/sphinx_issues.py index e00edf6..17cf455 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -62,6 +62,27 @@ def cve_role(name, rawtext, text, lineno, inliner, options=None, content=None): return [link], [] +def cwe_role(name, rawtext, text, lineno, inliner, options=None, content=None): + """Sphinx role for linking to a CWE on https://cwe.mitre.org. + + Examples: :: + + :cwe:`CWE-787` + + """ + options = options or {} + content = content or [] + has_explicit_title, title, target = split_explicit_title(text) + + target = utils.unescape(target).strip() + title = utils.unescape(title).strip() + number = target[4:] + ref = f"https://cwe.mitre.org/data/definitions/{number}.html" + text = title if has_explicit_title else target + link = nodes.reference(text=text, refuri=ref, **options) + return [link], [] + + class IssueRole: EXTERNAL_REPO_REGEX = re.compile(r"^(\w+)/(.+)([#@])([\w]+)$") diff --git a/test_sphinx_issues.py b/test_sphinx_issues.py index f4bbbc8..e181dff 100644 --- a/test_sphinx_issues.py +++ b/test_sphinx_issues.py @@ -1,10 +1,6 @@ from tempfile import mkdtemp from shutil import rmtree - -try: - from unittest.mock import Mock -except ImportError: - from unittest.mock import Mock +from unittest.mock import Mock from sphinx.application import Sphinx from sphinx_issues import ( @@ -12,6 +8,7 @@ user_role, pr_role, cve_role, + cwe_role, commit_role, setup as issues_setup, ) @@ -84,6 +81,13 @@ def inliner(app): "CVE-2018-17175", "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-17175", ), + ( + cwe_role, + "cve", + "CWE-787", + "CWE-787", + "https://cwe.mitre.org/data/definitions/787.html", + ), ( commit_role, "commit", From d53dfb48260ac5d0b41fdeca898593e0548dfde1 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 1 Jan 2022 09:06:36 -0500 Subject: [PATCH 64/72] Don't build universal wheels --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index cdd8acf..23ee671 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,9 +2,6 @@ # This includes the license file in the wheel. license_files = LICENSE -[bdist_wheel] -universal = 1 - [flake8] ignore = E203, E266, E501, W503 max-line-length = 90 From a44f071cf5ec54dfca3056a9623ab4fc6c7a3a51 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 1 Jan 2022 09:08:24 -0500 Subject: [PATCH 65/72] Bump version and update changelog --- README.rst | 2 +- sphinx_issues.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index eac4bc0..b9774dd 100644 --- a/README.rst +++ b/README.rst @@ -111,7 +111,7 @@ MIT licensed. See the bundled `LICENSE Date: Sat, 1 Jan 2022 19:24:21 -0500 Subject: [PATCH 66/72] Fix changelog date --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index b9774dd..51aa169 100644 --- a/README.rst +++ b/README.rst @@ -111,7 +111,7 @@ MIT licensed. See the bundled `LICENSE Date: Tue, 11 Jan 2022 03:16:45 +0200 Subject: [PATCH 67/72] Add the CWE role (#123) --- sphinx_issues.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sphinx_issues.py b/sphinx_issues.py index adf2dfe..7ae74d7 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -217,6 +217,7 @@ def setup(app): app.add_role("user", user_role) app.add_role("commit", commit_role) app.add_role("cve", cve_role) + app.add_role("cwe", cwe_role) return { "version": __version__, "parallel_read_safe": True, From b34a337f2e40fcca94aeecb0897dac24af938cac Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Mon, 10 Jan 2022 20:20:28 -0500 Subject: [PATCH 68/72] Remove .travis.yml and update badge (#124) --- .travis.yml | 30 ------------------------------ README.rst | 6 +++--- 2 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fc5fcec..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: python -dist: xenial -cache: pip -install: travis_retry pip install -U tox -script: tox -jobs: - fast_finish: true - - include: - - { python: '3.8', env: TOXENV=lint } - - { python: '3.6', env: TOXENV=py36 } - - { python: '3.7', env: TOXENV=py37 } - - { python: '3.8', env: TOXENV=py38 } - - { python: '3.9', env: TOXENV=py39 } - - { python: '3.10-dev', env: TOXENV=py39 } - - - stage: PyPI Release - if: tag IS present - python: "3.8" - env: [] - install: skip - script: skip - deploy: - provider: pypi - user: sloria - on: - tags: true - distributions: sdist bdist_wheel - password: - secure: D0c2PYyI06+N5/inLaPHkEaM/GVgKVPCBDm2asmQvCTs14ory9KK17cnS+tOmrTNyMzw2tYSvD1Ar5a7MQAfcJ+p2bOnr/UCLqzt98H2LlE/2NJdzQtI3FtNCkhRVx20LK85G8ZWaHCecGIkgGmbIDZ56u1Aj+G16z0PqEz5i7s= diff --git a/README.rst b/README.rst index 51aa169..2720660 100644 --- a/README.rst +++ b/README.rst @@ -6,9 +6,9 @@ sphinx-issues :alt: pypi badge :target: https://pypi.org/project/sphinx-issues/ -.. image:: https://badgen.net/travis/sloria/sphinx-issues - :alt: travis-ci status - :target: https://travis-ci.org/sloria/sphinx-issues +.. image:: https://github.com/OpenASL/HowSignBot/workflows/.github/workflows/test.yml/badge.svg + :alt: github actions status + :target: .github/workflows/test.yml .. image:: https://badgen.net/badge/code%20style/black/000 :target: https://github.com/ambv/black From 2e019f877028ee5d3dfc35165a11ac686dee2150 Mon Sep 17 00:00:00 2001 From: Kound Date: Tue, 11 Jan 2022 02:47:22 +0100 Subject: [PATCH 69/72] Allow customization (#120) * allow custom uris for everything * use sphinx config defaults instead of customs * add tests and documentation for customization features * fix typo * fix travis * fix travis old release * okay travis really only wants -dev officially they support Python 3.10 non dev but it seems they suck https://travis-ci.community/t/add-python-3-10/12220 * add change log for setting * Copy edits; update changelog Co-authored-by: Steven Loria --- README.rst | 87 +++++++++-- sphinx_issues.py | 349 +++++++++++++++++++++++++++++++----------- test_sphinx_issues.py | 137 ++++++++++++++++- 3 files changed, 463 insertions(+), 110 deletions(-) diff --git a/README.rst b/README.rst index 2720660..29e8314 100644 --- a/README.rst +++ b/README.rst @@ -29,8 +29,11 @@ Installation and Configuration pip install sphinx-issues -Add ``sphinx_issues`` to ``extensions`` in your ``conf.py``. If your project is on GitHub, add the ``issues_github_path`` config variable. -Otherwise, use ``issues_uri``, ``issues_pr_uri``, and ``issues_commit_uri``. +Add ``sphinx_issues`` to ``extensions`` in your ``conf.py``. + +The extension has default values for GitHub projects. +Simply set the add the ``issues_default_group_project`` config variable and you are good +to go: .. code-block:: python @@ -42,16 +45,47 @@ Otherwise, use ``issues_uri``, ``issues_pr_uri``, and ``issues_commit_uri``. "sphinx_issues" ] - # GitHub repo + # Path to GitHub repo {group}/{project} (note that `group` is the GitHub user or organization) issues_github_path = "sloria/marshmallow" - # equivalent to - issues_uri = "https://github.com/sloria/marshmallow/issues/{issue}" - issues_pr_uri = "https://github.com/sloria/marshmallow/pull/{pr}" - issues_commit_uri = "https://github.com/sloria/marshmallow/commit/{commit}" + # which is the equivalent to: + issues_uri = "https://github.com/{group}/{project}/issues/{issue}" + issues_prefix = "#" + issues_pr_uri = "https://github.com/{group}/{project}/pull/{pr}" + issues_pr_prefix = "#" + issues_commit_uri = "https://github.com/{group}/{project}/commit/{commit}" + issues_commit_prefix = "@" + issues_user_uri = "https://github.com/{user}" + issues_user_prefix = "@" + +The extension is very configurable and can be used with any kind of +issue tracker. Here is how you could configure it for use +with a custom hosed GitLab instance: + +.. code-block:: python + + # docs/conf.py + + # ... + extensions = [ + # ... + "sphinx_issues" + ] + + # Default repo {group}/{project} of gitlab project + issues_default_group_project = "myteam/super_great_project" + issues_uri = "https://gitlab.company.com/{group}/{project}/-/issues/{issue}" + issues_prefix = "#" + issues_pr_uri = "https://gitlab.company.com/{group}/{project}/-/merge_requests/{pr}" + issues_pr_prefix = "!" + issues_commit_uri = "https://gitlab.company.com/{group}/{project}/-/commit/{commit}" + issues_commit_prefix = "@" + issues_user_uri = "https://gitlab.company.com/{user}" + issues_user_prefix = "@" -Usage -***** + +Usage inside the documentation +****************************** Use the ``:issue:`` and ``:pr:`` roles in your docs like so: @@ -68,28 +102,36 @@ Use the ``:issue:`` and ``:pr:`` roles in your docs like so: Use the ``:user:`` role in your docs to link to user profiles (GitHub by default, but can be configured via the ``issues_user_uri`` config variable). + +Use the ``:commit:`` role to link to commits. + .. code-block:: rst - Thanks to :user:`bitprophet` for the idea! + Fixed in :commit:`6bb9124d5e9dbb2f7b52864c3d8af7feb1b69403`. -You can also use explicit names if you want to use a different name than the github user name: +Use the ``:cve:`` role to link to CVEs on https://cve.mitre.org. .. code-block:: rst - This change is due to :user:`Andreas Mueller `. + :cve:`CVE-2018-17175` - Addresses possible vulnerability when... + +.. code-block:: rst + Thanks to :user:`bitprophet` for the idea! -Use the ``:commit:`` role to link to commits. +You can also use explicit names if you want to use a different name than the github user name: .. code-block:: rst - Fixed in :commit:`6bb9124d5e9dbb2f7b52864c3d8af7feb1b69403`. + This change is due to :user:`Andreas Mueller `. -Use the ``:cve:`` role to link to CVEs on https://cve.mitre.org. +The syntax ``:role:`My custom title ``` works for all roles of this extension. + +It can be also used in combination with a list: .. code-block:: rst - :cve:`CVE-2018-17175` - Addresses possible vulnerability when... + Fix bad bug :issue:`123, (Duplicate) <199>` Use the ``:cwe:`` role to link to CWEs on https://cwe.mitre.org. @@ -111,6 +153,13 @@ MIT licensed. See the bundled `LICENSE `_ +- Allow custom titles for all roles `Issue #116 `_ +- Added setting `issues_default_group_project` as future replacement of `issues_github_path`, to reflect the now to universal nature of the extension + 1.2.0 (2018-12-26) ------------------ diff --git a/sphinx_issues.py b/sphinx_issues.py index 7ae74d7..d5b8c62 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -1,7 +1,9 @@ """A Sphinx extension for linking to your project's issue tracker.""" import re +from typing import Callable, Optional, Tuple from docutils import nodes, utils +from sphinx.config import Config from sphinx.util.nodes import split_explicit_title __version__ = "2.0.0" @@ -9,18 +11,13 @@ __license__ = "MIT" -def user_role(name, rawtext, text, lineno, inliner, options=None, content=None): - """Sphinx role for linking to a user profile. Defaults to linking to - GitHub profiles, but the profile URIS can be configured via the - ``issues_user_uri`` config value. +def cve_role(name, rawtext, text, lineno, inliner, options=None, content=None): + """Sphinx role for linking to a CVE on https://cve.mitre.org. Examples: :: - :user:`sloria` - - Anchor text also works: :: + :cve:`CVE-2018-17175` - :user:`Steven Loria ` """ options = options or {} content = content or [] @@ -28,38 +25,146 @@ def user_role(name, rawtext, text, lineno, inliner, options=None, content=None): target = utils.unescape(target).strip() title = utils.unescape(title).strip() - config = inliner.document.settings.env.app.config - if config.issues_user_uri: - ref = config.issues_user_uri.format(user=target) - else: - ref = f"https://github.com/{target}" - if has_explicit_title: - text = title - else: - text = f"@{target}" - + ref = f"https://cve.mitre.org/cgi-bin/cvename.cgi?name={target}" + text = title if has_explicit_title else target link = nodes.reference(text=text, refuri=ref, **options) return [link], [] -def cve_role(name, rawtext, text, lineno, inliner, options=None, content=None): - """Sphinx role for linking to a CVE on https://cve.mitre.org. - - Examples: :: +GITHUB_USER_RE = re.compile("^https://github.com/([^/]+)/([^/]+)/.*") - :cve:`CVE-2018-17175` +def _get_default_group_and_project( + config: Config, uri_config_option: str +) -> Optional[Tuple[str, str]]: """ - options = options or {} - content = content or [] - has_explicit_title, title, target = split_explicit_title(text) + Get the default group/project or None if not set + """ + old_config = getattr(config, "issues_github_path", None) + new_config = getattr(config, "issues_default_group_project", None) + + if old_config and new_config: + raise ValueError( + "Both 'issues_github_path' and 'issues_default_group_project' are set, even" + " though they define the same setting. " + "Please only define one of these." + ) + group_and_project = new_config or old_config + + if group_and_project: + assert isinstance(group_and_project, str) + try: + group, project = group_and_project.split("/", maxsplit=1) + return group, project + except ValueError as e: + raise ValueError( + "`issues_github_path` or `issues_default_group_project` needs to " + "define a value in the form of `/` " + f"but `{config}` was given." + ) from e + + # If group and project was not set, we need to look for it within the github url + # for backward compatibility + if not group_and_project: + uri = getattr(config, uri_config_option) + if uri: + match = GITHUB_USER_RE.match(uri) + if match: + return match.groups()[0], match.groups()[1] + + return None + + +def _get_placeholder(uri_config_option: str) -> str: + """ + Get the placeholder from the uri_config_option + """ + try: + # i.e. issues_pr_uri -> pr + return uri_config_option[:-4].split("_", maxsplit=1)[1] + except IndexError: + # issues_uri -> issue + return uri_config_option[:-5] + + +def _get_uri_template( + config: Config, + uri_config_option: str, +) -> str: + """ + Get a URL format template that can be filled with user information based + on the given configuration - target = utils.unescape(target).strip() - title = utils.unescape(title).strip() - ref = f"https://cve.mitre.org/cgi-bin/cvename.cgi?name={target}" - text = title if has_explicit_title else target - link = nodes.reference(text=text, refuri=ref, **options) - return [link], [] + The result always contains the following placeholder + - n (the issue number, user, pull request, etc...) + + The result can contain the following other placeholders + - group (same as user in github) + - project + + Examples for possible results: + + - "https://github.com/{group}/{project}/issues/{n}" + + - "https://gitlab.company.com/{group}/{project}/{n}" + + - "https://fancy.issuetrack.com?group={group}&project={project}&issue={n}" + + Raises: + - ValueError if the given uri contains an invalid placeholder + """ + format_string = str(getattr(config, uri_config_option)) + placeholder = _get_placeholder(uri_config_option) + + result = format_string.replace(f"{{{placeholder}}}", "{n}") + + try: + result.format(project="", group="", n="") + except (NameError, KeyError) as e: + raise ValueError( + f"The `{uri_config_option}` option contains invalid placeholders. " + f"Only {{group}}, {{projects}} and {{{placeholder}}} are allowed." + f'Invalid format string: "{format_string}".' + ) from e + return result + + +def _get_uri( + uri_config_option: str, + config: Config, + number: str, + group_and_project: Optional[Tuple[str, str]] = None, +) -> str: + """ + Get a URI based on the given configuration and do some sanity checking + """ + format_string = _get_uri_template(config, uri_config_option) + + url_vars = {"n": number} + + config_group_and_project = _get_default_group_and_project(config, uri_config_option) + if group_and_project: + # Group and Project defined by call + if config_group_and_project: + to_replace = "/".join(config_group_and_project) + if to_replace in format_string: + # Backward compatibility, replace default group/project + # with {group}/{project} + format_string = format_string.replace(to_replace, "{group}/{project}") + (url_vars["group"], url_vars["project"]) = group_and_project + elif config_group_and_project: + # If not defined by call use the default if given + (url_vars["group"], url_vars["project"]) = config_group_and_project + + try: + return format_string.format(**url_vars) + except (NameError, KeyError) as e: + # The format string was checked before, that it contains no additional not + # supported placeholders. So this occur + raise ValueError( + f"The `{uri_config_option}` format `{format_string}` requires a " + f"group/project to be defined in `issues_default_group_project`." + ) from e def cwe_role(name, rawtext, text, lineno, inliner, options=None, content=None): @@ -84,56 +189,72 @@ def cwe_role(name, rawtext, text, lineno, inliner, options=None, content=None): class IssueRole: + # Symbols used to separate and issue/pull request/merge request etc + # i.e + # - group/project#2323 for issues + # - group/project!1234 for merge requests (in gitlab) + # - group/project@adbc1234 for commits + ELEMENT_SEPARATORS = "#@!" - EXTERNAL_REPO_REGEX = re.compile(r"^(\w+)/(.+)([#@])([\w]+)$") + EXTERNAL_REPO_REGEX = re.compile(rf"^(\w+)/(.+)([{ELEMENT_SEPARATORS}])([\w]+)$") def __init__( - self, uri_config_option, format_kwarg, github_uri_template, format_text=None + self, + config_prefix: str, + pre_format_text: Callable[[Config, str], str] = None, ): - self.uri_config_option = uri_config_option - self.format_kwarg = format_kwarg - self.github_uri_template = github_uri_template - self.format_text = format_text or self.default_format_text + self.uri_config = f"{config_prefix}_uri" + self.separator_config = f"{config_prefix}_prefix" + self.pre_format_text = pre_format_text or self.default_pre_format_text @staticmethod - def default_format_text(issue_no): - return f"#{issue_no}" + def default_pre_format_text(config: Config, text: str) -> str: + return text + + def format_text(self, config: Config, issue_no: str) -> str: + """ + Add supported separator in front of the issue or raise an error if invalid + separator is given + """ + separator = getattr(config, self.separator_config) + if separator not in self.ELEMENT_SEPARATORS: + raise ValueError( + f"Option {self.separator_config} has to be one of " + f"{', '.join(self.ELEMENT_SEPARATORS)}." + ) + text = self.pre_format_text(config, issue_no.lstrip(self.ELEMENT_SEPARATORS)) + return f"{separator}{text}" + + def make_node(self, name: str, issue_no: str, config: Config, options=None): + if issue_no in ("-", "0"): + return None - def make_node(self, name, issue_no, config, options=None): - name_map = {"pr": "pull", "issue": "issues", "commit": "commit"} options = options or {} + + has_explicit_title, title, target = split_explicit_title(issue_no) + + if has_explicit_title: + issue_no = str(target) + repo_match = self.EXTERNAL_REPO_REGEX.match(issue_no) - if repo_match: # External repo - username, repo, symbol, issue = repo_match.groups() - if name not in name_map: - raise ValueError(f"External repo linking not supported for :{name}:") - path = name_map.get(name) - ref = "https://github.com/{issues_github_path}/{path}/{n}".format( - issues_github_path=f"{username}/{repo}", path=path, n=issue + + if repo_match: + # External repo + group, project, original_separator, issue_no = repo_match.groups() + text = f"{group}/{project}{self.format_text(config, issue_no)}" + ref = _get_uri( + self.uri_config, + config, + issue_no, + (group, project), ) - formatted_issue = self.format_text(issue).lstrip("#") - text = "{username}/{repo}{symbol}{formatted_issue}".format(**locals()) - link = nodes.reference(text=text, refuri=ref, **options) - return link - - if issue_no not in ("-", "0"): - uri_template = getattr(config, self.uri_config_option, None) - if uri_template: - ref = uri_template.format(**{self.format_kwarg: issue_no}) - elif config.issues_github_path: - ref = self.github_uri_template.format( - issues_github_path=config.issues_github_path, n=issue_no - ) - else: - raise ValueError( - "Neither {} nor issues_github_path " - "is set".format(self.uri_config_option) - ) - issue_text = self.format_text(issue_no) - link = nodes.reference(text=issue_text, refuri=ref, **options) else: - link = None - return link + text = self.format_text(config, issue_no) + ref = _get_uri(self.uri_config, config, issue_no) + if has_explicit_title: + return nodes.reference(text=title, refuri=ref, **options) + else: + return nodes.reference(text=text, refuri=ref, **options) def __call__( self, name, rawtext, text, lineno, inliner, options=None, content=None @@ -153,65 +274,111 @@ def __call__( """Sphinx role for linking to an issue. Must have -`issues_uri` or `issues_github_path` configured in ``conf.py``. +`issues_uri` or `issues_default_group_project` configured in ``conf.py``. Examples: :: :issue:`123` :issue:`42,45` :issue:`sloria/konch#123` """ issue_role = IssueRole( - uri_config_option="issues_uri", - format_kwarg="issue", - github_uri_template="https://github.com/{issues_github_path}/issues/{n}", + config_prefix="issues", ) """Sphinx role for linking to a pull request. Must have -`issues_pr_uri` or `issues_github_path` configured in ``conf.py``. +`issues_pr_uri` or `issues_default_group_project` configured in ``conf.py``. Examples: :: :pr:`123` :pr:`42,45` :pr:`sloria/konch#43` """ pr_role = IssueRole( - uri_config_option="issues_pr_uri", - format_kwarg="pr", - github_uri_template="https://github.com/{issues_github_path}/pull/{n}", + config_prefix="issues_pr", ) -def format_commit_text(sha): +def format_commit_text(config, sha): return sha[:7] """Sphinx role for linking to a commit. Must have -`issues_pr_uri` or `issues_github_path` configured in ``conf.py``. +`issues_commit_uri` or `issues_default_group_project` configured in ``conf.py``. Examples: :: :commit:`123abc456def` :commit:`sloria/konch@123abc456def` """ commit_role = IssueRole( - uri_config_option="issues_commit_uri", - format_kwarg="commit", - github_uri_template="https://github.com/{issues_github_path}/commit/{n}", - format_text=format_commit_text, + config_prefix="issues_commit", + pre_format_text=format_commit_text, ) +"""Sphinx role for linking to a user profile. Defaults to linking to +GitHub profiles, but the profile URIS can be configured via the +``issues_user_uri`` config value. + +Examples: :: + + :user:`sloria` + +Anchor text also works: :: + + :user:`Steven Loria ` +""" +user_role = IssueRole(config_prefix="issues_user") + def setup(app): # Format template for issues URI # e.g. 'https://github.com/sloria/marshmallow/issues/{issue} - app.add_config_value("issues_uri", default=None, rebuild="html") + app.add_config_value( + "issues_uri", + default="https://github.com/{group}/{project}/issues/{issue}", + rebuild="html", + types="[str]", + ) + app.add_config_value("issues_prefix", default="#", rebuild="html", types="[str]") # Format template for PR URI # e.g. 'https://github.com/sloria/marshmallow/pull/{issue} - app.add_config_value("issues_pr_uri", default=None, rebuild="html") + app.add_config_value( + "issues_pr_uri", + default="https://github.com/{group}/{project}/pull/{pr}", + rebuild="html", + types="[str]", + ) + app.add_config_value("issues_pr_prefix", default="#", rebuild="html", types="[str]") # Format template for commit URI # e.g. 'https://github.com/sloria/marshmallow/commits/{commit} - app.add_config_value("issues_commit_uri", default=None, rebuild="html") - # Shortcut for GitHub, e.g. 'sloria/marshmallow' - app.add_config_value("issues_github_path", default=None, rebuild="html") + app.add_config_value( + "issues_commit_uri", + default="https://github.com/{group}/{project}/commit/{commit}", + rebuild="html", + types="[str]", + ) + app.add_config_value( + "issues_commit_prefix", default="@", rebuild="html", types="[str]" + ) + # There is no seperator config as a format_text function is given + + # Default User (Group)/Project eg. 'sloria/marshmallow' + # Called github as the package was working with github only before + app.add_config_value( + "issues_github_path", default=None, rebuild="html", types="[str]" + ) + # Same as above but with new naming to reflect the new functionality + # Only on of both can be set + app.add_config_value( + "issues_default_group_project", default=None, rebuild="html", types="[str]" + ) # Format template for user profile URI # e.g. 'https://github.com/{user}' - app.add_config_value("issues_user_uri", default=None, rebuild="html") + app.add_config_value( + "issues_user_uri", + default="https://github.com/{user}", + rebuild="html", + types="[str]", + ) + app.add_config_value( + "issues_user_prefix", default="@", rebuild="html", types="[str]" + ) app.add_role("issue", issue_role) app.add_role("pr", pr_role) app.add_role("user", user_role) diff --git a/test_sphinx_issues.py b/test_sphinx_issues.py index e181dff..ce00069 100644 --- a/test_sphinx_issues.py +++ b/test_sphinx_issues.py @@ -20,6 +20,7 @@ params=[ # Parametrize config {"issues_github_path": "marshmallow-code/marshmallow"}, + {"issues_default_group_project": "marshmallow-code/marshmallow"}, { "issues_uri": "https://github.com/marshmallow-code/marshmallow/issues/{issue}", "issues_pr_uri": "https://github.com/marshmallow-code/marshmallow/pull/{pr}", @@ -59,6 +60,20 @@ def inliner(app): "#42", "https://github.com/marshmallow-code/marshmallow/issues/42", ), + ( + issue_role, + "issue", + "Hard Issue <42>", + "Hard Issue", + "https://github.com/marshmallow-code/marshmallow/issues/42", + ), + ( + issue_role, + "issue", + "Not my business ", + "Not my business", + "https://github.com/foo/bar/issues/42", + ), ( pr_role, "pr", @@ -92,7 +107,7 @@ def inliner(app): commit_role, "commit", "123abc456def", - "123abc4", + "@123abc4", "https://github.com/marshmallow-code/marshmallow/commit/123abc456def", ), # External issue @@ -130,10 +145,10 @@ def test_roles(inliner, role, role_name, text, expected_text, expected_url): def test_issue_role_multiple(inliner): result = issue_role( - name=None, rawtext="", text="42,43", inliner=inliner, lineno=None + name=None, rawtext="", text="a title <42>,43", inliner=inliner, lineno=None ) link1 = result[0][0] - assert link1.astext() == "#42" + assert link1.astext() == "a title" issue_url = "https://github.com/marshmallow-code/marshmallow/issues/" assert link1.attributes["refuri"] == issue_url + "42" @@ -160,3 +175,119 @@ def test_issue_role_multiple_with_external(inliner): link2 = result[0][2] assert link2.astext() == "sloria/konch#43" assert link2.attributes["refuri"] == "https://github.com/sloria/konch/issues/43" + + +@pytest.fixture +def app_custom_uri(): + src, doctree, confdir, outdir = [mkdtemp() for _ in range(4)] + Sphinx._log = lambda self, message, wfile, nonl=False: None + app = Sphinx( + srcdir=src, confdir=None, outdir=outdir, doctreedir=doctree, buildername="html" + ) + issues_setup(app) + # Stitch together as the sphinx app init() usually does w/ real conf files + app.config._raw_config = { + "issues_default_group_project": "myteam/super_great_project", + "issues_uri": "https://gitlab.company.com/{group}/{project}/-/issues/{issue}", + "issues_prefix": "#", + "issues_pr_uri": "https://gitlab.company.com/{group}/{project}/-/merge_requests/{pr}", + "issues_pr_prefix": "!", + "issues_commit_uri": "https://gitlab.company.com/{group}/{project}/-/commit/{commit}", + "issues_commit_prefix": "@", + "issues_user_uri": "https://gitlab.company.com/{user}", + "issues_user_prefix": "@", + } + try: + app.config.init_values() + except TypeError: + app.config.init_values(lambda x: x) + yield app + [rmtree(x) for x in (src, doctree, confdir, outdir)] + + +@pytest.fixture() +def inliner_custom_uri(app_custom_uri): + return Mock(document=Mock(settings=Mock(env=Mock(app=app_custom_uri)))) + + +@pytest.mark.parametrize( + ("role", "role_name", "text", "expected_text", "expected_url"), + [ + ( + issue_role, + "issue", + "42", + "#42", + "https://gitlab.company.com/myteam/super_great_project/-/issues/42", + ), + ( + issue_role, + "issue", + "Hard Issue <42>", + "Hard Issue", + "https://gitlab.company.com/myteam/super_great_project/-/issues/42", + ), + ( + issue_role, + "issue", + "Not my business ", + "Not my business", + "https://gitlab.company.com/foo/bar/-/issues/42", + ), + ( + pr_role, + "pr", + "42", + "!42", + "https://gitlab.company.com/myteam/super_great_project/-/merge_requests/42", + ), + (user_role, "user", "sloria", "@sloria", "https://gitlab.company.com/sloria"), + ( + user_role, + "user", + "Steven Loria ", + "Steven Loria", + "https://gitlab.company.com/sloria", + ), + ( + commit_role, + "commit", + "123abc456def", + "@123abc4", + "https://gitlab.company.com/myteam/super_great_project/-/commit/123abc456def", + ), + # External issue + ( + issue_role, + "issue", + "sloria/webargs#42", + "sloria/webargs#42", + "https://gitlab.company.com/sloria/webargs/-/issues/42", + ), + # External PR + ( + pr_role, + "pr", + "sloria/webargs#42", + "sloria/webargs!42", + "https://gitlab.company.com/sloria/webargs/-/merge_requests/42", + ), + # External commit + ( + commit_role, + "commit", + "sloria/webargs@abc123def456", + "sloria/webargs@abc123d", + "https://gitlab.company.com/sloria/webargs/-/commit/abc123def456", + ), + ], +) +def test_roles_custom_uri( + inliner_custom_uri, role, role_name, text, expected_text, expected_url +): + result = role( + role_name, rawtext="", text=text, lineno=None, inliner=inliner_custom_uri + ) + link = result[0][0] + assert link.astext() == expected_text + assert link.attributes["refuri"] == expected_url From b2baffeb10f9e0a2f1e12570b843b421357d4179 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Mon, 10 Jan 2022 20:48:52 -0500 Subject: [PATCH 70/72] Bump version, update changelog, update license --- LICENSE | 2 +- README.rst | 5 +---- sphinx_issues.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index f42c016..ad2fc0f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2020 Steven Loria +Copyright 2022 Steven Loria Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.rst b/README.rst index 29e8314..03f37a0 100644 --- a/README.rst +++ b/README.rst @@ -153,7 +153,7 @@ MIT licensed. See the bundled `LICENSE `_ - Allow custom titles for all roles `Issue #116 `_ - Added setting `issues_default_group_project` as future replacement of `issues_github_path`, to reflect the now to universal nature of the extension diff --git a/sphinx_issues.py b/sphinx_issues.py index d5b8c62..a3ac154 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -6,7 +6,7 @@ from sphinx.config import Config from sphinx.util.nodes import split_explicit_title -__version__ = "2.0.0" +__version__ = "3.0.0" __author__ = "Steven Loria" __license__ = "MIT" From 050befdadcd223ac34c94cca6fd46555cffbd253 Mon Sep 17 00:00:00 2001 From: Kound Date: Tue, 11 Jan 2022 17:40:29 +0100 Subject: [PATCH 71/72] Fix "exception: 'in ' requires string as left operand, not type" (#126) * fix type problem add also an integration unit test Fixes https://github.com/sloria/sphinx-issues/issues/125 * Minor fixups; organize tests * Update changelog Co-authored-by: Steven Loria --- README.rst | 5 + setup.py | 2 +- sphinx_issues.py | 22 ++--- tests/source/_static/.gitkeep | 0 tests/source/conf.py | 64 ++++++++++++ tests/source/examples.rst | 7 ++ tests/source/index.rst | 7 ++ .../test_sphinx_issues.py | 97 ++++++++++++++++--- 8 files changed, 175 insertions(+), 29 deletions(-) create mode 100644 tests/source/_static/.gitkeep create mode 100644 tests/source/conf.py create mode 100644 tests/source/examples.rst create mode 100644 tests/source/index.rst rename test_sphinx_issues.py => tests/test_sphinx_issues.py (74%) diff --git a/README.rst b/README.rst index 03f37a0..0eb4572 100644 --- a/README.rst +++ b/README.rst @@ -153,6 +153,11 @@ MIT licensed. See the bundled `LICENSE ' requires string as left operand, not type`. + 3.0.0 (2022-01-10) ------------------ diff --git a/setup.py b/setup.py index bdbb3a1..f847ab6 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ INSTALL_REQUIRES = ["sphinx"] EXTRAS_REQUIRE = { - "tests": ["pytest"], + "tests": ["pytest>=6.2.0"], "lint": [ "flake8==3.9.2", "flake8-bugbear==20.11.1", diff --git a/sphinx_issues.py b/sphinx_issues.py index a3ac154..caa92fc 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -333,40 +333,40 @@ def setup(app): "issues_uri", default="https://github.com/{group}/{project}/issues/{issue}", rebuild="html", - types="[str]", + types=[str], ) - app.add_config_value("issues_prefix", default="#", rebuild="html", types="[str]") + app.add_config_value("issues_prefix", default="#", rebuild="html", types=[str]) # Format template for PR URI # e.g. 'https://github.com/sloria/marshmallow/pull/{issue} app.add_config_value( "issues_pr_uri", default="https://github.com/{group}/{project}/pull/{pr}", rebuild="html", - types="[str]", + types=[str], ) - app.add_config_value("issues_pr_prefix", default="#", rebuild="html", types="[str]") + app.add_config_value("issues_pr_prefix", default="#", rebuild="html", types=[str]) # Format template for commit URI # e.g. 'https://github.com/sloria/marshmallow/commits/{commit} app.add_config_value( "issues_commit_uri", default="https://github.com/{group}/{project}/commit/{commit}", rebuild="html", - types="[str]", + types=[str], ) app.add_config_value( - "issues_commit_prefix", default="@", rebuild="html", types="[str]" + "issues_commit_prefix", default="@", rebuild="html", types=[str] ) # There is no seperator config as a format_text function is given # Default User (Group)/Project eg. 'sloria/marshmallow' # Called github as the package was working with github only before app.add_config_value( - "issues_github_path", default=None, rebuild="html", types="[str]" + "issues_github_path", default=None, rebuild="html", types=[str] ) # Same as above but with new naming to reflect the new functionality # Only on of both can be set app.add_config_value( - "issues_default_group_project", default=None, rebuild="html", types="[str]" + "issues_default_group_project", default=None, rebuild="html", types=[str] ) # Format template for user profile URI # e.g. 'https://github.com/{user}' @@ -374,11 +374,9 @@ def setup(app): "issues_user_uri", default="https://github.com/{user}", rebuild="html", - types="[str]", - ) - app.add_config_value( - "issues_user_prefix", default="@", rebuild="html", types="[str]" + types=[str], ) + app.add_config_value("issues_user_prefix", default="@", rebuild="html", types=[str]) app.add_role("issue", issue_role) app.add_role("pr", pr_role) app.add_role("user", user_role) diff --git a/tests/source/_static/.gitkeep b/tests/source/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/source/conf.py b/tests/source/conf.py new file mode 100644 index 0000000..34e86c7 --- /dev/null +++ b/tests/source/conf.py @@ -0,0 +1,64 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- 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 os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = "sphinx-issues" +copyright = "2022, foobar" +author = "foobar" + + +# -- 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_issues"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- 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 = "alabaster" + +# 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"] + +# +suppress_warnings = ["app.add_node"] + +issues_uri = "https://gitlab.company.com/{group}/{project}/-/issues/{issue}" +issues_prefix = "#" +issues_pr_uri = "https://gitlab.company.com/{group}/{project}/-/merge_requests/{pr}" +issues_pr_prefix = "!" +issues_commit_uri = "https://gitlab.company.com/{group}/{project}/-/commit/{commit}" +issues_commit_prefix = "@" +issues_user_uri = "https://gitlab.company.com/{user}" +issues_user_prefix = "@" +issues_default_group_project = "myteam/super_great_project" diff --git a/tests/source/examples.rst b/tests/source/examples.rst new file mode 100644 index 0000000..d4b4485 --- /dev/null +++ b/tests/source/examples.rst @@ -0,0 +1,7 @@ +Examples: + + - See issues :issue:`12,13` + + - See other issues :issue:`sloria/konch#45,46`. + + - See PR :pr:`58`, thanks :user:`kound` diff --git a/tests/source/index.rst b/tests/source/index.rst new file mode 100644 index 0000000..f0737e9 --- /dev/null +++ b/tests/source/index.rst @@ -0,0 +1,7 @@ + +Welcome to sphinx-issues's documentation! +========================================= + + +.. include:: examples.rst +.. include:: ../README.rst diff --git a/test_sphinx_issues.py b/tests/test_sphinx_issues.py similarity index 74% rename from test_sphinx_issues.py rename to tests/test_sphinx_issues.py index ce00069..98f380c 100644 --- a/test_sphinx_issues.py +++ b/tests/test_sphinx_issues.py @@ -1,19 +1,18 @@ -from tempfile import mkdtemp +import subprocess +import sys +from pathlib import Path from shutil import rmtree +from tempfile import mkdtemp from unittest.mock import Mock -from sphinx.application import Sphinx -from sphinx_issues import ( - issue_role, - user_role, - pr_role, - cve_role, - cwe_role, - commit_role, - setup as issues_setup, -) - import pytest +import sphinx.application +from sphinx_issues import commit_role, cve_role, cwe_role, issue_role, pr_role +from sphinx_issues import setup as issues_setup +from sphinx_issues import user_role + + +BASE_DIR = Path(__file__).parent.absolute() @pytest.fixture( @@ -30,8 +29,8 @@ ) def app(request): src, doctree, confdir, outdir = [mkdtemp() for _ in range(4)] - Sphinx._log = lambda self, message, wfile, nonl=False: None - app = Sphinx( + sphinx.application.Sphinx._log = lambda self, message, wfile, nonl=False: None + app = sphinx.application.Sphinx( srcdir=src, confdir=None, outdir=outdir, doctreedir=doctree, buildername="html" ) issues_setup(app) @@ -180,8 +179,8 @@ def test_issue_role_multiple_with_external(inliner): @pytest.fixture def app_custom_uri(): src, doctree, confdir, outdir = [mkdtemp() for _ in range(4)] - Sphinx._log = lambda self, message, wfile, nonl=False: None - app = Sphinx( + sphinx.application.Sphinx._log = lambda self, message, wfile, nonl=False: None + app = sphinx.application.Sphinx( srcdir=src, confdir=None, outdir=outdir, doctreedir=doctree, buildername="html" ) issues_setup(app) @@ -291,3 +290,69 @@ def test_roles_custom_uri( link = result[0][0] assert link.astext() == expected_text assert link.attributes["refuri"] == expected_url + + +@pytest.fixture +def tmp_doc_build_folder(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: + """Generate a temporary source folder and chdir in it. Return the build folder""" + source = tmp_path / "source" + build = tmp_path / "build" + static = source / "_static" + for folder in (source, build, static): + folder.mkdir() + conf_py = BASE_DIR / "source" / "conf.py" + examples_rst = BASE_DIR / "source" / "examples.rst" + + source.joinpath("conf.py").write_bytes(conf_py.read_bytes()) + source.joinpath("index.rst").write_bytes(examples_rst.read_bytes()) + + monkeypatch.chdir(source) + return build + + +def test_sphinx_build_integration(tmp_doc_build_folder: Path): + """Ensure that a simulated complete sphinx run works as expected""" + subprocess.run( + [ + Path(sys.executable).parent.joinpath("sphinx-build"), + "-b", + "html", + "-W", # turn warnings into errors + "-E", # force rebuild of environment (even if we work in tmp) + ".", + str(tmp_doc_build_folder), + ], + check=True, + ) + + created = tmp_doc_build_folder / "index.html" + assert created.exists() and created.is_file() + content = created.read_text() + issue_url = "https://gitlab.company.com/myteam/super_great_project/-/issues/" + other_issue_url = "https://gitlab.company.com/sloria/konch/-/issues/" + pr_url = "https://gitlab.company.com/myteam/super_great_project/-/merge_requests/" + user_url = "https://gitlab.company.com/" + + # We could do something fancy like an HTML parser or regex: + # Instead we keep it simple + expected_strings = ( + ( + f"See issues " + f'#12, ' + f'#13' + ), + ( + f"See other issues " + f'sloria/konch#45,' + f' #46' + ), + ( + f'See PR !58, ' + f'thanks @kound' + ), + ) + # Ensure that we do no check character wise but line wise + assert len(expected_strings) == 3 + + for expected in expected_strings: + assert expected in content From 223b8e023904806cd90cff89faf1839150ba511f Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 11 Jan 2022 11:41:13 -0500 Subject: [PATCH 72/72] Bump version and update changelog --- README.rst | 2 +- sphinx_issues.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 0eb4572..150a922 100644 --- a/README.rst +++ b/README.rst @@ -153,7 +153,7 @@ MIT licensed. See the bundled `LICENSE ' requires string as left operand, not type`. diff --git a/sphinx_issues.py b/sphinx_issues.py index caa92fc..e5a69c6 100644 --- a/sphinx_issues.py +++ b/sphinx_issues.py @@ -6,7 +6,7 @@ from sphinx.config import Config from sphinx.util.nodes import split_explicit_title -__version__ = "3.0.0" +__version__ = "3.0.1" __author__ = "Steven Loria" __license__ = "MIT"