sync-version

Sync __version__ in __init__.py with version in pyproject.toml


License
MIT
Install
pip install sync-version==0.1.4

Documentation

sync-version

pytestpythonCode style: blackLicense: MITPyPI version

sync version in pyproject.toml (if pyproject.toml does not have version info, then version in package.json) with version in init.py

Install it

pip install sync-version

# or pip install git+https://github.com/ffreemt/sync-version
# poetry add git+https://github.com/ffreemt/sync-version
# git clone https://github.com/ffreemt/sync-version && cd sync-version

Use it

poetry version prerelease
sync-version  # or python -m sync_version

poetry version patch
sync-version  # or python -m sync_version

# dry-run
sync-version --dry-run

# debug and dry-run
sync-version --debug --dry-run

Typical workflow

poetry version prerelease
# yarn version --new-version 0.1.5ax, for example, if necessary

sync-version  # update __version__ in module_name/__init__.py

git add . && git commit -m "Update ..."
git push

poetry build  # or pdm build
poetry publish  # or pdm publish --no-build or twine upload --skip=existing dist\*