mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
5a6cb51d71 | |||
52fc36ab70 | |||
c696071b8f | |||
b0419dad80 | |||
2bfaa78053 | |||
524a1da4c6 | |||
acedf2b401 | |||
21b530c256 |
2
.github/workflows/python-publish.yml
vendored
2
.github/workflows/python-publish.yml
vendored
@ -64,7 +64,7 @@ jobs:
|
||||
|
||||
- name: Get version name and body
|
||||
run: |
|
||||
echo "VERSION_TILE=Version $(yaclog show -n)" >> $GITHUB_ENV
|
||||
echo "VERSION_TILE=$(yaclog show -n)" >> $GITHUB_ENV
|
||||
echo "$(yaclog show -mb)" >> RELEASE.md
|
||||
|
||||
- name: Publish to PyPI
|
||||
|
26
CHANGELOG.md
26
CHANGELOG.md
@ -2,7 +2,19 @@
|
||||
|
||||
All notable changes to this project will be documented in this file
|
||||
|
||||
## 1.0.1 - 2021-05-10
|
||||
## Version 1.0.2 - 2021-05-12
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to support Click version 8
|
||||
- Modified module documentation page titles to include a module role
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed tag names with spaces in versions
|
||||
|
||||
|
||||
## Version 1.0.1 - 2021-05-10
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -10,7 +22,7 @@ All notable changes to this project will be documented in this file
|
||||
- Improved consistency in command documentation metavars
|
||||
|
||||
|
||||
## 1.0.0 - 2021-05-07
|
||||
## Version 1.0.0 - 2021-05-07
|
||||
|
||||
### Changed
|
||||
|
||||
@ -33,7 +45,7 @@ All notable changes to this project will be documented in this file
|
||||
- Extra newlines are added between versions to improve readability of the raw markdown file.
|
||||
|
||||
|
||||
## 0.3.3 - 2021-04-27
|
||||
## Version 0.3.3 - 2021-04-27
|
||||
|
||||
### Added
|
||||
|
||||
@ -48,7 +60,7 @@ All notable changes to this project will be documented in this file
|
||||
- `release` now works with logs that have only unreleased changes
|
||||
|
||||
|
||||
## 0.3.2 - 2021-04-24
|
||||
## Version 0.3.2 - 2021-04-24
|
||||
|
||||
### Added
|
||||
|
||||
@ -64,7 +76,7 @@ All notable changes to this project will be documented in this file
|
||||
- `release` and `entry` commands now work using empty changelogs.
|
||||
|
||||
|
||||
## 0.3.1 - 2021-04-24
|
||||
## Version 0.3.1 - 2021-04-24
|
||||
|
||||
### Added
|
||||
|
||||
@ -77,7 +89,7 @@ All notable changes to this project will be documented in this file
|
||||
- `release` command for creating releases
|
||||
|
||||
|
||||
## 0.2.0 - 2021-04-19
|
||||
## Version 0.2.0 - 2021-04-19
|
||||
|
||||
### Added
|
||||
|
||||
@ -91,7 +103,7 @@ All notable changes to this project will be documented in this file
|
||||
- Parser can now handle setext-style headers and H2s not conforming to the schema.
|
||||
|
||||
|
||||
## 0.1.0 - 2021-04-16
|
||||
## Version 0.1.0 - 2021-04-16
|
||||
|
||||
First release
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Changelog Module
|
||||
================
|
||||
:py:mod:`changelog` Module
|
||||
==========================
|
||||
|
||||
.. automodule:: yaclog.changelog
|
||||
:members:
|
@ -1,5 +1,5 @@
|
||||
Markdown Module
|
||||
===============
|
||||
:py:mod:`markdown` Module
|
||||
=========================
|
||||
|
||||
.. automodule:: yaclog.markdown
|
||||
:members:
|
@ -1,5 +1,5 @@
|
||||
Version Module
|
||||
==============
|
||||
:py:mod:`version` Module
|
||||
========================
|
||||
|
||||
.. automodule:: yaclog.version
|
||||
:members:
|
@ -29,7 +29,7 @@ project_urls =
|
||||
|
||||
[options]
|
||||
install_requires =
|
||||
Click ~= 7.0
|
||||
Click >= 7.0, < 9.0
|
||||
GitPython >= 3
|
||||
packaging >= 20
|
||||
python_requires = >= 3.8
|
||||
|
@ -210,7 +210,7 @@ class TestRelease(unittest.TestCase):
|
||||
runner.invoke(cli, ['init']) # create the changelog
|
||||
runner.invoke(cli, ['entry', '-b', 'entry number 1'])
|
||||
|
||||
result = runner.invoke(cli, ['release', '1.0.0', '-c'], input='y\n')
|
||||
result = runner.invoke(cli, ['release', 'Version 1.0.0', '-c'], input='y\n')
|
||||
check_result(self, result)
|
||||
self.assertIn('Created commit', result.output)
|
||||
self.assertIn('Created tag', result.output)
|
||||
|
@ -172,13 +172,20 @@ def entry(obj: Changelog, bullets, paragraphs, section_name, version_name):
|
||||
|
||||
|
||||
@cli.command(short_help='Release versions.')
|
||||
@click.option('-M', '--major', 'rel_seg', flag_value=0, default=None, help='Increment major version number.')
|
||||
@click.option('-m', '--minor', 'rel_seg', flag_value=1, help='Increment minor version number.')
|
||||
@click.option('-p', '--patch', 'rel_seg', flag_value=2, help='Increment patch number.')
|
||||
@click.option('-a', '--alpha', 'pre_seg', flag_value='a', default=None, help='Increment alpha version number.')
|
||||
@click.option('-b', '--beta', 'pre_seg', flag_value='b', help='Increment beta version number.')
|
||||
@click.option('-r', '--rc', 'pre_seg', flag_value='rc', help='Increment release candidate version number.')
|
||||
@click.option('-f', '--full', 'pre_seg', flag_value='', help='Clear the prerelease value creating a full release.')
|
||||
@click.option('-M', '--major', 'rel_seg', flag_value=0, type=int, default=None,
|
||||
help='Increment major version number.')
|
||||
@click.option('-m', '--minor', 'rel_seg', flag_value=1, type=int,
|
||||
help='Increment minor version number.')
|
||||
@click.option('-p', '--patch', 'rel_seg', flag_value=2, type=int,
|
||||
help='Increment patch number.')
|
||||
@click.option('-a', '--alpha', 'pre_seg', flag_value='a', type=str, default=None,
|
||||
help='Increment alpha version number.')
|
||||
@click.option('-b', '--beta', 'pre_seg', flag_value='b', type=str,
|
||||
help='Increment beta version number.')
|
||||
@click.option('-r', '--rc', 'pre_seg', flag_value='rc', type=str,
|
||||
help='Increment release candidate version number.')
|
||||
@click.option('-f', '--full', 'pre_seg', flag_value='',
|
||||
help='Clear the prerelease value creating a full release.')
|
||||
@click.option('-c', '--commit', is_flag=True,
|
||||
help='Create a git commit tagged with the new version number. '
|
||||
'If there are no changes to commit, the current commit will be tagged instead.')
|
||||
@ -255,12 +262,16 @@ def release(obj: Changelog, version_name, rel_seg, pre_seg, commit):
|
||||
click.confirm(' '.join(message), abort=True)
|
||||
|
||||
if tracked > 0:
|
||||
commit = repo.index.commit(f'Version {cur_version.name}\n\n{cur_version.body()}')
|
||||
commit = repo.index.commit(f'Release {cur_version.name}\n\n{cur_version.body()}')
|
||||
click.echo(f"Created commit {click.style(repo.head.commit.hexsha[0:7], fg='green')}")
|
||||
else:
|
||||
commit = repo.head.commit
|
||||
|
||||
repo_tag = repo.create_tag(cur_version.name, ref=commit, message=cur_version.body(False))
|
||||
short_version, *_ = yaclog.version.extract_version(cur_version.name)
|
||||
if not short_version:
|
||||
short_version = cur_version.name.replace(' ', '-')
|
||||
|
||||
repo_tag = repo.create_tag(short_version, ref=commit, message=cur_version.body(False))
|
||||
click.echo(f"Created tag {click.style(repo_tag.name, fg='green')}.")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user