Skip to content

Commit

Permalink
Merge pull request #14 from savannahghi/develop
Browse files Browse the repository at this point in the history
release v1.0.0
  • Loading branch information
kennedykori authored Apr 16, 2024
2 parents e5b54ee + 96e7963 commit 568e289
Show file tree
Hide file tree
Showing 23 changed files with 10,238 additions and 34 deletions.
77 changes: 64 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,86 @@
name: CI

on: [ push ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
- push

jobs:
build:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [ "3.11", "3.12" ]

python-version:
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up project using python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python-version }}

# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
- name: Install and run pre-commit
uses: pre-commit/[email protected]

uses: pre-commit/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox -r

release:
# Only run on the 'main' and 'develop' branches.
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
needs:
- build
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{ secrets.FYJ_GH_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.12"
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Set up GPG
uses: crazy-max/ghaction-import-gpg@v6
with:
git_commit_gpgsign: true
git_committer_email: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }}
git_committer_name: ${{ secrets.FYJ_GIT_COMMITTER_NAME }}
# Currently, signing commits leads to the CI hanging indefinitely.
# See https://github.com/semantic-release/semantic-release/issues/3065
git_tag_gpgsign: false
git_user_signingkey: true
gpg_private_key: ${{ secrets.FYJ_GPG_KEY }}
passphrase: ${{ secrets.FYJ_GPG_KEY_PASSPHRASE }}
trust_level: 5
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: .nvmrc
- name: Install semantic-release
run: npm ci
- name: Create a release
env:
DEBUG: semantic-release:*
GIT_AUTHOR_EMAIL: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.FYJ_GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.FYJ_GIT_COMMITTER_NAME }}
GITHUB_TOKEN: ${{ secrets.FYJ_GH_TOKEN }}
run: npx semantic-release
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,14 +13,14 @@ repos:
- id: check-yaml

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- --py311-plus

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.3.3
rev: v0.3.6
hooks:
- id: ruff
args:
Expand Down
94 changes: 94 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
branches:
- main
- name: develop
channel: rc
prerelease: rc
plugins:
- '@semantic-release/commit-analyzer'
- - '@semantic-release/release-notes-generator'
- linkCompare: true
linkReferences: true
writerOpts:
commitGroupsSort:
- type
- title
commitSort:
- scope
- subject
- - semantic-release-replace-plugin
- replacements:
- countMatches: true
files:
- package.json
from: '"version": ".*",'
to: '"version": "${nextRelease.version}",'
results:
- file: package.json
hasChanged: true
numMatches: 1
numReplacements: 1
- - '@semantic-release/changelog'
- changelogFile: docs/CHANGELOG.md
- - '@semantic-release/git'
- assets:
- docs/CHANGELOG.md
- package.json
message: "release: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
- - '@semantic-release/exec'
- publishCmd: "export GITHUB_TOKEN='${process.env.GITHUB_TOKEN}'; tox -e package"
- - '@semantic-release/github'
- assets:
- path: dist/*
tagFormat: v${version}
# ------------------------------------------------------------------------------
# GLOBAL PLUGIN OPTIONS
# See: https://github.com/semantic-release/semantic-release/blob/master/docs/usage/plugins
# .md#plugin-options-configuration
# ------------------------------------------------------------------------------
parserOptions:
noteKeywords:
- BREAKING CHANGES
- BREAKING CHANGE
- BREAKING
preset: conventionalcommits
presetConfig:
types:
- type: build
hidden: true
- type: ci
hidden: true
- type: chore
scope: deps
section: Dependency Updates
- type: chore
section: Refactors
- type: docs
scope: api
section: Documentation Updates
- type: docs
hidden: true
- type: feat
section: Features
- type: fix
section: Bug Fixes
- type: release
hidden: true
- type: test
hidden: true
releaseRules:
- type: chore
scope: deps
release: patch
- type: docs
scope: api
release: patch
- type: feat
release: minor
- type: fix
release: patch
- scope: minor
release: minor
- scope: patch
release: patch
- scope: no-release
release: false
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h1 align="center" style="border-bottom: none; text-align: center;">SGHI ETL Commons</h1>
<h3 align="center" style="text-align: center;">Collection of utilities for working with SGHI ETL Worflows.</h3>
<h3 align="center" style="text-align: center;">Collection of utilities for working with SGHI ETL Workflows.</h3>
<p align="center" style="text-align: center;">
<img alt="Python Version from PEP 621 TOML" src="https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fsavannahghi%2Fsghi-etl-commons%2Fdevelop%2Fpyproject.toml&logo=python&labelColor=white">
<a href="https://microsoft.github.io/pyright/">
<img alt="Checked with pyright" src="https://microsoft.github.io/pyright/img/pyright_badge.svg">
</a>
Expand All @@ -10,16 +11,19 @@
<a href="https://github.com/pre-commit/pre-commit">
<img alt="pre-commit" src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white">
</a>
<a href="https://github.com/savannahghi/sghi-etl-commons/blob/main/LICENSE">
<a href="https://github.com/semantic-release/semantic-release">
<img alt="Semantic Release: conventionalcommits" src="https://img.shields.io/badge/semantic--release-conventionalcommits-e10079?logo=semantic-release"/>
</a>
<a href="https://github.com/savannahghi/sghi-etl-commons/blob/develop/LICENSE">
<img alt="GitHub License" src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
</p>
<p align="center" style="text-align: center;">
<a href="https://github.com/savannahghi/sghi-etl-commons/actions/workflows/ci.yml">
<img alt="CI" src="https://github.com/savannahghi/sghi-etl-commons/actions/workflows/ci.yml/badge.svg">
</a>
<a href="https://coveralls.io/github/savannahghi/sghi-etl-commons?branch=main">
<img alt="Coverage Status" src="https://coveralls.io/repos/github/savannahghi/sghi-etl-commons/badge.svg?branch=main">
<a href="https://coveralls.io/github/savannahghi/sghi-etl-commons?branch=develop">
<img alt="Coverage Status" src="https://img.shields.io/coverallsCoverage/github/savannahghi/sghi-etl-commons?branch=develop&logo=coveralls">
</a>
</p>

Expand Down
24 changes: 24 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## [1.0.0-rc.1](https://github.com/savannahghi/sghi-etl-commons/compare/...v1.0.0-rc.1) (2024-04-16)


### Dependency Updates

* **deps:** upgrade project dependencies ([#2](https://github.com/savannahghi/sghi-etl-commons/issues/2)) ([6bee92c](https://github.com/savannahghi/sghi-etl-commons/commit/6bee92caa6464c52ee03c0a609dec5fd5b919fea))


### Features

* **processors:** add a `ProcessorPipe` ([#10](https://github.com/savannahghi/sghi-etl-commons/issues/10)) ([82a006e](https://github.com/savannahghi/sghi-etl-commons/commit/82a006ee58bfacc723e3bed2612114f002276719))
* **processors:** add a NOOP `Processor` ([#3](https://github.com/savannahghi/sghi-etl-commons/issues/3)) ([ecdf529](https://github.com/savannahghi/sghi-etl-commons/commit/ecdf529bbf091dc3d88060331ba6dc66703118f5))
* **processors:** add a processor decorator ([#4](https://github.com/savannahghi/sghi-etl-commons/issues/4)) ([9f3b039](https://github.com/savannahghi/sghi-etl-commons/commit/9f3b0393630c2bae8df568f4a0fd977f1d34effc))
* **sinks:** add a `NullSink` ([#9](https://github.com/savannahghi/sghi-etl-commons/issues/9)) ([2794f6a](https://github.com/savannahghi/sghi-etl-commons/commit/2794f6ab198d9a2e211cd57f3e6ab6c6aab0a815))
* **sinks:** add a sink decorator ([#7](https://github.com/savannahghi/sghi-etl-commons/issues/7)) ([6a89c85](https://github.com/savannahghi/sghi-etl-commons/commit/6a89c85d30e8a28abc995823df9fc06aa8d52f14))
* **sources:** add a source decorator ([#5](https://github.com/savannahghi/sghi-etl-commons/issues/5)) ([b42328e](https://github.com/savannahghi/sghi-etl-commons/commit/b42328e7c94bf975df4e2ddde454bdad13d8bae7))
* **utils:** add result gatherers ([#1](https://github.com/savannahghi/sghi-etl-commons/issues/1)) ([7c4e34f](https://github.com/savannahghi/sghi-etl-commons/commit/7c4e34f738e9b8774d7c1d7ba3e6386229b25786))
* **worflow_def:** add a `SimpleWorkflowDefinition` ([#11](https://github.com/savannahghi/sghi-etl-commons/issues/11)) ([ce1a9b0](https://github.com/savannahghi/sghi-etl-commons/commit/ce1a9b03a6fa6e0b6ab75a8635c98e0b8267be86))


### Refactors

* **processors:** mark `processors._ProcessorOfCallable` as final ([#6](https://github.com/savannahghi/sghi-etl-commons/issues/6)) ([9e5d6c6](https://github.com/savannahghi/sghi-etl-commons/commit/9e5d6c6d50a8e92cb2fe35537edf866dd1098d15))
* **sinks:** rename `sinks._SourceOfCallable` class ([#8](https://github.com/savannahghi/sghi-etl-commons/issues/8)) ([e6f08e5](https://github.com/savannahghi/sghi-etl-commons/commit/e6f08e5f9edb25067529980d9d13f7e3d75a3847))
34 changes: 33 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,39 @@
# Be strict about any broken references
nitpicky = True

nitpick_ignore = []
nitpick_ignore = [
("py:class", "_RDT"), # private type annotations
("py:class", "_PDT"), # private type annotations
("py:class", "Processor"), # docs aren't published yet
("py:class", "Sink"), # docs aren't published yet
("py:class", "Source"), # docs aren't published yet
("py:class", "WorkflowDefinition"), # docs aren't published yet
("py:class", "TracebackType"), # Used as type annotation. Only available when type checking
("py:class", "concurrent.futures._base.Future"), # sphinx can't find it
("py:class", "sghi.etl.commons.processors._RDT"), # private type annotations
("py:class", "sghi.etl.commons.processors._PDT"), # private type annotations
("py:class", "sghi.etl.commons.sinks._PDT"), # private type annotations
("py:class", "sghi.etl.commons.sources._RDT"), # private type annotations
("py:class", "sghi.etl.commons.utils.result_gatherers._T"), # private type annotations
("py:class", "sghi.etl.commons.workflow_definitions._RDT"), # private type annotations
("py:class", "sghi.etl.commons.workflow_definitions._PDT"), # private type annotations
("py:class", "sghi.etl.core._RDT"), # private type annotations
("py:class", "sghi.etl.core._PDT"), # private type annotations
("py:class", "sghi.etl.core.Processor"), # docs aren't published yet
("py:class", "sghi.etl.core.Sink"), # docs aren't published yet
("py:class", "sghi.etl.core.Source"), # docs aren't published yet
("py:class", "sghi.etl.core.WorkflowDefinition"), # docs aren't published yet
("py:class", "sghi.retry.Retry"), # docs aren't published yet
("py:exc", "ResourceDisposedError"), # docs aren't published yet
("py:exc", "sghi.disposable.ResourceDisposedError"), # docs aren't published yet
("py:func", "sghi.disposable.not_disposed"), # docs aren't published yet
("py:obj", "sghi.etl.commons.processors._PDT"), # private type annotations
("py:obj", "sghi.etl.commons.processors._RDT"), # private type annotations
("py:obj", "sghi.etl.commons.sinks._PDT"), # private type annotations
("py:obj", "sghi.etl.commons.sources._RDT"), # private type annotations
("py:obj", "sghi.etl.commons.workflow_definitions._RDT"), # private type annotations
("py:obj", "sghi.etl.commons.workflow_definitions._PDT"), # private type annotations
]

templates_path = ["templates"]

Expand Down
Loading

0 comments on commit 568e289

Please sign in to comment.