Skip to content

Commit

Permalink
ci: Add build workflow (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Feb 10, 2025
1 parent 1998bc9 commit a07fc05
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 41 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build

on:
push:

permissions:
contents: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.baipp.outputs.package_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
id: baipp

publish:
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/project/meltano-map-transform/${{ needs.build.outputs.package_version }}
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
file: dist/*.whl
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Publish
uses: pypa/gh-action-pypi-publish@v1.12.4
41 changes: 8 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `meltano-map-transformer`
# meltano-map-transformer

<img src="examples/mapperpic.png" width="800px"/>

Expand All @@ -8,7 +8,7 @@ A map transformer to duplicate, filter, hash, mask and do many more small transf

This mapper plugin is fully compliant with the Singer Spec and can be placed in between any Singer tap and target.

# meltano-map-transformer in action
## meltano-map-transformer in action

For a collection of examples, take a look at [examples/README.md](examples/README.md).

Expand All @@ -31,15 +31,12 @@ You can see a full list of published releases [here](https://github.com/MeltanoL

For example:

```
# Update the below with the latest published release:
# https://github.com/MeltanoLabs/meltano-map-transform/releases
# Install with pip, ideally in a new virtual environment to avoid conflicts:
pip install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.4.1
```shell
# Use `uv` so that virtual environments are managed automatically:
uv tool install meltano-map-transform==0.10.0

# Or better yet, use `pipx` so that virtual environments are managed automatically:
pipx install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.4.1
# Alternatively, use `pipx`:
pipx install meltano-map-transform==0.10.0
```

### Meltano installation instructions
Expand All @@ -63,7 +60,7 @@ pipx install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.4.1
plugins:
mappers:
- name: meltano-map-transformer
pip_url: "git+https://github.com/MeltanoLabs/meltano-map-transform.git"
pip_url: meltano-map-transform
executable: meltano-map-transform
mappings:
- name: hash_email
Expand All @@ -84,9 +81,6 @@ pipx install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.4.1
meltano run tap-csv hash_email target-sqlite
```




## Capabilities

* `stream-maps`
Expand All @@ -98,22 +92,3 @@ pipx install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.4.1
| stream_maps | True | None | Stream maps |

A full list of supported settings and capabilities is available by running: `meltano-map-transformer --about`

## Installation

We recommend using GitHub release tags when installing with `pip`. We also recommend using `pipx` or `meltano` instead of installing with `pip` directly.

You can see a full list of published releases [here](https://github.com/MeltanoLabs/meltano-map-transform/releases).

For example:

```
# Update the below with the latest published release:
# https://github.com/MeltanoLabs/meltano-map-transform/releases
# Install with pip, ideally in a new virtual environment to avoid conflicts:
pip install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.0.1
# Or better yet, use `pipx` so that virtual environments are managed automatically:
pipx install git+https://github.com/MeltanoLabs/meltano-map-transform.git@v0.0.1
```
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Either clone this repository, or just open it up in codespaces. To execute the c
To clean up afterwards, just remove the file: ```rm output/tap_csv.db```

# Example 1: Hashing with built-in functions
**What:** Splitting email adresses, save the domain in separate, hash the mail itself, remove "other" columns and use the "config" object.
**What:** Splitting email addresses, save the domain in separate, hash the mail itself, remove "other" columns and use the "config" object.

**The configuration:**
```yaml
Expand Down
12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
requires = [
"poetry-core==1.9.1",
"poetry-dynamic-versioning==1.6",
"poetry-core==2.0.1",
"poetry-dynamic-versioning==1.7.1",
]

[tool.poetry]
name = "meltano-map-transform"
version = "0.0.0"
description = "`meltano-map-transform` is a Singer-compatible inline map transformer, built with the Meltano SDK for Singer Taps."
description = "Singer-compatible inline map transformer, built with the Meltano SDK for Singer Taps."
authors = [
"Meltano Team and Contributors",
]
Expand Down Expand Up @@ -64,10 +64,8 @@ lint.select = [
"ALL",
]
lint.ignore = [
"ANN101", # missing-type-self
"ANN102", # missing-type-cls
"DJ", # flake8-django
"PD", # pandas-vet
"DJ", # flake8-django
"PD", # pandas-vet
]

lint.per-file-ignores."tests/*" = [
Expand Down

0 comments on commit a07fc05

Please sign in to comment.