-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: consolidate version definitions and update release workflow (#30)
This pull request consolidates version definitions and improves the release workflow to streamline the versioning and publishing processes. The changes are part of an effort to improve maintainability and ensure the workflows are efficient and modular. **Changes Made:** - **Consolidated Version Management**: - Removed duplicate version definitions to maintain a single source of truth. The version is now only defined in `early_stopping_pytorch/__init__.py` to avoid conflicts. - Removed the `version` field from `pyproject.toml`, as `python-semantic-release` handles versioning automatically. - **Updated Release Workflow**: - Improved the `Create New Release` workflow by separating the release process from the publishing process. - The release process now handles version bumping, tagging, and creating GitHub releases via `python-semantic-release`. - **New Publish Workflow**: - A dedicated workflow now handles publishing the package to PyPI when a new version tag is pushed. - This ensures a clear separation of responsibilities between creating releases and publishing to PyPI, reducing complexity.
- Loading branch information
Showing
4 changed files
with
12 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# pytorchtools.py | ||
__version__ = "0.1.0" | ||
|
||
# early_stopping.py | ||
import numpy as np | ||
import torch | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,22 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "early-stopping-pytorch" | ||
version = "0.1.0" | ||
description = "A PyTorch utility package for Early Stopping" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Bjarte Sunde", email = "[email protected]" } | ||
] | ||
license = { text = "MIT" } # Update if you use a different license | ||
license = { text = "MIT" } | ||
dependencies = [ | ||
"numpy>=1.21", | ||
"torch>=1.9.0" | ||
] | ||
|
||
[tool.semantic_release] | ||
version_variable = [ | ||
"early_stopping_pytorch/__init__.py:__version__", | ||
"pyproject.toml:project.version" | ||
] | ||
version_variable = "early_stopping_pytorch/__init__.py:__version__" | ||
branch = "main" | ||
upload_to_pypi = false | ||
build_command = "pip install build && python -m build" | ||
|
||
[tool.semantic_release.git] | ||
tag_format = "v{version}" |