Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub CI #19

Merged
merged 6 commits into from
Feb 21, 2024
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
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "chore(deps): "
prefix-development: "chore(deps-dev): "
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: daily
commit-message:
prefix: "ci: "
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci: "
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### A CI workflow template that runs linting and python testing
### TODO: Modify as needed or as desired.

name: Test tap-spotify

on: [push]

jobs:
pytest:
runs-on: ubuntu-latest
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TAP_SPOTIFY_CLIENT_ID: ${{secrets.TAP_SPOTIFY_CLIENT_ID}}
TAP_SPOTIFY_CLIENT_SECRET: ${{secrets.TAP_SPOTIFY_CLIENT_SECRET}}
TAP_SPOTIFY_REFRESH_TOKEN: ${{secrets.TAP_SPOTIFY_REFRESH_TOKEN}}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install
- name: Test with pytest
run: |
poetry run pytest
111 changes: 86 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ keywords = [
license = "Apache 2.0"

[tool.poetry.dependencies]
python = "<3.11,>=3.7.1"
python = "^3.7.1"
requests = "^2.31.0"
singer-sdk = "^0.31.1"
singer-sdk = "^0.34.1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
Expand Down
23 changes: 0 additions & 23 deletions tap_spotify/tests/test_core.py

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Test Configuration."""

pytest_plugins = ("singer_sdk.testing.pytest_plugin",)
18 changes: 18 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Tests standard tap features using the built-in SDK tests library."""


from singer_sdk.testing import get_tap_test_class

from tap_spotify.tap import TapSpotify

SAMPLE_CONFIG = {}


# Run standard built-in tap tests from the SDK:
TestTapSpotify = get_tap_test_class(
tap_class=TapSpotify,
config=SAMPLE_CONFIG,
)


# TODO: Create additional tests as appropriate for your tap.
27 changes: 10 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
# This file can be used to customize dox tests as well as other test frameworks like flake8 and mypy
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py38
; envlist = py36, py38, py39
envlist = py37, py38, py39, py310, py311
isolated_build = true

[testenv]
whitelist_externals = poetry

allowlist_externals = poetry
commands =
poetry install -v
poetry run pytest
poetry run black --check tap_spotify/
poetry run flake8 tap_spotify
poetry run pydocstyle tap_spotify
poetry run mypy tap_spotify --exclude='tap_spotify/tests'


[flake8]
ignore = W503
max-line-length = 88
max-complexity = 10

[pydocstyle]
ignore = D105,D203,D213
[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py37, py38, py39, py310, py311
commands =
poetry install -v
poetry run pytest
Loading