From b7ae972529f79b332b4fd1f31ac10276ae5deaf7 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Sun, 23 Apr 2023 10:31:04 +0800 Subject: [PATCH 1/4] build: update dev dependencies to latest versions --- poetry.lock | 58 +++++++++++++++++++++++++++++++------------------- pyproject.toml | 4 ++-- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8baf850d3a..25de3092d8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry and should not be changed by hand. [[package]] name = "appnope" @@ -45,32 +45,46 @@ files = [ [[package]] name = "black" -version = "22.12.0" +version = "23.3.0" description = "The uncompromising code formatter." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "black-22.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eedd20838bd5d75b80c9f5487dbcb06836a43833a37846cf1d8c1cc01cef59d"}, - {file = "black-22.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:159a46a4947f73387b4d83e87ea006dbb2337eab6c879620a3ba52699b1f4351"}, - {file = "black-22.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d30b212bffeb1e252b31dd269dfae69dd17e06d92b87ad26e23890f3efea366f"}, - {file = "black-22.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:7412e75863aa5c5411886804678b7d083c7c28421210180d67dfd8cf1221e1f4"}, - {file = "black-22.12.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c116eed0efb9ff870ded8b62fe9f28dd61ef6e9ddd28d83d7d264a38417dcee2"}, - {file = "black-22.12.0-cp37-cp37m-win_amd64.whl", hash = "sha256:1f58cbe16dfe8c12b7434e50ff889fa479072096d79f0a7f25e4ab8e94cd8350"}, - {file = "black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77d86c9f3db9b1bf6761244bc0b3572a546f5fe37917a044e02f3166d5aafa7d"}, - {file = "black-22.12.0-cp38-cp38-win_amd64.whl", hash = "sha256:82d9fe8fee3401e02e79767016b4907820a7dc28d70d137eb397b92ef3cc5bfc"}, - {file = "black-22.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:101c69b23df9b44247bd88e1d7e90154336ac4992502d4197bdac35dd7ee3320"}, - {file = "black-22.12.0-cp39-cp39-win_amd64.whl", hash = "sha256:559c7a1ba9a006226f09e4916060982fd27334ae1998e7a38b3f33a37f7a2148"}, - {file = "black-22.12.0-py3-none-any.whl", hash = "sha256:436cc9167dd28040ad90d3b404aec22cedf24a6e4d7de221bec2730ec0c97bcf"}, - {file = "black-22.12.0.tar.gz", hash = "sha256:229351e5a18ca30f447bf724d007f890f97e13af070bb6ad4c0a441cd7596a2f"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2"}, + {file = "black-23.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c"}, + {file = "black-23.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d"}, + {file = "black-23.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70"}, + {file = "black-23.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326"}, + {file = "black-23.3.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b"}, + {file = "black-23.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2"}, + {file = "black-23.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5"}, + {file = "black-23.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961"}, + {file = "black-23.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266"}, + {file = "black-23.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab"}, + {file = "black-23.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb"}, + {file = "black-23.3.0-py3-none-any.whl", hash = "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4"}, + {file = "black-23.3.0.tar.gz", hash = "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940"}, ] [package.dependencies] click = ">=8.0.0" mypy-extensions = ">=0.4.3" +packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} @@ -684,14 +698,14 @@ min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-imp [[package]] name = "mkdocs-material" -version = "9.1.6" +version = "9.1.7" description = "Documentation that simply works" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "mkdocs_material-9.1.6-py3-none-any.whl", hash = "sha256:f2eb1d40db89da9922944833c1387207408f8937e1c2b46ab86e0c8f170b71e0"}, - {file = "mkdocs_material-9.1.6.tar.gz", hash = "sha256:2e555152f9771646bfa62dc78a86052876183eff69ce30db03a33e85702b21fc"}, + {file = "mkdocs_material-9.1.7-py3-none-any.whl", hash = "sha256:4ab0e2f378bb811ca44a001a63d687403a2725f0485c41d6a2a7aed3aa34cd31"}, + {file = "mkdocs_material-9.1.7.tar.gz", hash = "sha256:244f85d13e3aa773aaa66c74b95bb4b00d89a3a917f6f9d33704a5655bf0c423"}, ] [package.dependencies] @@ -1350,14 +1364,14 @@ files = [ [[package]] name = "setuptools" -version = "67.7.0" +version = "67.7.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.7.0-py3-none-any.whl", hash = "sha256:888be97fde8cc3afd60f7784e678fa29ee13c4e5362daa7104a93bba33646c50"}, - {file = "setuptools-67.7.0.tar.gz", hash = "sha256:b7e53a01c6c654d26d2999ee033d8c6125e5fa55f03b7b193f937ae7ac999f22"}, + {file = "setuptools-67.7.1-py3-none-any.whl", hash = "sha256:6f0839fbdb7e3cfef1fc38d7954f5c1c26bf4eebb155a55c9bf8faf997b9fb67"}, + {file = "setuptools-67.7.1.tar.gz", hash = "sha256:bb16732e8eb928922eabaa022f881ae2b7cdcfaf9993ef1f5e841a96d32b8e0c"}, ] [package.extras] @@ -1612,4 +1626,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "f5be12ccd079062886c8c5eaa4874d8c3af509a82088106993e7bf1ee5ea00be" +content-hash = "27556d720c055b9180edf34e1657c08bf092b855d5724e95055fbf2020335c14" diff --git a/pyproject.toml b/pyproject.toml index 525061485a..2b5e87ed6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,9 +58,9 @@ pytest-cov = "^4.0" pytest-mock = "^3.10" pytest-regressions = "^2.4.0" pytest-freezer = "^0.4.6" -pytest-xdist = "^3.1.0" +pytest-xdist = "^3.2.1" # code formatter -black = "^22.10" +black = "^23.3.0" # linter ruff = "^0.0.262" pre-commit = "^2.6.0" From c900cf435540e29df11c88f2096dd0549eed2a99 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Sun, 23 Apr 2023 10:32:42 +0800 Subject: [PATCH 2/4] ci(docspublish): update peaceiris/actions-gh-pages to v3 --- .github/workflows/docspublish.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docspublish.yaml b/.github/workflows/docspublish.yaml index 98af4ad189..1a261737b9 100644 --- a/.github/workflows/docspublish.yaml +++ b/.github/workflows/docspublish.yaml @@ -26,8 +26,8 @@ jobs: run: | python -m mkdocs build - name: Push doc to Github Page - uses: peaceiris/actions-gh-pages@v2 + uses: peaceiris/actions-gh-pages@v3 env: - PERSONAL_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: ./site + personal_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + publish_branch: gh-pages + publish_dir: ./site From 9464623759840c27b3f2017c7dda4ac18751e47e Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Sun, 23 Apr 2023 10:50:56 +0800 Subject: [PATCH 3/4] style: format codebase with the latest black --- commitizen/bump.py | 2 -- commitizen/git.py | 1 - tests/commands/test_changelog_command.py | 4 ---- tests/commands/test_check_command.py | 1 - 4 files changed, 8 deletions(-) diff --git a/commitizen/bump.py b/commitizen/bump.py index c405414e87..dcb6f770de 100644 --- a/commitizen/bump.py +++ b/commitizen/bump.py @@ -23,7 +23,6 @@ def find_increment( commits: List[GitCommit], regex: str, increments_map: Union[dict, OrderedDict] ) -> Optional[str]: - if isinstance(increments_map, dict): increments_map = OrderedDict(increments_map) @@ -103,7 +102,6 @@ def semver_generator(current_version: str, increment: str = None) -> str: # so it doesn't matter the increment. # Example: 1.0.0a0 with PATCH/MINOR -> 1.0.0 if not version.is_prerelease: - if increment == MAJOR: increments_version[MAJOR] += 1 increments_version[MINOR] = 0 diff --git a/commitizen/git.py b/commitizen/git.py index 2c2cb5b368..f7277bf3c5 100644 --- a/commitizen/git.py +++ b/commitizen/git.py @@ -74,7 +74,6 @@ def date(self): @classmethod def from_line(cls, line: str, inner_delimiter: str) -> "GitTag": - name, objectname, date, obj = line.split(inner_delimiter) if not obj: obj = objectname diff --git a/tests/commands/test_changelog_command.py b/tests/commands/test_changelog_command.py index bdc384c3ca..dfa135c765 100644 --- a/tests/commands/test_changelog_command.py +++ b/tests/commands/test_changelog_command.py @@ -115,7 +115,6 @@ def test_changelog_replacing_unreleased_using_incremental( def test_changelog_is_persisted_using_incremental( mocker: MockFixture, capsys, changelog_path, file_regression ): - create_file_and_commit("feat: add new output") create_file_and_commit("fix: output glitch") create_file_and_commit("Merge into master") @@ -519,7 +518,6 @@ def test_breaking_change_content_v1_multiline( def test_changelog_config_flag_increment( mocker: MockFixture, changelog_path, config_path, file_regression ): - with open(config_path, "a") as f: f.write("changelog_incremental = true\n") with open(changelog_path, "a") as f: @@ -576,7 +574,6 @@ def test_changelog_config_flag_merge_prerelease( def test_changelog_config_start_rev_option( mocker: MockFixture, capsys, config_path, file_regression ): - # create commit and tag create_file_and_commit("feat: new file") testargs = ["cz", "bump", "--yes"] @@ -738,7 +735,6 @@ def test_changelog_incremental_with_merge_prerelease( def test_changelog_with_filename_as_empty_string( mocker: MockFixture, changelog_path, config_path ): - with open(config_path, "a") as f: f.write("changelog_file = true\n") diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index 9e9182e6f2..126f56eb41 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -223,7 +223,6 @@ def test_check_command_with_invalid_argument(config): @pytest.mark.usefixtures("tmp_commitizen_project") def test_check_command_with_empty_range(config, mocker: MockFixture): - # must initialize git with a commit create_file_and_commit("feat: initial") From f1e2b94d51e2a7cafb3d983f56767d91a174f3ac Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Sun, 23 Apr 2023 10:56:58 +0800 Subject: [PATCH 4/4] build(pre-commit): fix config typo --- .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 0aeaa4d0b2..96795df86f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,6 @@ repos: name: linter and test language: system pass_filenames: false - stage: push + stages: [push] entry: ./scripts/test types: [python]