From 1e66ad4654e543d7a6db57b77e020cd6cc89f52f Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Tue, 7 Nov 2023 10:48:48 -0800 Subject: [PATCH] Use trusted publishing for releases (#678) * Use trusted publishing instead of secrets * Add isort on save, remove deprecated setting --- .github/workflows/test-package-build.yml | 12 ++++++++---- .vscode/settings.json | 11 +++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 4b968802e..3d87548fc 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -80,15 +80,19 @@ jobs: # - name: Run tests # run: pytest --doctest-modules -v --pyargs spyglass publish: + name: Upload release to PyPI runs-on: ubuntu-latest needs: [test-package] + environment: + name: pypi + url: https://pypi.org/p/spyglass-neuro + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v3 with: name: dist path: dist/ - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c05895e3..54a7c2424 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,11 +4,18 @@ "files.trimFinalNewlines": true, "editor.multiCursorModifier": "ctrlCmd", "autoDocstring.docstringFormat": "numpy", - "python.formatting.provider": "none", "remote.SSH.remoteServerListenOnSocket": true, "git.confirmSync": false, "python.analysis.typeCheckingMode": "off", "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter" + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true + }, }, + "isort.args": [ + "--profile", + "black" + ], } \ No newline at end of file