Skip to content
Open
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## TBD

### Enhancements

* Add `bugsnag.__version__` attribute for programmatic version checking as per PEP 396 specification
[#409](https://github.com/bugsnag/bugsnag-python/pull/409)

## v4.8.0 (2024-07-08)

### Enhancements
Expand Down
16 changes: 14 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,21 @@ If you're on the core team, you can release Bugsnag as follows:
git checkout -b release/v4.x.x
```

* Update the version number in [`setup.py`](./setup.py) and `bugsnag/notifier.py`(./bugsnag/notifier.py)
* Update the CHANGELOG.md and README.md if necessary
* Update the version number using the Makefile

```
make VERSION=4.x.x bump
```

* Update the CHANGELOG.md (add version and date) and README.md if necessary
* Commit and open a pull request into `master`

```
git add bugsnag/__init__.py setup.py bugsnag/notifier.py CHANGELOG.md
git commit -m "Release v4.x.x"
git push origin release/v4.x.x
```

* Merge the PR when it's been reviewed
* Create a release on GitHub, tagging the new version `v4.x.x`
* Push the release to PyPI
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: bump

bump: ## Bump the version numbers to $VERSION
ifeq ($(VERSION),)
@$(error VERSION is not defined. Run with `make VERSION=number bump`)
endif
@echo Bumping the version number to $(VERSION)
@sed -i.bak "s/__version__ = '.*'/__version__ = '$(VERSION)'/" bugsnag/__init__.py && rm bugsnag/__init__.py.bak
@sed -i.bak "s/version='.*',/version='$(VERSION)',/" setup.py && rm setup.py.bak
@sed -i.bak "s/'version': '.*'/'version': '$(VERSION)'/" bugsnag/notifier.py && rm bugsnag/notifier.py.bak
@echo "Successfully bumped version to $(VERSION)"
@echo "Updated files: bugsnag/__init__.py, setup.py, bugsnag/notifier.py"
4 changes: 3 additions & 1 deletion bugsnag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
clear_feature_flag, clear_feature_flags,
aws_lambda_handler)

__version__ = '4.8.0'

__all__ = ('Client', 'Event', 'Configuration', 'RequestConfiguration',
'configuration', 'configure', 'configure_request',
'add_metadata_tab', 'clear_request_config', 'notify',
Expand All @@ -27,4 +29,4 @@
'OnBreadcrumbCallback', 'leave_breadcrumb', 'add_on_breadcrumb',
'remove_on_breadcrumb', 'FeatureFlag', 'add_feature_flag',
'add_feature_flags', 'clear_feature_flag', 'clear_feature_flags',
'aws_lambda_handler')
'aws_lambda_handler', '__version__')
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
install_requires=['webob'],
extras_require={
'flask': ['flask', 'blinker']
},
}
)
Loading