diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a93a822 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: titusz +custom: "https://iscc.foundation/support/" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cf7a39f --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aed63d1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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/actions-poetry@v2.0.0 + 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 diff --git a/iscc_sdk/__init__.py b/iscc_sdk/__init__.py new file mode 100644 index 0000000..3dc1f76 --- /dev/null +++ b/iscc_sdk/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.0" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..743b78d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[tool.poetry] +name = "iscc-sdk" +version = "0.1.0" +description = "" +authors = ["Titusz "] +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" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_iscc_sdk.py b/tests/test_iscc_sdk.py new file mode 100644 index 0000000..380afbc --- /dev/null +++ b/tests/test_iscc_sdk.py @@ -0,0 +1,5 @@ +from iscc_sdk import __version__ + + +def test_version(): + assert __version__ == "0.1.0"