Skip to content

Commit 5fc2a02

Browse files
chore: Use dynamic versioning based on git tags (#173)
1 parent 8a8ac88 commit 5fc2a02

File tree

7 files changed

+152
-123
lines changed

7 files changed

+152
-123
lines changed

.github/workflows/constraints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
meltano==3.0.0

.github/workflows/meltano-run.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ on:
77
jobs:
88
meltano-run:
99
runs-on: ubuntu-latest
10-
container:
11-
image: meltano/meltano:latest-python3.9
1210
strategy:
1311
matrix:
1412
include:
@@ -27,6 +25,16 @@ jobs:
2725
steps:
2826
- uses: actions/checkout@v4
2927

28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: 3.11
31+
32+
- name: Install Meltano
33+
env:
34+
PIP_CONSTRAINT: .github/workflows/constraints.txt
35+
run: |
36+
pipx install meltano
37+
3038
- name: Check Meltano version
3139
run: |
3240
meltano --version
@@ -39,11 +47,6 @@ jobs:
3947
run: |
4048
meltano run ${{ matrix.tap }} ${{ matrix.mapping }} target-sqlite
4149
42-
- name: Install SQLite CLI
43-
run: |
44-
apt update
45-
apt install sqlite3
46-
4750
- name: Check output
4851
run: |
4952
sqlite3 -markdown output/${{ matrix.output_db }} 'select * from ${{ matrix.target_table }} limit 20' >> $GITHUB_STEP_SUMMARY

.github/workflows/version_bump.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ repos:
1616
- id: check-toml
1717
- id: check-yaml
1818
- id: end-of-file-fixer
19+
- id: no-commit-to-branch
20+
args: [--branch, main]
1921
- id: trailing-whitespace
2022

23+
- repo: https://github.com/python-jsonschema/check-jsonschema
24+
rev: 0.26.3
25+
hooks:
26+
- id: check-dependabot
27+
- id: check-github-workflows
28+
2129
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.0.287
30+
rev: v0.0.289
2331
hooks:
2432
- id: ruff
2533
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
@@ -42,3 +50,8 @@ repos:
4250
- id: flake8
4351
additional_dependencies:
4452
- darglint
53+
54+
- repo: https://github.com/tox-dev/pyproject-fmt
55+
rev: "1.1.0"
56+
hooks:
57+
- id: pyproject-fmt

CHANGELOG.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
1-
For the latest updates, please see the repo [Release Notes](https://github.com/MeltanoLabs/meltano-map-transform/releases).
1+
# Changelog
22

3+
All notable changes to this project will be documented in this file.
34

4-
## v0.0.5 (2022-10-04)
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
7+
and is generated by [git-cliff](https://github.com/orhun/git-cliff).
58

6-
- [#50](https://github.com/MeltanoLabs/meltano-map-transform/pull/50) Fix singer dependencies and limit Singer SDK to `<=0.11.0`.
9+
## [unreleased]
710

8-
## v0.0.4 (2022-05-24)
11+
### Added
912

10-
- [#18](https://github.com/MeltanoLabs/meltano-map-transform/pull/18) Add missing `__alias__` property
11-
- [#20](https://github.com/MeltanoLabs/meltano-map-transform/pull/20) Adjust reference to poetry-core
13+
- Add explicit support for flattening features ([#103](https://github.com/edgarrmondragon/sqlean-driver/issues/103))
1214

13-
## v0.0.3 (2022-04-14)
15+
## v0.4.0 (2023-08-14)
1416

15-
- [#6](https://github.com/MeltanoLabs/meltano-map-transform/pull/6) Bump singer-sdk from `0.4.0` to `0.4.2`
16-
- [#15](https://github.com/MeltanoLabs/meltano-map-transform/pull/15) Remove extraneous logging
17+
### Documentation
1718

18-
## v0.0.2 (2022-01-24)
19+
- #6412 add examples for usage ([#117](https://github.com/edgarrmondragon/sqlean-driver/issues/117))
1920

20-
- This update bumps the SDK dependency version to `0.4.0`.
21+
## v0.3.1 (2023-02-08)
2122

22-
## v0.0.1 (2022-01-13)
23+
### Fixed
2324

24-
The initial release of `meltano-map-transform`.
25+
- Support `__NULL__` in `__else__` values ([#104](https://github.com/edgarrmondragon/sqlean-driver/issues/104))
26+
27+
## v0.3.0 (2023-02-07)
28+
29+
### Added
30+
31+
- Support Python 3.11 ([#98](https://github.com/edgarrmondragon/sqlean-driver/issues/98))
32+
33+
## v0.1.1 (2022-12-10)
34+
35+
### Testing
36+
37+
- Test fields whitelisting and schema passthrough ([#85](https://github.com/edgarrmondragon/sqlean-driver/issues/85))
38+
39+
## v0.1.0 (2022-11-22)
40+
41+
### Documentation
42+
43+
- Add Meltano installation instructions ([#63](https://github.com/edgarrmondragon/sqlean-driver/issues/63))
44+
45+
<!-- generated by git-cliff -->

cliff.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[changelog]
2+
# changelog header
3+
header = """
4+
# Changelog\n
5+
All notable changes to this project will be documented in this file.\n
6+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
8+
and is generated by [git-cliff](https://github.com/orhun/git-cliff).\n
9+
"""
10+
# template for the changelog body
11+
# https://tera.netlify.app/docs
12+
body = """
13+
{% if version %}\
14+
## {{ version }} ({{ timestamp | date(format="%Y-%m-%d") }})
15+
{% else %}\
16+
## [unreleased]
17+
{% endif %}\
18+
{% for group, commits in commits | group_by(attribute="group") %}
19+
### {{ group | upper_first }}
20+
{% for commit in commits %}
21+
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
22+
{% endfor %}
23+
{% endfor %}\n
24+
"""
25+
# remove the leading and trailing whitespace from the template
26+
trim = true
27+
# changelog footer
28+
footer = """
29+
<!-- generated by git-cliff -->
30+
"""
31+
32+
[git]
33+
# parse the commits based on https://www.conventionalcommits.org
34+
conventional_commits = true
35+
# filter out the commits that are not conventional
36+
filter_unconventional = true
37+
# process each line of a commit as an individual commit
38+
split_commits = false
39+
# regex for preprocessing the commit messages
40+
commit_preprocessors = [
41+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/edgarrmondragon/sqlean-driver/issues/${2}))"}, # replace issue numbers
42+
]
43+
# regex for parsing and grouping commits
44+
commit_parsers = [
45+
{ message = "^feat", group = "Added" },
46+
{ message = "^fix", group = "Fixed" },
47+
{ message = "^doc", group = "Documentation" },
48+
{ message = "^perf", group = "Performance" },
49+
{ message = "^refactor", group = "Refactor" },
50+
{ message = "^style", group = "Styling" },
51+
{ message = "^test", group = "Testing" },
52+
{ message = "^chore: Release", skip = true },
53+
{ message = "^chore", group = "Miscellaneous Tasks", skip = true },
54+
{ message = "^ci", group = "CI", skip = true },
55+
{ body = ".*security", group = "Security" },
56+
]
57+
# protect breaking changes from being skipped due to matching a skipping commit_parser
58+
protect_breaking_commits = false
59+
# filter out the commits that are not matched by commit parsers
60+
filter_commits = false
61+
# glob pattern for matching git tags
62+
tag_pattern = "v[0-9]*"
63+
# regex for skipping tags
64+
skip_tags = "v0.1.0-beta.1"
65+
# regex for ignoring tags
66+
ignore_tags = ""
67+
# sort the tags topologically
68+
topo_order = false
69+
# sort the commits inside sections by oldest/newest order
70+
sort_commits = "oldest"
71+
# limit the number of commits included in the changelog.
72+
# limit_commits = 42

pyproject.toml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "meltano-map-transform"
3-
version = "0.4.1"
3+
version = "0.0.0"
44
description = "`meltano-map-transform` is a Singer-compatible inline map transformer, built with the Meltano SDK for Singer Taps."
55
authors = [
66
"Meltano Team and Contributors",
@@ -26,6 +26,21 @@ version = "~=0.32.0b1"
2626
[tool.poetry.dev-dependencies]
2727
pytest = "^7.4.2"
2828

29+
[tool.poetry-dynamic-versioning]
30+
enable = true
31+
format-jinja = """
32+
{%- if distance == 0 -%}
33+
{{ serialize_pep440(base, stage, revision) }}
34+
{%- elif revision is not none -%}
35+
{{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }}
36+
{%- else -%}
37+
{{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }}
38+
{%- endif -%}
39+
"""
40+
metadata = true
41+
style = "pep440"
42+
vcs = "git"
43+
2944
[tool.pytest.ini_options]
3045
addopts = "-vvv"
3146

@@ -41,21 +56,16 @@ module = [
4156
]
4257

4358
[build-system]
44-
requires = ["poetry_core>=1.0.0"]
45-
build-backend = "poetry.core.masonry.api"
59+
build-backend = "poetry_dynamic_versioning.backend"
60+
requires = [
61+
"poetry-core>=1",
62+
"poetry-dynamic-versioning<2.0.0,>=1",
63+
]
4664

4765
[tool.poetry.scripts]
4866
# CLI declaration
4967
meltano-map-transform = "meltano_map_transform.mapper:StreamTransform.cli"
5068

51-
[tool.commitizen]
52-
name = "cz_version_bump"
53-
version = "0.0.5"
54-
tag_format = "v$major.$minor.$patch$prerelease"
55-
version_files = [
56-
"pyproject.toml:^version =",
57-
]
58-
5969
[tool.ruff]
6070
ignore = [
6171
"ANN101", # missing-type-self

0 commit comments

Comments
 (0)