From 60f48d6a6ac2977180a12f10c506079e99981a4b Mon Sep 17 00:00:00 2001 From: joaopfonseca Date: Fri, 16 Feb 2024 12:41:21 +0000 Subject: [PATCH] DOC add deployment action + update readme (#23) --- .github/workflows/deploy-docs.yml | 77 +++++++++++++++++++++++++++++++ README.md | 8 ++-- sharp/_min_dependencies.py | 2 +- 3 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..d92122f --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,77 @@ +on: + push: + branches: [ main ] + + workflow_dispatch: + +jobs: + # Build job + build: + name: Build Docs + # At a minimum this job should upload artifacts using actions/upload-pages-artifact + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + architecture: x64 + + - name: Install + run: | + # NOTE: pip, setuptools and wheel should be included with any python + # installation. It's being installed/upgraded here because the + # setup-python action is not including setuptools with Python 3.12 + pip install --upgrade pip setuptools wheel + pip install .[docs] + + - name: Build Docs + run: | + cd doc + make html + + - name: Archive artifact + run: | + tar \ + --dereference --hard-dereference \ + --directory "$INPUT_PATH" \ + -cvf "$RUNNER_TEMP/artifact.tar" \ + --exclude=.git \ + --exclude=.github \ + . + env: + INPUT_PATH: "_build/html/" + + - name: Upload artifact + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: "ShaRP" + path: ${{ runner.temp }}/artifact.tar + if-no-files-found: error + + # Deploy job + deploy: + name: Documentation + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index d565f09..e323b07 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,13 @@ Some functions require Matplotlib (>= 2.2.3) for plotting. ### User Installation -**NOTE: DO NOT USE THIS METHOD. IT IS NOT IMPLEMENTED YET** - The easiest way to install ml-research is using ``pip`` : - pip install -U sharp + pip install -U xai-sharp Or ``conda`` : - conda install -c conda-forge sharp + conda install -c conda-forge xai-sharp The documentation includes more detailed [installation instructions](https://sharp.readthedocs.io/en/latest/getting-started.html). @@ -37,7 +35,7 @@ The following commands should allow you to setup the development version of the project with minimal effort: # Clone the project. - git clone https://github.com/joaopfonseca/sharp.git + git clone https://github.com/DataResponsibly/sharp.git cd sharp # Create and activate an environment diff --git a/sharp/_min_dependencies.py b/sharp/_min_dependencies.py index 478d45a..5da86b5 100644 --- a/sharp/_min_dependencies.py +++ b/sharp/_min_dependencies.py @@ -11,7 +11,7 @@ "numpy": (NUMPY_MIN_VERSION, "install"), "pandas": (PANDAS_MIN_VERSION, "install"), "scikit-learn": (SKLEARN_MIN_VERSION, "install"), - "matplotlib": (MATPLOTLIB_MIN_VERSION, "optional"), + "matplotlib": (MATPLOTLIB_MIN_VERSION, "optional, docs"), # "ml-research": ("0.4.2", "optional"), "pytest-cov": ("3.0.0", "tests"), "flake8": ("3.8.2", "tests"),