Skip to content

Commit

Permalink
chore: Use dynamic versioning based on git tags (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Sep 14, 2023
1 parent 8a8ac88 commit 5fc2a02
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 123 deletions.
1 change: 1 addition & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
meltano==3.0.0
17 changes: 10 additions & 7 deletions .github/workflows/meltano-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
jobs:
meltano-run:
runs-on: ubuntu-latest
container:
image: meltano/meltano:latest-python3.9
strategy:
matrix:
include:
Expand All @@ -27,6 +25,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install Meltano
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
run: |
pipx install meltano
- name: Check Meltano version
run: |
meltano --version
Expand All @@ -39,11 +47,6 @@ jobs:
run: |
meltano run ${{ matrix.tap }} ${{ matrix.mapping }} target-sqlite
- name: Install SQLite CLI
run: |
apt update
apt install sqlite3
- name: Check output
run: |
sqlite3 -markdown output/${{ matrix.output_db }} 'select * from ${{ matrix.target_table }} limit 20' >> $GITHUB_STEP_SUMMARY
91 changes: 0 additions & 91 deletions .github/workflows/version_bump.yml

This file was deleted.

15 changes: 14 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ repos:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.26.3
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.287
rev: v0.0.289
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand All @@ -42,3 +50,8 @@ repos:
- id: flake8
additional_dependencies:
- darglint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.1.0"
hooks:
- id: pyproject-fmt
47 changes: 34 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
For the latest updates, please see the repo [Release Notes](https://github.com/MeltanoLabs/meltano-map-transform/releases).
# Changelog

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

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

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

## v0.0.4 (2022-05-24)
### Added

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

## v0.0.3 (2022-04-14)
## v0.4.0 (2023-08-14)

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

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

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

## v0.0.1 (2022-01-13)
### Fixed

The initial release of `meltano-map-transform`.
- Support `__NULL__` in `__else__` values ([#104](https://github.com/edgarrmondragon/sqlean-driver/issues/104))

## v0.3.0 (2023-02-07)

### Added

- Support Python 3.11 ([#98](https://github.com/edgarrmondragon/sqlean-driver/issues/98))

## v0.1.1 (2022-12-10)

### Testing

- Test fields whitelisting and schema passthrough ([#85](https://github.com/edgarrmondragon/sqlean-driver/issues/85))

## v0.1.0 (2022-11-22)

### Documentation

- Add Meltano installation instructions ([#63](https://github.com/edgarrmondragon/sqlean-driver/issues/63))

<!-- generated by git-cliff -->
72 changes: 72 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [git-cliff](https://github.com/orhun/git-cliff).\n
"""
# template for the changelog body
# https://tera.netlify.app/docs
body = """
{% if version %}\
## {{ version }} ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/edgarrmondragon/sqlean-driver/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore: Release", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks", skip = true },
{ message = "^ci", group = "CI", skip = true },
{ body = ".*security", group = "Security" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
32 changes: 21 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "meltano-map-transform"
version = "0.4.1"
version = "0.0.0"
description = "`meltano-map-transform` is a Singer-compatible inline map transformer, built with the Meltano SDK for Singer Taps."
authors = [
"Meltano Team and Contributors",
Expand All @@ -26,6 +26,21 @@ version = "~=0.32.0b1"
[tool.poetry.dev-dependencies]
pytest = "^7.4.2"

[tool.poetry-dynamic-versioning]
enable = true
format-jinja = """
{%- if distance == 0 -%}
{{ serialize_pep440(base, stage, revision) }}
{%- elif revision is not none -%}
{{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }}
{%- else -%}
{{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }}
{%- endif -%}
"""
metadata = true
style = "pep440"
vcs = "git"

[tool.pytest.ini_options]
addopts = "-vvv"

Expand All @@ -41,21 +56,16 @@ module = [
]

[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry_dynamic_versioning.backend"
requires = [
"poetry-core>=1",
"poetry-dynamic-versioning<2.0.0,>=1",
]

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

[tool.commitizen]
name = "cz_version_bump"
version = "0.0.5"
tag_format = "v$major.$minor.$patch$prerelease"
version_files = [
"pyproject.toml:^version =",
]

[tool.ruff]
ignore = [
"ANN101", # missing-type-self
Expand Down

0 comments on commit 5fc2a02

Please sign in to comment.