Skip to content

Commit 35fbe3f

Browse files
authored
Merge pull request #409 from bugsnag/Pawan/PLAT-5521--version--
Adding makefile to bump __verion__ at 3 places.
2 parents a699b7d + 8916729 commit 35fbe3f

5 files changed

Lines changed: 37 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
## TBD
5+
6+
### Enhancements
7+
8+
* Add `bugsnag.__version__` attribute for programmatic version checking as per PEP 396 specification
9+
[#409](https://github.com/bugsnag/bugsnag-python/pull/409)
10+
411
## v4.8.0 (2024-07-08)
512

613
### Enhancements

CONTRIBUTING.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,21 @@ If you're on the core team, you can release Bugsnag as follows:
9797
git checkout -b release/v4.x.x
9898
```
9999
100-
* Update the version number in [`setup.py`](./setup.py) and `bugsnag/notifier.py`(./bugsnag/notifier.py)
101-
* Update the CHANGELOG.md and README.md if necessary
100+
* Update the version number using the Makefile
101+
102+
```
103+
make VERSION=4.x.x bump
104+
```
105+
106+
* Update the CHANGELOG.md (add version and date) and README.md if necessary
102107
* Commit and open a pull request into `master`
108+
109+
```
110+
git add bugsnag/__init__.py setup.py bugsnag/notifier.py CHANGELOG.md
111+
git commit -m "Release v4.x.x"
112+
git push origin release/v4.x.x
113+
```
114+
103115
* Merge the PR when it's been reviewed
104116
* Create a release on GitHub, tagging the new version `v4.x.x`
105117
* Push the release to PyPI

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: bump
2+
3+
bump: ## Bump the version numbers to $VERSION
4+
ifeq ($(VERSION),)
5+
@$(error VERSION is not defined. Run with `make VERSION=number bump`)
6+
endif
7+
@echo Bumping the version number to $(VERSION)
8+
@sed -i.bak "s/__version__ = '.*'/__version__ = '$(VERSION)'/" bugsnag/__init__.py && rm bugsnag/__init__.py.bak
9+
@sed -i.bak "s/version='.*',/version='$(VERSION)',/" setup.py && rm setup.py.bak
10+
@sed -i.bak "s/'version': '.*'/'version': '$(VERSION)'/" bugsnag/notifier.py && rm bugsnag/notifier.py.bak
11+
@echo "Successfully bumped version to $(VERSION)"
12+
@echo "Updated files: bugsnag/__init__.py, setup.py, bugsnag/notifier.py"

bugsnag/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
clear_feature_flag, clear_feature_flags,
1919
aws_lambda_handler)
2020

21+
__version__ = '4.8.0'
22+
2123
__all__ = ('Client', 'Event', 'Configuration', 'RequestConfiguration',
2224
'configuration', 'configure', 'configure_request',
2325
'add_metadata_tab', 'clear_request_config', 'notify',
@@ -27,4 +29,4 @@
2729
'OnBreadcrumbCallback', 'leave_breadcrumb', 'add_on_breadcrumb',
2830
'remove_on_breadcrumb', 'FeatureFlag', 'add_feature_flag',
2931
'add_feature_flags', 'clear_feature_flag', 'clear_feature_flags',
30-
'aws_lambda_handler')
32+
'aws_lambda_handler', '__version__')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
install_requires=['webob'],
5050
extras_require={
5151
'flask': ['flask', 'blinker']
52-
},
52+
}
5353
)

0 commit comments

Comments
 (0)