Skip to content

chore: consolidate version definitions and update release workflow #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -22,7 +22,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
contents: write
issues: write
pull-requests: write
actions: write

steps:
- name: Checkout code
Expand All @@ -31,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: '3.12'

- name: Install dependencies
run: |
Expand All @@ -48,7 +49,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then
semantic-release publish --dry-run
semantic-release publish --dry-run --verbose
else
semantic-release publish
semantic-release publish --verbose
fi
4 changes: 1 addition & 3 deletions early_stopping_pytorch/early_stopping.py
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

Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "BjarteSunde@outlook.com" }
]
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}"