diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml new file mode 100644 index 00000000..f9b27364 --- /dev/null +++ b/.github/workflows/Lint.yml @@ -0,0 +1,22 @@ +name: Lint + +on: [push, workflow_dispatch] + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + RUFF_OUTPUT_FORMAT: github + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 2 + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - uses: pre-commit/action@v3.0.1 \ No newline at end of file diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml new file mode 100644 index 00000000..c33cca3a --- /dev/null +++ b/.github/workflows/test-notebooks.yml @@ -0,0 +1,23 @@ +name: "Test notebooks" + +on: [push, workflow_dispatch] + +concurrency: + group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + tests: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: 'Install dependencies' + run: | + python -m pip install -U -r requirements.txt + python -m pip install -U pytest + - name: 'Run tests' + run: python -m pytest tests \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..be4f1c5a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +default_language_version: + python: python3.11 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: check-json + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + - repo: https://github.com/psf/black + rev: 24.3.0 + hooks: + - id: black-jupyter + - repo: https://github.com/nbQA-dev/nbQA + rev: 1.8.4 + hooks: + - id: nbqa-isort diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7b6ed272 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[tool.pytest.ini_options] +python_files = "test_*.py" +timeout_method = "thread" + +[tool.isort] +profile = "black" +combine_as_imports = true + +known_classiq = "classiq" +sections = [ + "FUTURE", + "STDLIB", + "THIRDPARTY", + "FIRSTPARTY", + "CLASSIQ", + "LOCALFOLDER", +] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..3b6d9de2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +classiq + +jupyter diff --git a/tests/test_dummy.py b/tests/test_dummy.py new file mode 100644 index 00000000..113ea94e --- /dev/null +++ b/tests/test_dummy.py @@ -0,0 +1,2 @@ +def test_dummy(): + assert 1+1 == 2 \ No newline at end of file