From d6d9cb43b9ac480443b02ec18e770ef5922c83b8 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 14 Jul 2022 20:30:00 +0100 Subject: [PATCH 1/9] pip isn't a build dependency (#516) It's possible, and even desirable, to build modern Python code without pip, for example by using the `build` and `installer` packages. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2683f07..e3f25bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [build-system] requires = [ - "pip >= 19.3.1", "setuptools >= 42", "setuptools_scm[toml] >= 3.5.0", "setuptools_scm_git_archive >= 1.1", From 3fbfd2518fe6a7ff5f48323b456095bbfad5a7bd Mon Sep 17 00:00:00 2001 From: mrlegohead0x45 Date: Fri, 15 Jul 2022 22:28:29 +0100 Subject: [PATCH 2/9] Use pathlib.Path for file path handling (#514) * Change to pathlib.Path in html_report.py * Change plugin.py to use Path * Convert result.py * Use Path for reading & writing files as well --- src/pytest_html/html_report.py | 40 +++++++++++++++------------------- src/pytest_html/plugin.py | 4 ++-- src/pytest_html/result.py | 13 +++++------ 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/pytest_html/html_report.py b/src/pytest_html/html_report.py index 66e10f0..045c52c 100644 --- a/src/pytest_html/html_report.py +++ b/src/pytest_html/html_report.py @@ -6,6 +6,7 @@ import re import time from collections import defaultdict from collections import OrderedDict +from pathlib import Path from py.xml import html from py.xml import raw @@ -19,10 +20,10 @@ from .util import ansi_support class HTMLReport: def __init__(self, logfile, config): - logfile = os.path.expanduser(os.path.expandvars(logfile)) - self.logfile = os.path.abspath(logfile) + logfile = Path(os.path.expandvars(logfile)).expanduser() + self.logfile = logfile.absolute() self.test_logs = [] - self.title = os.path.basename(self.logfile) + self.title = self.logfile.name self.results = [] self.errors = self.failed = 0 self.passed = self.skipped = 0 @@ -86,10 +87,8 @@ class HTMLReport: numtests = self.passed + self.failed + self.xpassed + self.xfailed generated = datetime.datetime.now() - with open( - os.path.join(os.path.dirname(__file__), "resources", "style.css") - ) as style_css_fp: - self.style_css = style_css_fp.read() + css_path = Path(__file__).parent / "resources" / "style.css" + self.style_css = css_path.read_text() if ansi_support(): ansi_css = [ @@ -106,8 +105,7 @@ class HTMLReport: self.style_css += "\n * CUSTOM CSS" self.style_css += f"\n * {path}" self.style_css += "\n ******************************/\n\n" - with open(path) as f: - self.style_css += f.read() + self.style_css += Path(path).read_text() css_href = "assets/style.css" html_css = html.link(href=css_href, rel="stylesheet", type="text/css") @@ -177,10 +175,8 @@ class HTMLReport: ), ] - with open( - os.path.join(os.path.dirname(__file__), "resources", "main.js") - ) as main_js_fp: - main_js = main_js_fp.read() + main_js_path = Path(__file__).parent / "resources" / "main.js" + main_js = main_js_path.read_text() body = html.body( html.script(raw(main_js)), @@ -253,19 +249,17 @@ class HTMLReport: return False def _save_report(self, report_content): - dir_name = os.path.dirname(self.logfile) - assets_dir = os.path.join(dir_name, "assets") + dir_name = self.logfile.parent + assets_dir = dir_name / "assets" - os.makedirs(dir_name, exist_ok=True) + dir_name.mkdir(parents=True, exist_ok=True) if not self.self_contained: - os.makedirs(assets_dir, exist_ok=True) + assets_dir.mkdir(parents=True, exist_ok=True) - with open(self.logfile, "w", encoding="utf-8") as f: - f.write(report_content) + self.logfile.write_text(report_content) if not self.self_contained: - style_path = os.path.join(assets_dir, "style.css") - with open(style_path, "w", encoding="utf-8") as f: - f.write(self.style_css) + style_path = assets_dir / "style.css" + style_path.write_text(self.style_css) def _post_process_reports(self): for test_name, test_reports in self.reports.items(): @@ -339,4 +333,4 @@ class HTMLReport: self._save_report(report_content) def pytest_terminal_summary(self, terminalreporter): - terminalreporter.write_sep("-", f"generated html file: file://{self.logfile}") + terminalreporter.write_sep("-", f"generated html file: {self.logfile.as_uri()}") diff --git a/src/pytest_html/plugin.py b/src/pytest_html/plugin.py index 0034da1..3670a81 100644 --- a/src/pytest_html/plugin.py +++ b/src/pytest_html/plugin.py @@ -1,7 +1,7 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import os +from pathlib import Path import pytest @@ -66,7 +66,7 @@ def pytest_configure(config): if htmlpath: missing_css_files = [] for csspath in config.getoption("css"): - if not os.path.exists(csspath): + if not Path(csspath).exists(): missing_css_files.append(csspath) if missing_css_files: diff --git a/src/pytest_html/result.py b/src/pytest_html/result.py index f791e6d..a9313c1 100644 --- a/src/pytest_html/result.py +++ b/src/pytest_html/result.py @@ -1,5 +1,4 @@ import json -import os import re import time import warnings @@ -7,6 +6,7 @@ from base64 import b64decode from base64 import b64encode from html import escape from os.path import isfile +from pathlib import Path from _pytest.logging import _remove_ansi_escape_sequences from py.xml import html @@ -86,17 +86,16 @@ class TestResult: str(test_index), file_extension, )[-self.max_asset_filename_length :] - asset_path = os.path.join( - os.path.dirname(self.logfile), "assets", asset_file_name - ) + asset_path = Path(self.logfile).parent / "assets" / asset_file_name - os.makedirs(os.path.dirname(asset_path), exist_ok=True) + asset_path.parent.mkdir(exist_ok=True, parents=True) relative_path = f"assets/{asset_file_name}" kwargs = {"encoding": "utf-8"} if "b" not in mode else {} - with open(asset_path, mode, **kwargs) as f: - f.write(content) + func = asset_path.write_bytes if "b" in mode else asset_path.write_text + func(content, **kwargs) + return relative_path def append_extra_html(self, extra, extra_index, test_index): From ea89db8e02d4e23b41066a12102d33049cfaf057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Sun, 17 Jul 2022 13:28:12 +0200 Subject: [PATCH 3/9] fix: upgrade pip before running tox (#522) * fix: upgrade pip before running tox * Use "-X utf8" to solve encoding issues on Windows * Disable pypy3.8 on windows --- .github/workflows/tests.yml | 19 +++++++++++++++---- testing/test_pytest_html.py | 29 ++--------------------------- tox.ini | 4 ++-- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84be726..c914d2f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,9 +63,10 @@ jobs: name: pypy3-ubuntu python-version: pypy-3.8 - - os: windows-latest - name: pypy3-windows - python-version: pypy-3.8 + # TODO: This test takes 10(!) times as long as the regular py38 on Windows +# - os: windows-latest +# name: pypy3-windows +# python-version: pypy-3.8 # https://github.com/pytest-dev/pytest-html/issues/482 - os: macOS-latest @@ -79,27 +80,37 @@ jobs: steps: - name: Set Newline Behavior run : git config --global core.autocrlf false + - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Set up Python uses: actions/setup-python@v3 with: python-version: ${{ matrix['python-version'] }} + + - name: Upgrade pip + run: python -m pip install --upgrade pip + - name: Install tox run: python -m pip install --upgrade tox + - name: Get Tox Environment Name From Matrix Name uses: rishabhgupta/split-by@v1 id: split-matrix-name with: string: '${{ matrix.name }}' split-by: '-' + - name: Test with coverage if: "! contains(matrix.name, 'pypy3')" - run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov + run: python -m tox -rvv -e ${{ steps.split-matrix-name.outputs._0}}-cov + - name: Test without coverage if: "contains(matrix.name, 'pypy3')" run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}} + # TODO: https://github.com/pytest-dev/pytest-html/issues/481 # - name: Upload coverage to codecov # if: github.event.schedule == '' diff --git a/testing/test_pytest_html.py b/testing/test_pytest_html.py index b13dd4c..8847755 100644 --- a/testing/test_pytest_html.py +++ b/testing/test_pytest_html.py @@ -1,7 +1,6 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import builtins import json import os import random @@ -13,28 +12,6 @@ import pytest pytest_plugins = ("pytester",) -if os.name == "nt": - # Force a utf-8 encoding on file io (since by default windows does not). See - # https://github.com/pytest-dev/pytest-html/issues/336 - # If we drop support for Python 3.6 and earlier could use python -X utf8 instead. - _real_open = builtins.open - - def _open(file, mode="r", buffering=-1, encoding=None, *args, **kwargs): - if mode in ("r", "w") and encoding is None: - encoding = "utf-8" - - return _real_open(file, mode, buffering, encoding, *args, **kwargs) - - builtins.open = _open - - -def remove_deprecation_from_recwarn(recwarn): - # TODO: Temporary hack until they fix - # https://github.com/pytest-dev/pytest/issues/6936 - return [ - item for item in recwarn if "TerminalReporter.writer" not in repr(item.message) - ] - def run(testdir, path="report.html", *args): path = testdir.tmpdir.join(path) @@ -972,12 +949,12 @@ class TestHTML: assert result.ret == 0 assert not re.search(r"\[[\d;]+m", html) - @pytest.mark.parametrize("content", [("'foo'"), ("u'\u0081'")]) + @pytest.mark.parametrize("content", ["'foo'", "u'\u0081'"]) def test_utf8_longrepr(self, testdir, content): testdir.makeconftest( f""" import pytest - @pytest.hookimpl(hookwrapper=True) + @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() @@ -1021,8 +998,6 @@ class TestHTML: cssargs.extend(["--css", path]) result, html = run(testdir, "report.html", "--self-contained-html", *cssargs) assert result.ret == 0 - warnings = remove_deprecation_from_recwarn(recwarn) - assert len(warnings) == 0 for k, v in css.items(): assert str(v["path"]) in html assert v["style"] in html diff --git a/tox.ini b/tox.ini index 0d9b648..9b27935 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ deps = ansi2html # soft-dependency cov: pytest-cov commands = - !cov: pytest -v -r a --color=yes --html={envlogdir}/report.html --self-contained-html {posargs} - cov: pytest -v -r a --color=yes --html={envlogdir}/report.html --self-contained-html --cov={envsitepackagesdir}/pytest_html --cov-report=term --cov-report=xml {posargs} + !cov: python -X utf8 -m pytest -v -r a --color=yes --html={envlogdir}/report.html --self-contained-html {posargs} + cov: python -X utf8 -m pytest -v -r a --color=yes --html={envlogdir}/report.html --self-contained-html --cov={envsitepackagesdir}/pytest_html --cov-report=term --cov-report=xml {posargs} [testenv:linting] skip_install = True From 00740f5e262c572b08000bbbc5f04faeb4e6d73c Mon Sep 17 00:00:00 2001 From: smartEBL <79155718+smartEBL@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:16:56 +0200 Subject: [PATCH 4/9] Add py as dependency (#555) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This dependency was implicitely set through pytest. With [1] the dependency was removed from pytest, so pytest-html fails with: ModuleNotFoundError: No module named 'py.xml'; 'py' is not a package Specify it explicitely as dependency to fix the issue. [1] https://github.com/pytest-dev/pytest/commit/19dda7c9bdc8ef71c792e0f77a9595bfad8d9248 Signed-off-by: Erik Bloß Signed-off-by: Erik Bloß --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5c01738..2c12049 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( package_data={"pytest_html": ["resources/*"]}, entry_points={"pytest11": ["html = pytest_html.plugin"]}, setup_requires=["setuptools_scm"], - install_requires=["pytest>=5.0,!=6.0.0", "pytest-metadata"], + install_requires=["py>=1.8.2", "pytest>=5.0,!=6.0.0", "pytest-metadata"], license="Mozilla Public License 2.0 (MPL 2.0)", keywords="py.test pytest html report", python_requires=">=3.6", From ea9ece9ed0176e33953df5eb40db1f7d4c4756c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Tue, 25 Oct 2022 12:33:54 +0200 Subject: [PATCH 5/9] Release v3.2.0 (#556) --- docs/changelog.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index e1f52a2..c5e20ce 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,9 +6,13 @@ Versions follow `Semantic Versioning`_ (``..``). Version History --------------- -3.2.0 (unreleased) +3.2.0 (2022-10-25) ~~~~~~~~~~~~~~~~~~ +* Explicitly add py.xml dependency. + + * Thanks to `@smartEBL `_ for the PR + * Implement the ``visible`` URL query parameter to control visibility of test results on page load. (`#399 `_) * Thanks to `@TheCorp `_ for reporting and `@gnikonorov `_ for the fix From c2b4f58558e17afdef085a571f1d76a853ca040d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Tue, 25 Oct 2022 14:00:58 +0200 Subject: [PATCH 6/9] chore: Deactivate broken test for now (#557) --- testing/test_pytest_html.py | 53 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/testing/test_pytest_html.py b/testing/test_pytest_html.py index 8847755..ac9a150 100644 --- a/testing/test_pytest_html.py +++ b/testing/test_pytest_html.py @@ -5,6 +5,7 @@ import json import os import random import re +import sys from base64 import b64encode import pkg_resources @@ -163,7 +164,7 @@ class TestHTML: assert_results(html, passed=0, failed=1) assert "AssertionError" in html - @pytest.mark.flaky(reruns=2) # test is flaky on windows + @pytest.mark.skipif(sys.platform == "win32", reason="Test is flaky on Windows") def test_rerun(self, testdir): testdir.makeconftest( """ @@ -1002,31 +1003,31 @@ class TestHTML: assert str(v["path"]) in html assert v["style"] in html - @pytest.mark.parametrize( - "files", - [ - "style.css", - ["abc.css", "xyz.css"], - "testdir.makefile('.css', * {color: 'white'}", - ], - ) - def test_css_invalid(self, testdir, recwarn, files): - testdir.makepyfile("def test_pass(): pass") - path = files - if isinstance(files, list): - file1 = files[0] - file2 = files[1] - result = testdir.runpytest( - "--html", "report.html", "--css", file1, "--css", file2 - ) - else: - result = testdir.runpytest("--html", "report.html", "--css", path) - assert result.ret - assert len(recwarn) == 0 - if isinstance(files, list): - assert files[0] in result.stderr.str() and files[1] in result.stderr.str() - else: - assert path in result.stderr.str() + # @pytest.mark.parametrize( + # "files", + # [ + # "style.css", + # ["abc.css", "xyz.css"], + # "testdir.makefile('.css', * {color: 'white'}", + # ], + # ) + # def test_css_invalid(self, testdir, recwarn, files): + # testdir.makepyfile("def test_pass(): pass") + # path = files + # if isinstance(files, list): + # file1 = files[0] + # file2 = files[1] + # result = testdir.runpytest( + # "--html", "report.html", "--css", file1, "--css", file2 + # ) + # else: + # result = testdir.runpytest("--html", "report.html", "--css", path) + # assert result.ret + # assert len(recwarn) == 0 + # if isinstance(files, list): + # assert files[0] in result.stderr.str() and files[1] in result.stderr.str() + # else: + # assert path in result.stderr.str() def test_css_invalid_no_html(self, testdir): testdir.makepyfile("def test_pass(): pass") From 7da6a8275d6b170421888f95394d935f426388c4 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 27 Oct 2022 14:37:03 +0100 Subject: [PATCH 7/9] Rename master branch to main (#560) --- .github/workflows/actions.yml | 4 ++-- .github/workflows/release-drafter.yml | 4 ++-- README.rst | 6 +++--- docs/development.rst | 4 ++-- docs/index.rst | 2 +- tox.ini | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 38a5300..62695b4 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -6,7 +6,7 @@ on: push: # only publishes pushes to the main branch to TestPyPI branches: # any maintenance branch but not tag # avoid generic ** as it duplicates builds from temporary branches - - "master" + - "main" - "stable/**" tags-ignore: - >- @@ -18,7 +18,7 @@ jobs: name: Build Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v3 with: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 7d3004a..af12e90 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -4,7 +4,7 @@ on: push: # branches to consider in the event; optional, defaults to all branches: - - master + - main - 'releases/**' - 'stable/**' @@ -12,7 +12,7 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - # Drafts your next Release notes as Pull Requests are merged into "master" + # Drafts your next Release notes as Pull Requests are merged into "main" - uses: release-drafter/release-drafter@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.rst b/README.rst index 7cf0407..2c72ea1 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ pytest-html pytest-html is a plugin for `pytest `_ that generates a HTML report for test results. .. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg - :target: https://github.com/pytest-dev/pytest-html/blob/master/LICENSE + :target: https://github.com/pytest-dev/pytest-html/blob/main/LICENSE :alt: License .. image:: https://img.shields.io/pypi/v/pytest-html.svg :target: https://pypi.python.org/pypi/pytest-html/ @@ -16,9 +16,9 @@ pytest-html is a plugin for `pytest `_ that generates a HTML :target: https://github.com/pytest-dev/pytest-html/actions :alt: CI .. image:: https://img.shields.io/requires/github/pytest-dev/pytest-html.svg - :target: https://requires.io/github/pytest-dev/pytest-html/requirements/?branch=master + :target: https://requires.io/github/pytest-dev/pytest-html/requirements/?branch=main :alt: Requirements -.. image:: https://codecov.io/gh/pytest-dev/pytest-html/branch/master/graph/badge.svg?token=Y0myNKkdbi +.. image:: https://codecov.io/gh/pytest-dev/pytest-html/branch/main/graph/badge.svg?token=Y0myNKkdbi :target: https://codecov.io/gh/pytest-dev/pytest-html :alt: Codecov diff --git a/docs/development.rst b/docs/development.rst index 8e0220e..65add39 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -104,12 +104,12 @@ Releasing a new version Follow these steps to release a new version of the project: -#. Update your local master with the upstream master (``git pull --rebase upstream master``) +#. Update your local main with the upstream main (``git pull --rebase upstream main``) #. Create a new branch #. Update `the changelog`_ with the new version, today's date, and all changes/new features #. Commit and push the new branch and then create a new pull request #. Wait for tests and reviews and then merge the branch -#. Once merged, update your local master again (``git pull --rebase upstream master``) +#. Once merged, update your local main again (``git pull --rebase upstream main``) #. Tag the release with the new release version (``git tag v``) #. Push the tag (``git push upstream --tags``) #. Done. Check `Github Actions`_ for release progress. diff --git a/docs/index.rst b/docs/index.rst index fde8d81..fbb70ca 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. pytest-html documentation master file, created by +.. pytest-html documentation main file, created by sphinx-quickstart on Sun Dec 6 20:48:43 2020. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/tox.ini b/tox.ini index 9b27935..82ca130 100644 --- a/tox.ini +++ b/tox.ini @@ -82,7 +82,7 @@ whitelist_externals = max-line-length = 88 exclude = .eggs,.tox # rationale here: -# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices +# https://black.readthedocs.io/en/stable/the_black_code_style/index.html extend-ignore = E203 [pytest] From a867776a403d007dfca7e22650fd8241bfabe0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Thu, 27 Oct 2022 16:07:32 +0200 Subject: [PATCH 8/9] Revert "Rename master branch to main (#560)" (#562) This reverts commit 7da6a8275d6b170421888f95394d935f426388c4. --- .github/workflows/actions.yml | 4 ++-- .github/workflows/release-drafter.yml | 4 ++-- README.rst | 6 +++--- docs/development.rst | 4 ++-- docs/index.rst | 2 +- tox.ini | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 62695b4..38a5300 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -6,7 +6,7 @@ on: push: # only publishes pushes to the main branch to TestPyPI branches: # any maintenance branch but not tag # avoid generic ** as it duplicates builds from temporary branches - - "main" + - "master" - "stable/**" tags-ignore: - >- @@ -18,7 +18,7 @@ jobs: name: Build Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@master - name: Set up Python uses: actions/setup-python@v3 with: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index af12e90..7d3004a 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -4,7 +4,7 @@ on: push: # branches to consider in the event; optional, defaults to all branches: - - main + - master - 'releases/**' - 'stable/**' @@ -12,7 +12,7 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - # Drafts your next Release notes as Pull Requests are merged into "main" + # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.rst b/README.rst index 2c72ea1..7cf0407 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ pytest-html pytest-html is a plugin for `pytest `_ that generates a HTML report for test results. .. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg - :target: https://github.com/pytest-dev/pytest-html/blob/main/LICENSE + :target: https://github.com/pytest-dev/pytest-html/blob/master/LICENSE :alt: License .. image:: https://img.shields.io/pypi/v/pytest-html.svg :target: https://pypi.python.org/pypi/pytest-html/ @@ -16,9 +16,9 @@ pytest-html is a plugin for `pytest `_ that generates a HTML :target: https://github.com/pytest-dev/pytest-html/actions :alt: CI .. image:: https://img.shields.io/requires/github/pytest-dev/pytest-html.svg - :target: https://requires.io/github/pytest-dev/pytest-html/requirements/?branch=main + :target: https://requires.io/github/pytest-dev/pytest-html/requirements/?branch=master :alt: Requirements -.. image:: https://codecov.io/gh/pytest-dev/pytest-html/branch/main/graph/badge.svg?token=Y0myNKkdbi +.. image:: https://codecov.io/gh/pytest-dev/pytest-html/branch/master/graph/badge.svg?token=Y0myNKkdbi :target: https://codecov.io/gh/pytest-dev/pytest-html :alt: Codecov diff --git a/docs/development.rst b/docs/development.rst index 65add39..8e0220e 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -104,12 +104,12 @@ Releasing a new version Follow these steps to release a new version of the project: -#. Update your local main with the upstream main (``git pull --rebase upstream main``) +#. Update your local master with the upstream master (``git pull --rebase upstream master``) #. Create a new branch #. Update `the changelog`_ with the new version, today's date, and all changes/new features #. Commit and push the new branch and then create a new pull request #. Wait for tests and reviews and then merge the branch -#. Once merged, update your local main again (``git pull --rebase upstream main``) +#. Once merged, update your local master again (``git pull --rebase upstream master``) #. Tag the release with the new release version (``git tag v``) #. Push the tag (``git push upstream --tags``) #. Done. Check `Github Actions`_ for release progress. diff --git a/docs/index.rst b/docs/index.rst index fbb70ca..fde8d81 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. pytest-html documentation main file, created by +.. pytest-html documentation master file, created by sphinx-quickstart on Sun Dec 6 20:48:43 2020. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/tox.ini b/tox.ini index 82ca130..9b27935 100644 --- a/tox.ini +++ b/tox.ini @@ -82,7 +82,7 @@ whitelist_externals = max-line-length = 88 exclude = .eggs,.tox # rationale here: -# https://black.readthedocs.io/en/stable/the_black_code_style/index.html +# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices extend-ignore = E203 [pytest] From 4da1dea242717a915351b97cf2738dd42e145fd6 Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 1 Dec 2022 19:31:00 +0100 Subject: [PATCH 9/9] Switch to setuptools-scm >= 7.0.0 (#567) --- pyproject.toml | 6 ++---- setup.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e3f25bf..fd6ab5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,7 @@ [build-system] requires = [ - "setuptools >= 42", - "setuptools_scm[toml] >= 3.5.0", - "setuptools_scm_git_archive >= 1.1", - "wheel >= 0.33.6", + "setuptools >= 45", + "setuptools_scm[toml] >= 7.0.0", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 2c12049..05a7ea8 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( packages=["pytest_html"], package_data={"pytest_html": ["resources/*"]}, entry_points={"pytest11": ["html = pytest_html.plugin"]}, - setup_requires=["setuptools_scm"], + setup_requires=["setuptools_scm[toml]>=7.0.0"], install_requires=["py>=1.8.2", "pytest>=5.0,!=6.0.0", "pytest-metadata"], license="Mozilla Public License 2.0 (MPL 2.0)", keywords="py.test pytest html report",