diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dba698c..c2016f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI +name: gptools on: push: @@ -7,6 +7,10 @@ on: branches: ["main"] workflow_dispatch: +# Needed for pypi using trusted publisher setup. +permissions: + id-token: write + env: # Our tests may contain a number of stochastic elements. Setting a seed will make sure they are # not flaky (but also hide potential issues). @@ -23,11 +27,11 @@ jobs: name: Package tests and linting runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v5" with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ${{ env.pythonLocation }} @@ -51,14 +55,12 @@ jobs: - name: Upload the package to test pypi uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - packages_dir: ${{ matrix.module }}/dist - repository_url: https://test.pypi.org/legacy/ - skip_existing: true + packages-dir: ${{ matrix.module }}/dist + repository-url: https://test.pypi.org/legacy/ + skip-existing: true - name: Upload the package to pypi on `main` only - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'onnela-lab' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'onnela-lab' && matrix.python-version == '3.10' uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: ${{ matrix.module }}/dist - skip_existing: true + packages-dir: ${{ matrix.module }}/dist + skip-existing: true diff --git a/stan/tests/test_stan_functions.py b/stan/tests/test_stan_functions.py index 2243d3c..b0182c2 100644 --- a/stan/tests/test_stan_functions.py +++ b/stan/tests/test_stan_functions.py @@ -91,7 +91,7 @@ def assert_stan_function_allclose( return # Verify against expected value. We only check one because we have already verified that they # are the same. - result, = fit.stan_variable("result") + result = fit.stan_variable("result")[0] if not isinstance(desired, list): desired = [desired] try: