diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..57e271b --- /dev/null +++ b/.cruft.json @@ -0,0 +1,20 @@ +{ + "template": "https://github.com/funkelab/pycookie/", + "commit": "0c80c663d9e5d01e80eb1067e4a45722ee36eb36", + "checkout": null, + "context": { + "cookiecutter": { + "full_name": "Funke Lab", + "email": "funkej@hhmi.org", + "github_username": "funkelab", + "project_name": "quac", + "project_slug": "quac", + "project_short_description": "Quantitative Attribution with Counterfactuals", + "_copy_without_render": [ + ".github/workflows/tests.yaml" + ], + "_template": "https://github.com/funkelab/pycookie/" + } + }, + "directory": null +} diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..3d6329f --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,17 @@ +name: Python Black + +on: [push, pull_request] + +jobs: + lint: + name: Python Lint + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v4 + - name: Setup checkout + uses: actions/checkout@master + - name: Lint with Black + run: | + pip install black + black --diff --check src/quac tests diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml new file mode 100644 index 0000000..448c94a --- /dev/null +++ b/.github/workflows/mypy.yaml @@ -0,0 +1,18 @@ +name: Python mypy + +on: [push, pull_request] + +jobs: + static-analysis: + name: Python mypy + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v4 + - name: Setup checkout + uses: actions/checkout@v2 + - name: mypy + run: | + pip install . + pip install --upgrade mypy + mypy src/quac diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..039c926 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,25 @@ +name: Test + +on: + push: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install ".[dev]" + - name: Test with pytest + run: | + pytest tests \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d76b1b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/__pycache__ +**/*.egg-info +**/.vscode diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a2bf1d6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +ci: + autoupdate_schedule: monthly + autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]" + autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate" + +default_install_hook_types: [pre-commit, commit-msg] + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.0.1 + hooks: + - id: mypy diff --git a/README.md b/README.md new file mode 100644 index 0000000..6cf1de2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# quac + +[![tests](https://github.com/funkelab/quac/actions/workflows/tests.yaml/badge.svg)](https://github.com/funkelab/quac/actions/workflows/tests.yaml) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..af2155a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools", "wheel"] + +[project] +name = "quac" +description = "Quantitative Attribution with Counterfactuals" +readme = "README.md" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", +] +keywords = [] +license = { text = "BSD 3-Clause License" } +authors = [ + { email = "funkej@hhmi.org", name = "Funke Lab" }, +] +dynamic = ["version"] +dependencies = [] + +[project.optional-dependencies] +dev = [ + 'pytest', + 'black', + 'mypy', + 'pdoc', + 'pre-commit' +] + +[project.urls] +homepage = "https://github.com/funkelab/quac" +repository = "https://github.com/funkelab/quac" diff --git a/src/quac/__init__.py b/src/quac/__init__.py new file mode 100644 index 0000000..a0e594e --- /dev/null +++ b/src/quac/__init__.py @@ -0,0 +1,3 @@ +""" +.. include ../../README.md +""" diff --git a/tests/test_assert.py b/tests/test_assert.py new file mode 100644 index 0000000..39b433b --- /dev/null +++ b/tests/test_assert.py @@ -0,0 +1,2 @@ +def test_assert(): + assert True