Skip to content

cz bump fails when running with rye #1118

Open
@my1e5

Description

@my1e5

Description

I'm using rye to manage my python project - it's similar to poetry. Running cz bump through rye gives

$ rye run cz bump
fatal: not a git repository (or any of the parent directories): .git

Steps to reproduce

Similar to poetry, we add commitizen as a dev dependency.

$ rye add commitizen --dev

Then

$ rye run cz init
Welcome to commitizen!

Answer the questions to configure your project.
For further configuration visit:

https://commitizen-tools.github.io/commitizen/config/

? Please choose a supported config file:  pyproject.toml
? Please choose a cz (commit rule): (default: cz_conventional_commits) cz_conventional_commits
? Choose the source of the version: pep621: Get and set version from pyproject.toml:project.version field
No Existing Tag. Set tag to v0.0.1
? Choose version scheme:  pep440
? Please enter the correct version format: (default: "$version")
? Create changelog automatically on bump Yes
? Keep major version zero (0.x) during breaking changes Yes
? What types of pre-commit hook you want to install? (Leave blank if you don't want to install) done

You can bump the version running:

        cz bump

Configuration complete 🚀

Current behavior

The way to run a script/executable you've added to your python project is using rye run

$ rye run cz bump
fatal: not a git repository (or any of the parent directories): .git

Is this because cz.exe is stored in .venv/Scripts/cz.exe?

So it can't find the .git folder which is two levels above?

Desired behavior

No fatal errors. cz is able to find the .git repo.

Screenshots

No response

Environment

$ rye run cz version
3.25.0
$ rye run python --version
Python 3.12.2
$ rye --version
rye 0.33.0
commit: 0.33.0 (58523f69f 2024-04-24)
platform: windows (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions