This project provides a personal solution for managing version numbers in my Python projects. It includes scripts for updating version numbers in pyproject.toml, src/version.py, and version_info.txt. This is a private repository for my own use, but I’m open to contributions and support to keep it running smoothly.
- Version Management: Update version numbers manually by editing files, using provided scripts with a GUI dialog, or via PyCharm External Tools.
python-version-template/
├── .github/
│ └── funding.yml (Funding configuration)
├── contents/
│ ├── BTC_QR.png (Bitcoin QR code)
│ ├── ETH_QR.png (Ethereum QR code)
│ └── Solana_QR.jpg (Solana QR code)
├── scripts/
│ ├── increment_version.py (Update version with GUI)
│ ├── update_version.py (Update version manually via command line)
├── src/
│ ├── init.py
│ ├── version.py (Version information)
│ └── main.py (Sample main script)
├── .gitattributes (Line ending normalization)
├── .gitignore
├── LICENSE
├── README.md
├── pyproject.toml (Project metadata with version)
├── requirements.txt (Dependencies)
└── version_info.txt (Version information file)
- Python: 3.8 or higher (with
tkinterinstalled; usually included by default) - Git: For version control
git clone https://github.com/kerasty2024/python-version-template.git
cd python-version-templatepip install -r requirements.txtIf running on Linux and the GUI dialog does not appear, install tkinter:
sudo apt install python3-tk # For Ubuntu/DebianUpdate pyproject.toml with your project name and initial version:
[project]
name = "your-project-name"
version = "1.0.0"Modify version_info.txt for version metadata (e.g., ProductName, CompanyName).
Add your application code to src/ (replace main.py).
You can update the version in two ways:
Option 1: Use the GUI Script
Open a terminal and navigate to the project directory:
cd /path/to/python-version-template
python scripts/increment_version.pyA dialog will appear showing the current version (e.g., Current Version: 1.0.0).
Enter the new version in the text field (e.g., 1.0.1).
Click "Update" to apply the change.
Commit the updated files:
git commit -m "Update version to 1.0.1"
git push origin mainOption 2: Edit Files Directly
Open the following files and update the version number:
pyproject.toml:
[project]
version = "1.1.0" # Update this linesrc/version.py:
__version__ = "1.1.0" # Update this lineversion_info.txt:
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(1, 1, 0, 0), # Update this line
prodvers=(1, 1, 0, 0), # Update this line
...
),
kids=[
StringFileInfo(
[
StringStruct('FileVersion', '1.1.0'), # Update this line
StringStruct('ProductVersion', '1.1.0'), # Update this line
...
]
),
...
]
)
Commit the updated files:
git add pyproject.toml src/version.py version_info.txt
git commit -m "Update version to 1.1.0"
git push origin mainOption 3: Use the Command-Line Script
cd /path/to/python-version-template
python scripts/update_version.py 1.1.0
git add .
git commit -m "Update version to 1.1.0"
git push origin mainOption 4: Use PyCharm External Tools
If you prefer a more integrated experience in PyCharm, you can set up an External Tool to run the version update script with a single click.
-
Open PyCharm and load the project.
-
Go to
File > Settings > Tools > External Tools. -
Click
+to add a new tool:- Name: Update Version
- Program: python
- Arguments:
$ProjectFileDir$/scripts/increment_version.py - Working directory:
$ProjectFileDir$
-
Save and run the tool:
- Right-click anywhere in the project >
External Tools > Update Version. - A dialog will appear showing the current version.
- Enter the new version and click Update.
- Right-click anywhere in the project >
-
Commit the updated files:
git add .
git commit -m "Update version to 1.1.0"
git push origin main- (Optional) Assign a shortcut in
Settings > Keymap > External Tools(e.g.,Ctrl+Alt+V).
- Verify
tomlis installed (pip install toml) if using scripts. - Ensure all version numbers in
pyproject.toml,src/version.py, andversion_info.txtare consistent. - If the GUI dialog does not appear, ensure
tkinteris available:- On Windows/macOS, it is usually included with Python.
- On Linux, install
python3-tk(e.g.,sudo apt install python3-tk).
- Ensure you are in the correct directory.
- Use the full path to Python if needed (e.g.,
/path/to/python3).
- Ensure the images in the
contents/folder are correctly committed to the repository. - Check file names for case sensitivity (e.g.,
BTC-QR.pngvsbtc-qr.png).
If you find this template useful, your support would mean the world to me! It helps me dedicate more time to maintaining and improving this project, ensuring it remains a valuable resource for the community. There are several ways to contribute:
- GitHub Sponsors: https://github.com/kerasty2024
- Buy Me a Coffee: https://buymeacoffee.com/kerasty
You can also support the project by sending cryptocurrency to the addresses below. Simply copy the address or scan the QR code to make a contribution—every bit helps keep this project alive and growing!
How to Contribute with Crypto
- Copy the address for your preferred cryptocurrency, or scan the QR code using your wallet app.
- Send any amount you’d like to contribute.
- Your support will help fund server costs, development time, and future enhancements—thank you! Thank you for considering a contribution! Your generosity helps ensure this project can continue to grow and serve the developer community.
This project is licensed under the MIT License. See the LICENSE file for details.


