mtkennerly / poetry-dynamic-versioning

Plugin for Poetry to enable dynamic versioning based on VCS tags
MIT License
588 stars 36 forks source link

poetry version should not try to open files for writing #129

Closed BlackZork closed 1 year ago

BlackZork commented 1 year ago

I am using $(poetry version) in bash scripts and it needs write access to pyproject.toml to get version.

Checked with systrace:

openat(AT_FDCWD, "/myproject/pyproject.toml", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)

I expect poetry version to work if I have only have read only access to all files in project directory.

mtkennerly commented 1 year ago

I'll check if I can make a special case for the version command, but this plugin does rely heavily on being able to temporarily modify pyproject.toml, so it's not really going to work well in a read-only environment. Out of curiosity, what's your use case that involves a read-only copy of a repository?

BlackZork commented 1 year ago

I have test environment where services are deployed in editable mode (i.e. by poetry install). Bugs are resolved with comment 'fixed in 1.4.2dev34' and services are updated by git pull & restart. Tester checks service version using poetry version before validating a fix.

Tester has read-only access to test environment.

In any shared environment there is a need to just check current version. People with read-only access should be able to do so.

mtkennerly commented 1 year ago

This is now changed in v0.24.0.