astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.82k stars 467 forks source link

`rye version` doesn't respect `dynamic = ['version']` setting #1028

Open Aran-Fey opened 7 months ago

Aran-Fey commented 7 months ago

Steps to Reproduce

  1. Create a pyproject.toml with dynamic versioning:
    [project]
    dynamic = ["version"]
  2. Use rye version -b to bump the version:
    rye version -b patch

Expected Result

The version gets bumped in the correct place, similar to what hatch version would do.

Actual Result

The version gets written to the pyproject.toml file, resulting in:

[project]
dynamic = ["version"]
version = "1.2.3"

Version Info

rye 0.32.0 commit: 0.32.0 (e1b4f2a29 2024-03-29) platform: windows (x86_64) self-python: cpython@3.12.2 symlink support: true uv enabled: true

Stacktrace

No response

ssteinerx commented 6 months ago

You have to use the hatch versioning mechanisms if you want to use dynamic versioning. Versioning - Hatch

They work fine.

Would be better if rye just wrapped them.

inean commented 3 months ago

You have to use the hatch versioning mechanisms if you want to use dynamic versioning. Versioning - Hatch

Rye use internal build capabilities if no building system is specified (added with rye add -d hatch), so right know is the only way to support dynamic versioning. This is really an enhancement to rye IMHO