diff --git a/README.md b/README.md index e43b7725..a05dca7f 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,34 @@ Release 8. Run `scripts/enable_log_statements.sh` or `git reset --hard` to restore the working dir. 9. Bump up to the next development version in `pynvim/_version.py`, with `prerelease` suffix `dev0`. +### Releasing with bump-my-version + +`bump-my-version` automates the process of updating version strings, creating git commits, and tagging releases. + +1. **Install `bump-my-version`:** + If you haven't already, install the development dependencies: + ```bash + pip install .[dev] + ``` + +2. **Bump the version:** + To increment the version, use one of the following commands: + * **Patch release:** `bump-my-version bump patch` (e.g., `0.6.1` -> `0.6.2`) + * **Minor release:** `bump-my-version bump minor` (e.g., `0.6.1` -> `0.7.0`) + * **Major release:** `bump-my-version bump major` (e.g., `0.6.1` -> `1.0.0`) + + This command will: + * Update the `version` in `pyproject.toml`. + * Update the `VERSION` in `pynvim/_version.py`. + * Create a git commit with a message like "Bump version: 0.6.1 → 0.6.2". + * Create a git tag (e.g., `v0.6.2`). + +3. **Push changes and tags:** + After bumping the version, push the commit and the new tag to your remote repository: + ```bash + git push --follow-tags + ``` + License ------- diff --git a/pyproject.toml b/pyproject.toml index 7fd26b97..ad4db359 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,84 @@ [build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" \ No newline at end of file +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pynvim" +version = "0.6.1.dev0" +description = "Python client for Neovim" +readme = "README.md" +license = { text = "Apache-2.0" } +authors = [ + { name = "Neovim Authors" } +] +requires-python = ">=3.7" +dependencies = [ + "msgpack>=1.0.0", + "greenlet>=3.0; python_implementation != 'PyPy'", + "typing-extensions>=4.5; python_version < '3.12'", +] + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", +] + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-timeout", +] +docs = [ + "sphinx", + "sphinx-rtd-theme", +] +dev = [ + "bump-my-version", +] + +[project.scripts] +pynvim-python = "pynvim.python:main" + +[project.urls] +Homepage = "https://github.com/neovim/pynvim" +Download = "https://github.com/neovim/pynvim/archive/refs/tags/0.6.1.dev0.tar.gz" +Documentation = "https://pynvim.readthedocs.io" + +# Configuration for bumpversion / bump-my-version +[tool.bumpversion] +current_version = "0.6.1.dev0" +commit = true +tag = true + +# Regex that captures major/minor/patch/prerelease (prerelease optional) +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:\\.(?P[a-zA-Z]+\\d*))?" +serialize = [ + "{major}.{minor}.{patch}.{prerelease}", + "{major}.{minor}.{patch}" +] + +# Update the version in pyproject.toml +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'version = "{current_version}"' +replace = 'version = "{new_version}"' + +# Update the version in pynvim/_version.py (non-hardcoded) +[[tool.bumpversion.files]] +filename = "pynvim/_version.py" +search = 'VERSION = SimpleNamespace(major={current_major}, minor={current_minor}, patch={current_patch}, prerelease="{current_prerelease}")' +replace = 'VERSION = SimpleNamespace(major={new_major}, minor={new_minor}, patch={new_patch}, prerelease="{new_prerelease}")' + +# Update the download URL in pyproject.toml +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'Download = "https://github.com/neovim/pynvim/archive/refs/tags/{current_version}.tar.gz"' +replace = 'Download = "https://github.com/neovim/pynvim/archive/refs/tags/{new_version}.tar.gz"'