Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdaae82

Browse files
authored
build/dist: modernize pyproject.toml #600
* chore: update pyproject.toml with project metadata and dependencies * chore: update pyproject.toml to include additional dependencies and improve metadata * chore: update version to 0.6.1.dev0 and modify bumpversion configuration * docs: add instructions for releasing with bump-my-version
1 parent c59abe4 commit fdaae82

File tree

2 files changed

+111
-2
lines changed

2 files changed

+111
-2
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,34 @@ Release
155155
8. Run `scripts/enable_log_statements.sh` or `git reset --hard` to restore the working dir.
156156
9. Bump up to the next development version in `pynvim/_version.py`, with `prerelease` suffix `dev0`.
157157

158+
### Releasing with bump-my-version
159+
160+
`bump-my-version` automates the process of updating version strings, creating git commits, and tagging releases.
161+
162+
1. **Install `bump-my-version`:**
163+
If you haven't already, install the development dependencies:
164+
```bash
165+
pip install .[dev]
166+
```
167+
168+
2. **Bump the version:**
169+
To increment the version, use one of the following commands:
170+
* **Patch release:** `bump-my-version bump patch` (e.g., `0.6.1` -> `0.6.2`)
171+
* **Minor release:** `bump-my-version bump minor` (e.g., `0.6.1` -> `0.7.0`)
172+
* **Major release:** `bump-my-version bump major` (e.g., `0.6.1` -> `1.0.0`)
173+
174+
This command will:
175+
* Update the `version` in `pyproject.toml`.
176+
* Update the `VERSION` in `pynvim/_version.py`.
177+
* Create a git commit with a message like "Bump version: 0.6.1 → 0.6.2".
178+
* Create a git tag (e.g., `v0.6.2`).
179+
180+
3. **Push changes and tags:**
181+
After bumping the version, push the commit and the new tag to your remote repository:
182+
```bash
183+
git push --follow-tags
184+
```
185+
158186
License
159187
-------
160188

pyproject.toml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,84 @@
11
[build-system]
2-
requires = ["setuptools"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pynvim"
7+
version = "0.6.1.dev0"
8+
description = "Python client for Neovim"
9+
readme = "README.md"
10+
license = { text = "Apache-2.0" }
11+
authors = [
12+
{ name = "Neovim Authors" }
13+
]
14+
requires-python = ">=3.7"
15+
dependencies = [
16+
"msgpack>=1.0.0",
17+
"greenlet>=3.0; python_implementation != 'PyPy'",
18+
"typing-extensions>=4.5; python_version < '3.12'",
19+
]
20+
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.7",
25+
"Programming Language :: Python :: 3.8",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"License :: OSI Approved :: Apache Software License",
31+
"Operating System :: OS Independent",
32+
]
33+
34+
[project.optional-dependencies]
35+
test = [
36+
"pytest",
37+
"pytest-timeout",
38+
]
39+
docs = [
40+
"sphinx",
41+
"sphinx-rtd-theme",
42+
]
43+
dev = [
44+
"bump-my-version",
45+
]
46+
47+
[project.scripts]
48+
pynvim-python = "pynvim.python:main"
49+
50+
[project.urls]
51+
Homepage = "https://github.com/neovim/pynvim"
52+
Download = "https://github.com/neovim/pynvim/archive/refs/tags/0.6.1.dev0.tar.gz"
53+
Documentation = "https://pynvim.readthedocs.io"
54+
55+
# Configuration for bumpversion / bump-my-version
56+
[tool.bumpversion]
57+
current_version = "0.6.1.dev0"
58+
commit = true
59+
tag = true
60+
61+
# Regex that captures major/minor/patch/prerelease (prerelease optional)
62+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:\\.(?P<prerelease>[a-zA-Z]+\\d*))?"
63+
serialize = [
64+
"{major}.{minor}.{patch}.{prerelease}",
65+
"{major}.{minor}.{patch}"
66+
]
67+
68+
# Update the version in pyproject.toml
69+
[[tool.bumpversion.files]]
70+
filename = "pyproject.toml"
71+
search = 'version = "{current_version}"'
72+
replace = 'version = "{new_version}"'
73+
74+
# Update the version in pynvim/_version.py (non-hardcoded)
75+
[[tool.bumpversion.files]]
76+
filename = "pynvim/_version.py"
77+
search = 'VERSION = SimpleNamespace(major={current_major}, minor={current_minor}, patch={current_patch}, prerelease="{current_prerelease}")'
78+
replace = 'VERSION = SimpleNamespace(major={new_major}, minor={new_minor}, patch={new_patch}, prerelease="{new_prerelease}")'
79+
80+
# Update the download URL in pyproject.toml
81+
[[tool.bumpversion.files]]
82+
filename = "pyproject.toml"
83+
search = 'Download = "https://github.com/neovim/pynvim/archive/refs/tags/{current_version}.tar.gz"'
84+
replace = 'Download = "https://github.com/neovim/pynvim/archive/refs/tags/{new_version}.tar.gz"'

0 commit comments

Comments
 (0)