Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
64 changes: 54 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
inputs: {}

jobs:
build:

strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10"]

runs-on: ubuntu-latest

steps:
- name: Checking out repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.container[1] }}
uses: actions/setup-python@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -29,11 +32,52 @@ jobs:
python -m pip install -U pip setuptools wheel
python3 -m pip install -U .[dev]

- name: Check code formatting
run: find singer tests -type f -name '*.py' | xargs unify --check-only

- name: Analysing the code with pylint
run: pylint singer

- name: Runs tests with coverage
run: nosetests --with-doctest -v --nocapture
run: coverage run --parallel -m pytest

- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ".coverage.*"

coverage:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.8"

- name: Install and upgrade dependencies
run: |
python -m pip install -U pip setuptools wheel
python3 -m pip install -U .[dev]

- name: Download coverage data
uses: actions/download-artifact@v3.0.0
with:
name: coverage-data

- name: Combine coverage data
run: |
coverage combine
Comment thread
Samira-El marked this conversation as resolved.

- name: Generate XML coverage report
run: |
coverage xml

- name: Display human readable report
run: |
coverage report
Comment thread
Samira-El marked this conversation as resolved.
Comment thread
Samira-El marked this conversation as resolved.

# Optional if you want to use codecov.io
# - name: Upload coverage report
# uses: codecov/codecov-action@v3
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ ENV/
# Pipenv
Pipfile
Pipfile.lock
pyproject.toml

# Spyder project settings
.spyderproject
Expand Down
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://pre-commit.com for more information

# See https://pre-commit.ci/ for information about the continuous
# integration service for the pre-commit framework
ci:
autofix_prs: false
autoupdate_schedule: weekly
autoupdate_commit_msg: 'chore(deps): pre-commit autoupdate'
Comment thread
Samira-El marked this conversation as resolved.


# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
hooks:
- id: pyupgrade
name: pyupgrade (python)
args: [--py37-plus]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: black (python)
- repo: https://github.com/PyCQA/pylint
rev: v2.13.8
hooks:
- id: pylint
name: pylint (python)
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Submitting a PR

1. Write tests to cover any new code or code changes.
2. Please make sure that all tests pass and that the code passes linting with `make`.
3. Open up the PR.
1. Install and use [pre-commit](https://pre-commit.com/) to keep your changes in the style of the project.
2. Write tests to cover any new code or code changes.
3. Please make sure that all tests pass and that the code passes linting with `make`.
4. Open up the PR.
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tool.black]
line-length = 120

[tool.coverage.paths]
source = ["singer"]

[tool.coverage.run]
branch = true
source = ["singer"]

[tool.coverage.report]
fail_under = 76.0

[tool.isort]
profile = "black"
multi_line_output = 3
src_paths = "singer"
use_parentheses = true
known_first_party = "singer"
include_trailing_comma = true
add_imports = [
"from __future__ import annotations",
]
Comment thread
Samira-El marked this conversation as resolved.

[tool.pytest.ini_options]
addopts = "-v --doctest-modules"
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
setup(name="pipelinewise-singer-python",
version='2.0.1',
description="Singer.io utility library - PipelineWise compatible",
python_requires=">=3.7.0, <3.11",
long_description=long_description,
long_description_content_type="text/markdown",
author="TransferWise",
Expand All @@ -19,17 +20,18 @@
install_requires=[
'pytz',
'jsonschema==3.2.0',
'orjson==3.6.1',
'orjson==3.6.5',
'python-dateutil>=2.6.0',
'backoff==1.11.1',
'ciso8601',
],
extras_require={
'dev': [
'pylint==2.11.1',
'pytest==7.1.2',
'coverage[toml]~=6.3',
'ipython',
'ipdb',
'nose',
'unify==0.5'
]
},
Expand Down