-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix make sdist command * Don't upload in this command. * Move pypi requirements to own file * Add twine and upgrade wheel * Update and clean makefile * Add pygcgen changelog generator package * Create python script to generate changelog * Add release instructions
- Loading branch information
1 parent
76fba0f
commit 2bd5ed9
Showing
5 changed files
with
86 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
- Install the pypi requirements including `twine`. | ||
``` | ||
pip install -r requirements_pypi.txt | ||
``` | ||
- Fetch and checkout master branch. | ||
- Update version in `leicacam/VERSION` to the new version number, eg `0.2.0`. | ||
- Update `CHANGELOG.md` by running `scripts/gen_changelog.py`. Make sure you first set a GitHub token as an environment variable, for the changelog generator package `pygcgen`. See https://github.com/topic2k/pygcgen. | ||
``` | ||
scripts/gen_changelog.py | ||
``` | ||
- Commit and push to remote master. Use a commit message like: `Bump version to 0.2.0` | ||
- Go to github releases and tag a new release on the master branch. Put the changes for the new release from the updated changelog as the description for the release. Use the same version for the tag as the new version in `leicacam/VERSION`, to ensure working links in the changelog. | ||
- Fetch and checkout the master branch. | ||
- Build source and wheel distributions and upload to test-pypi, to stage a release: | ||
``` | ||
make test-release | ||
``` | ||
- Release to pypi: | ||
``` | ||
make release | ||
``` |
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,3 +1 @@ | ||
pydebug==1.0.3 | ||
setuptools-git | ||
wheel>=0.22 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pygcgen==0.2.3 | ||
setuptools-git | ||
twine>=1.11.0 | ||
wheel>=0.31.0 |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python | ||
"""Generate changelog.""" | ||
import os | ||
|
||
from pygcgen.main import ChangelogGenerator | ||
|
||
|
||
def validate_version(): | ||
"""Validate version before release.""" | ||
import leicacam | ||
version_string = leicacam.__version__ | ||
versions = version_string.split('.', 3) | ||
try: | ||
for ver in versions: | ||
int(ver) | ||
except ValueError: | ||
print( | ||
'Only integers are allowed in release version, ' | ||
'please adjust current version {}'.format(version_string)) | ||
return None | ||
return version_string | ||
|
||
|
||
def generate(): | ||
"""Generate changelog.""" | ||
old_dir = os.getcwd() | ||
proj_dir = os.path.join(os.path.dirname(__file__), os.pardir) | ||
os.chdir(proj_dir) | ||
version = validate_version() | ||
if not version: | ||
os.chdir(old_dir) | ||
return | ||
print('Generating changelog for version {}'.format(version)) | ||
options = [ | ||
'--user', 'arve0', '--project', 'leicacam', '-v', '--with-unreleased', | ||
'--future-release', version] | ||
generator = ChangelogGenerator(options) | ||
generator.run() | ||
os.chdir(old_dir) | ||
|
||
|
||
if __name__ == '__main__': | ||
generate() |