diff --git a/LICENSE b/LICENSE index 2eac1c3..6a2e3d6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -MIT License Copyright (c) 2018-2023 Manuel Barkhau (mbarkhau@gmail.com) +MIT License Copyright (c) 2018-2024 Manuel Barkhau (mbarkhau@gmail.com) 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/pyproject.toml b/pyproject.toml index 56d3f79..7dd6a02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,8 @@ [project] name = "bumpver" description = "Bump version numbers in project files." -keywords=[ +readme = {file = "README.md", content-type = "text/markdown"} +keywords = [ "version", "bumpver", "calver", @@ -10,7 +11,7 @@ keywords=[ "bumpversion pep440", ] version = "2023.1129" -license = "MIT" +license = {file = "LICENSE"} requires-python = ">=3.9" authors = [ {"author" = "Manuel Barkhau", "email" = "mbarkhau@gmail.com"}, @@ -39,16 +40,13 @@ dependencies = [ "toml>=0.10.2", "typing>=3.10.0.0", ] +[project.urls] +homepage = "https://github.com/mbarkhau/bumpver" +repository = "https://github.com/mbarkhau/bumpver" +[project.scripts] # CLI +bumpver = "bumpver.cli:cli" -[tool.ruff] -line-length = 110 -indent-width = 4 - -[tool.ruff.format] -quote-style = "single" -indent-style = "space" -docstring-code-format = true [dependency-groups] dev = [ @@ -91,6 +89,158 @@ integration = [ "straitjacket>=202008.1016", "twine>=5.1.1", "types-click>=7.1.8", - "types-setuptools>=75.3.0.20241107", "types-toml>=0.10.8.20240310", ] + +[tool.ruff] +line-length = 110 +indent-width = 4 + +[tool.ruff.format] +quote-style = "single" +indent-style = "space" +docstring-code-format = true + + +[tool.mypy] +check_untyped_defs = true +disallow_untyped_calls = true +follow_imports = "silent" +strict_optional = true +error_summary = false +ignore_missing_imports = true +show_error_codes = true +warn_unreachable = true +warn_return_any = true +warn_unused_ignores = true +warn_redundant_casts = true + + +[tool.isort] +known_first_party = "bumpver" +known_third_party = ["click","lexid", "packaging"] +force_single_line = true +length_sort = true + + +[flake8] +max-line-length = 100 +max-complexity = 12 +ignore = [ + "C812", # Missing trailing comma (handled by sjfmt) + "E201", # No whitespace after paren open "(" + "E202", # No whitespace before paren ")" + "E203", # Whitespace before ":" + "E221", # Multiple spaces before operator + "E222", # Multiple spaces after operand + "E231", # Missing whitespace after ',' + "E241", # Multiple spaces after ':' + "E251", # Spaces around keyword/parameter equals + "E272", # Multiple spaces before keyword + "E501", # Line too long (B950 is used instead) + "W503", # Line break before binary op + "W504", # Line break after binary op + "D100", # Missing docstring in public module + "D101", # Missing docstring in public class + "D102", # Missing docstring in public method + "D103", # Missing docstring in public function + + # D104, # Missing docstring in public package + # D105, # Missing docstring in magic method + "D107", # Missing docstring on __init__ + "D202", # No blank lines allowed after function docstring + "D400", # First line should end in a period + "D401", # First line should be in imperative mood +] +select = ["A","AAA","D","C","E","F","W","H","B","D212","D404","D405","D406","B901","B950","YTT"] +exclude = [".git", "__pycache__", ".eggs/", "dist/", ".mypy_cache"] + + +[tool.pylint] +score = false +reports = false +jobs = 4 + +# Set the output format. Available formats are text, parseable, colorized, +# msvs (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format = "colorized" + +# Maximum number of locals for function / method body +max-locals = 17 + +# Maximum number of arguments for function / method +max-args = 9 + +# Maximum number of branch for function / method body +max-branches = 14 + +good-names = ["logger","i","ex"] + +# These are packages that are implemented as c extensions and +# which pylint cannot do introspection on. +extension-pkg-whitelist = ["numpy","pandas","lxml","PIL","sklearn","pyblake2"] +notes = ["TODO","FIXME","XXX","SLOW","BUG"] + +# similarities/duplicaition checker +min-similarity-lines = 4 +ignore-comments = true +ignore-docstrings = true +ignore-imports = true + +ignored-argument-names = ["args", "kwargs"] + +# https://pylint.pycqa.org/en/stable/technical_reference/features.html +disable = [ + "bad-continuation", + "bad-whitespace", + "line-too-long", + "logging-not-lazy", + "logging-fstring-interpolation", + "no-else-return", + "no-else-raise", + "too-few-public-methods", + "missing-docstring", + "missing-module-docstring", + "missing-class-docstring", + "missing-function-docstring", + "raise-missing-from", + "duplicate-code", + "ungrouped-imports", +] + +generated-members = [ + "(_replace|_asdict|_fields)", # members of typing.NamedTuple +] + + +[tool.pytest] +addopts = [ + "--doctest-modules", + "--ignore", + "test/fixtures/hooks", + "--ignore", + "compat_test/fixtures/hooks", +] + + +[bumpver] +current_version = "2023.1129" +version_pattern = "YYYY.BUILD[-TAG]" +commit_message = "bump {old_version} -> {new_version}" +commit = true +tag = true +push = true + +[bumpver.file_patterns] +"bootstrapit.sh" = 'PACKAGE_VERSION="{version}"' +"setup.cfg" = 'current_version = "{version}"' +"pyproject.toml" = 'current_version = "{version}"' +"setup.py" = 'version="{pep440_version}",$' +"src/bumpver/__init__.py" = '^__version__ = "{version}"$' +"src/bumpver/cli.py" = '@click.version_option(version="{version}")' +"README.md" = [ + # "\[CalVer {version}\]", + "img.shields.io/static/v1.svg?label=CalVer&message={version}&color=blue", + "Successfully installed bumpver-{pep440_version}", +] diff --git a/requirements/development.txt b/requirements/development.txt deleted file mode 100644 index f729ddc..0000000 --- a/requirements/development.txt +++ /dev/null @@ -1,51 +0,0 @@ -# These dependencies are installed using: -# -# pip install --upgrade -# -# This list should only contain packages related to -# local development and debugging. It should not contain -# any packages required for production, building or packaging - -# PuDB is a full-screen, console-based visual debugger for Python. -# https://documen.tician.de/pudb/ -pudb - -# Quick-and-dirty debugging output for tired programmers -# https://pypi.org/project/q/ -q - -# pretty-traceback manipulates Python tracebacks to make -# them more readable. -# https://pypi.org/project/pretty-traceback/ -pretty-traceback - -# Py-Spy: A sampling profiler for Python programs. -# https://github.com/benfred/py-spy -# This is good for coarse grained profiling (even on production) -py-spy - -# SNAKEVIZ : A browser based viewer for the output of Python’s cProfile. -# https://jiffyclub.github.io/snakeviz/ -# This is good for fine grained profiling (function level/micro optimizations) -snakeviz - -# I've yet to find a decent memory profiler for python, feel free to -# add one after you've tested it and found it to be actually useful. - -ipython # nuff said - - -# A command line utility to display dependency tree of the installed Python packages -# https://github.com/naiquevin/pipdeptree -# -# For graph output you will need to: -# $ sudo apt install -y graphviz -# $ pipdeptree --graph-output svg > requirements/tree.svg -pipdeptree -graphviz - -# run failed tests first -pytest-cache - -# to update the readme examples -rich diff --git a/requirements/integration.txt b/requirements/integration.txt deleted file mode 100644 index db80116..0000000 --- a/requirements/integration.txt +++ /dev/null @@ -1,53 +0,0 @@ -# These dependencies are installed using: -# -# pip install --upgrade -# -# This file should only declare dependencies related to code -# formatting, linting, testing and packaging. -# -# No dependencies required for production should be listed here. - -# http://www.pydocstyle.org/en/4.0.0/release_notes.html -# Support for Python 2.x and PyPy has been dropped (#340). -pydocstyle<4 - -pip -flake8 -flake8-bugbear -flake8-docstrings -flake8-builtins -flake8-comprehensions -flake8-junit-report -flake8-2020 -pylint==2.12.1 -pylint-ignore>=2020.1013 -isort - -mypy==1.4.1 -mypy-extensions==1.0.0 -types-setuptools -types-toml -types-click - -# http://doc.pytest.org/en/latest/py27-py34-deprecation.html -# The pytest 4.6 series will be the last to support Python 2.7 -# and 3.4, and is scheduled to be released by mid-2019. -# pytest 5.0 and onwards will support only Python 3.5+. -pytest; python_version >= "3.5" -pytest<5.0; python_version < "3.5" -pytest-cov -# https://github.com/pytest-dev/pytest-html/blob/master/CHANGES.rst -# pytest-html 2.0+ doesn't support python2.7 -pytest-html<2.0; python_version < "3.5" -pytest-html==3.2; python_version >= "3.5" - -readme_renderer[md] -twine - -md-toc -straitjacket>=v202008.1016 -pycalver -lib3to6 - -# needed for mypy coverage report -lxml diff --git a/requirements/pypi.txt b/requirements/pypi.txt deleted file mode 100644 index 22000b9..0000000 --- a/requirements/pypi.txt +++ /dev/null @@ -1,17 +0,0 @@ -# These dependencies are installed using: -# -# pip install --upgrade -# -# This list is the default package list. All pure python packages -# for the production environment at runtime should be listed here. -# Binary (non-pure) packages may also be listed here, but you -# should see if there is a conda package that suits your needs. - -pathlib2; python_version < "3.4" -typing; python_version < "3.5" -click<8.0; python_version < "3.6" -click; python_version >= "3.6" -toml -lexid -colorama>=0.4 -enum34; python_version < "3.4" diff --git a/requirements/vendor.txt b/requirements/vendor.txt deleted file mode 100644 index 56ad1a1..0000000 --- a/requirements/vendor.txt +++ /dev/null @@ -1,23 +0,0 @@ -# These dependencies are installed using: -# -# pip install --upgrade -# pip install --upgrade --no-deps --target vendor/ -# -# Vendored dependencies are installed both in the virtual -# environment as well as in the vendor/ directory. This way: -# -# 1. All transitive dependencies of a package are installed in -# the virtualenv (in the first installation step) -# 2. If there is a binary version of the package available, it -# will be installed into the virtualenv -# 3. In the third step only (--no-deps) the source version of -# the (--no-binary) package is installed to vendor/ -# -# This allows us to: -# -# 1. Enable mypy to check modules of multiple packages. -# 2. Easily navigate to the source of a vendored dependency -# 3. Use binary versions packages instead of source versions of -# packages, simply by not including the vendor/ directory in -# the PYTHONPATH. The version from the virtualenv will then -# be loaded instead. diff --git a/setup.cfg b/setup.cfg index 2e7b69f..788d04c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ warn_redundant_casts = True [tool:isort] known_first_party = bumpver -known_third_party = click,pathlib2,lexid,pkg_resources +known_third_party = click,lexid force_single_line = True length_sort = True @@ -107,10 +107,6 @@ src/bumpver/__init__.py = ^__version__ = "{version}"$ src/bumpver/cli.py = @click.version_option(version="{version}") -LICENSE = - Copyright (c) 2018-YYYY -license.header = - Copyright (c) 2018-YYYY README.md = \[CalVer {version}\] img.shields.io/static/v1.svg?label=CalVer&message={version}&color=blue diff --git a/src/bumpver/config.py b/src/bumpver/config.py index fd5e7c6..824b53e 100644 --- a/src/bumpver/config.py +++ b/src/bumpver/config.py @@ -13,7 +13,7 @@ import toml -from bumpver import pathlib as pl +import pathlib as pl from . import utils from . import version diff --git a/src/bumpver/hooks.py b/src/bumpver/hooks.py index 6c9bb57..098135f 100644 --- a/src/bumpver/hooks.py +++ b/src/bumpver/hooks.py @@ -9,7 +9,7 @@ import logging import subprocess as sp -from bumpver import pathlib as pl +import pathlib as pl logger = logging.getLogger("bumpver.hooks") diff --git a/src/bumpver/pathlib.py b/src/bumpver/pathlib.py deleted file mode 100644 index d0505d9..0000000 --- a/src/bumpver/pathlib.py +++ /dev/null @@ -1,12 +0,0 @@ -# This file is part of the bumpver project -# https://github.com/mbarkhau/bumpver -# -# Copyright (c) 2018-2024 Manuel Barkhau (mbarkhau@gmail.com) - MIT License -# SPDX-License-Identifier: MIT - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path # type: ignore - -__all__ = ['Path'] diff --git a/src/bumpver/rewrite.py b/src/bumpver/rewrite.py index b6cf026..c72d831 100644 --- a/src/bumpver/rewrite.py +++ b/src/bumpver/rewrite.py @@ -6,7 +6,7 @@ import typing as typ import difflib -from bumpver import pathlib as pl +import pathlib as pl from . import config from .patterns import Pattern