From eefd1806685172280a94228ae4a176f8e6fadbef Mon Sep 17 00:00:00 2001 From: "H. L. Nourse" <32994022+thenoursehorse@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:35:25 +0900 Subject: [PATCH] fix: add pypi dist (#35) * chore: wip of pypi dist * fix: finish pypi publish action --- .github/workflows/cd.yml | 30 ++++++++++++++++++++++--- README.md | 47 ++++++++++++++-------------------------- TODO.md | 5 ++--- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3a3aee1..21221ac 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,7 +32,7 @@ jobs: name: Release ${{ steps.tag_version.outputs.new_tag }} body: ${{ steps.tag_version.outputs.changelog }} - build: + build-docs: needs: [bump-version] runs-on: ubuntu-22.04 @@ -64,7 +64,7 @@ jobs: path: docs/_build deploy-docs: - needs: [build] + needs: [build-docs] runs-on: ubuntu-latest permissions: contents: read @@ -94,4 +94,28 @@ jobs: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 + + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: hynek/build-and-inspect-python-package@v1 + + publish: + needs: [dist] + environment: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/README.md b/README.md index c2c93ef..1ab1831 100644 --- a/README.md +++ b/README.md @@ -59,39 +59,10 @@ Lastly, the appropriate original theory outlined in the [documentation](https:// (Optional) Create a [virtual environment](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-virtual-environments). -Clone source - -```shell -git clone https://github.com/thenoursehorse/risb -cd risb -``` - -### With [pipx](https://pypa.github.io/pipx/) - -Install from local - -```shell -pipx install . -``` - -To develop code without reinstalling +Install ```shell -pipx install --editable . -``` - -### With pip - -Install from local - -```shell -pip install . -``` - -To develop code without reinstalling - -```shell -pip install -e . +pip install risb ``` ### Uninstall @@ -129,6 +100,13 @@ Apple M1/M2 (arm64, aarch64), and any amd64 system. The tests require a working [TRIQS](https://triqs.github.io/) installation. +Clone source + +```shell +git clone https://github.com/thenoursehorse/risb +cd risb +``` + Install the prerequisites ```shell @@ -143,6 +121,13 @@ pytest ## Documentation +Clone source + +```shell +git clone https://github.com/thenoursehorse/risb +cd risb +``` + Install the prerequisites ```shell diff --git a/TODO.md b/TODO.md index ce3b397..0a4fdd1 100644 --- a/TODO.md +++ b/TODO.md @@ -18,19 +18,18 @@ version 3.2.0 - Helper plot functions - Helper functions for calculating free/total energy - add linting actions -- pipy packaging - dimer insulator to explain some different insulating states - change references in docs to use sphinxcontrib-bibtex - ### In Progress - symmetry representation tutorial - Kagome/projectors tutorial - Finish TBmodels in tight-binding how-to - Sort out cross-referencing to API in docs -- action for hatchling version bump ### Done ✓ - Setup github actions - single-orbital Hubbard tutorial +- action for hatchling version bump (done with tag update action) +- pipy packaging \ No newline at end of file