Skip to content

Commit

Permalink
Add basic project layout and github ci setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Mar 4, 2022
1 parent 5fdd9ff commit fdb82b7
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: titusz
custom: "https://iscc.foundation/support/"
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI
on: [push, pull_request]

jobs:
tests:
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
os: [ubuntu-18.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.12

- name: Install Dependencies
run: poetry install

- name: Run Tests (Pure Python with coverage)
run: poetry run pytest --cov=iscc_core --cov-report=xml -q tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2

analyze:
name: Analyze
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
1 change: 1 addition & 0 deletions iscc_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[tool.poetry]
name = "iscc-sdk"
version = "0.1.0"
description = ""
authors = ["Titusz <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://sdk.iscc.codes"
repository = "https://github.com/iscc/iscc-sdk"
keywords=["iscc", "identifier", "media", "content", "hash", "blockchain", "similarity"]

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
iscc-core = "^0.2"
iscc-schema = "^0.3"

[tool.poetry.dev-dependencies]
pytest = "^7.0"
black = "^22.1"
coverage = "^6.3"
pytest-cov = "^3.0"
poethepoet = "^0.13"
bandit = "^1.7"

[tool.black]
skip-string-normalization = false
line-length = 100
target-version = ['py37']

[tool.poe.tasks]
black = { cmd = "poetry run black .", help = "Code style formating with black" }
test = { cmd = "poetry run pytest --cov=iscc_sdk --cov-fail-under=100", help = "Run tests with coverage" }
sec = { cmd = "poetry run bandit -r iscc_sdk -q", help = "Security check with bandit" }
all = ["black", "test", "sec"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/test_iscc_sdk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from iscc_sdk import __version__


def test_version():
assert __version__ == "0.1.0"

0 comments on commit fdb82b7

Please sign in to comment.