update/
Scripts for version updating, change management, and package publishing.
Contents
version.sh
— main script for version updating and package publishingsrc.py
— script for updating version numbers in source fileschangelog.py
— script for generating and updating the CHANGELOG.md filegit.sh
— script for publishing a new version to GitHubpypi.sh
— script for publishing the package to PyPIenv_manager.py
— module for managing project configurationconfig.py
— configuration module for update scripts
Project Configuration
Project configuration is stored in the .env
file in the project’s root directory. This file is created automatically when the scripts are first run, based on the .env.example
file.
Available configuration variables:
PROJECT_NAME
— project namePACKAGE_PATH
— path to the package directory (relative to the project root directory)
If the .env
file does not exist or variables are not defined, the scripts will try to detect values automatically or ask the user.
Usage
To update the version and publish the package:
# Run the main update script
bash update/version.sh
The script will perform the following operations:
- Load project configuration from the
.env
file or ask the user - Create and activate a virtual environment
- Update the version number in source files
- Generate an entry in CHANGELOG.md
- Publish changes to GitHub
- Publish the package to PyPI
Troubleshooting
If an error occurs during GitHub publication:
Updates were rejected because the remote contains work that you do not have locally
You should perform git pull
before running the script again:
git pull
bash update/version.sh
If the tag already exists:
fatal: tag 'vX.Y.Z' already exists
You should delete the existing tag before running the script again:
git tag -d vX.Y.Z
git push origin --delete vX.Y.Z
bash update/version.sh
Configuration Management
To manually create or update the .env
file:
python update/env_manager.py
The script will display the current project configuration and create the .env
file if it doesn’t exist.
Polish Documentation
Polish version of this documentation is available in the update/pl/readme.md
file.