From 9bf664b86e8a5c7a0851751886cab7616b915d73 Mon Sep 17 00:00:00 2001 From: Patrick Kidger <33688385+patrick-kidger@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:41:18 -0700 Subject: [PATCH] Added workflow files for release --- .github/FUNDING.yml | 1 + .github/workflows/release.yml | 27 ++++++++++++++++++++++++++ .github/workflows/run_tests.yml | 34 +++++++++++++++++++++++++++++++++ pyproject.toml | 3 +-- tests/requirements.txt | 1 + 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/run_tests.yml create mode 100644 tests/requirements.txt diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..aa6159b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [patrick-kidger] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..46977e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Release + uses: patrick-kidger/action_update_python_project@v2 + with: + python-version: "3.11" + test-script: | + cp -r ${{ github.workspace }}/tests ./tests + cp ${{ github.workspace }}/pyproject.toml ./pyproject.toml + python -m pip install -r ./tests/requirements.txt + pytest + pypi-token: ${{ secrets.pypi_token }} + github-user: patrick-kidger + github-token: ${{ github.token }} + email-user: ${{ secrets.email_user }} + email-token: ${{ secrets.email_token }} + email-server: ${{ secrets.email_server }} + email-target: ${{ secrets.email_target }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..5ae7f0c --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,34 @@ +name: Run tests + +on: + pull_request: + +jobs: + run-test: + strategy: + matrix: + python-version: [ 3.9, 3.11 ] + os: [ ubuntu-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r ./tests/requirements.txt + + - name: Checks with pre-commit + uses: pre-commit/action@v2.0.3 + + - name: Test with pytest + run: | + python -m pip install . + python -m pytest diff --git a/pyproject.toml b/pyproject.toml index d90b23d..5b39692 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,12 @@ [project] name = "quax" version = "0.0.1" -description = "Multiple dispatch via nonstandard interpretation, in JAX." +description = "Multiple dispatch in JAX via custom interpreters." readme = "README.md" requires-python ="~=3.9" license = {file = "LICENSE"} authors = [ {name = "Patrick Kidger", email = "contact@kidger.site"}, - # TODO: add others if they get involved ] keywords = ["jax", "multiple-dispatch", "equinox"] classifiers = [ diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..7d57363 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1 @@ +beartype \ No newline at end of file