Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand Down
85 changes: 83 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is wheel required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including wheel is a best practice that ensures your project can be built into the modern, faster-installing wheel format, while not strictly necessary to build a basic source distribution, it's a key part of the modern Python packaging ecosystem.

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<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:\\.(?P<prerelease>[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"'
Loading