From f5861d705331a792c91b794a6d6004b061d41c36 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 16 Aug 2024 16:43:17 -0400 Subject: [PATCH] attempting to update flows --- .github/workflows/python-publish.yml | 42 ++++++++++++---------------- Examples/DICOMRTTool_Tutorial.ipynb | 36 ++++++++---------------- MANIFEST.in | 1 + requirements.txt | 2 +- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6e64ea1..c089923 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,40 +1,34 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Upload Python Package +name: Publish Python Package on: - release: - types: [published] - -permissions: - contents: read + push: + tags: + - 'v*' # Triggers the workflow on tag pushes that match the pattern v* jobs: - deploy: - + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Update to the latest version + - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 # Update to the latest version with: python-version: '3.x' + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt pip install build + - name: Build package run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python -m pip install --upgrade twine + python -m twine upload dist/* diff --git a/Examples/DICOMRTTool_Tutorial.ipynb b/Examples/DICOMRTTool_Tutorial.ipynb index b904750..0148b83 100644 --- a/Examples/DICOMRTTool_Tutorial.ipynb +++ b/Examples/DICOMRTTool_Tutorial.ipynb @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 1, "metadata": { "pycharm": { "name": "#%%\n" @@ -147,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "pycharm": { "name": "#%%\n" @@ -160,20 +160,11 @@ "text": [ "Zipped images already downloaded.\n", "Unzipping images...\n", - "Estimated unzip time is 2 minutes\n" - ] - }, - { - "ename": "BadZipFile", - "evalue": "File is not a zip file", - "output_type": "error", - "traceback": [ - "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[1;31mBadZipFile\u001B[0m Traceback (most recent call last)", - "File \u001B[1;32m:19\u001B[0m, in \u001B[0;36m\u001B[1;34m\u001B[0m\n", - "File \u001B[1;32mc:\\users\\b5anderson\\appdata\\local\\programs\\python\\python38\\lib\\zipfile.py:1269\u001B[0m, in \u001B[0;36mZipFile.__init__\u001B[1;34m(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)\u001B[0m\n\u001B[0;32m 1267\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[0;32m 1268\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m mode \u001B[38;5;241m==\u001B[39m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mr\u001B[39m\u001B[38;5;124m'\u001B[39m:\n\u001B[1;32m-> 1269\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_RealGetContents\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 1270\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m mode \u001B[38;5;129;01min\u001B[39;00m (\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mw\u001B[39m\u001B[38;5;124m'\u001B[39m, \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mx\u001B[39m\u001B[38;5;124m'\u001B[39m):\n\u001B[0;32m 1271\u001B[0m \u001B[38;5;66;03m# set the modified flag so central directory gets written\u001B[39;00m\n\u001B[0;32m 1272\u001B[0m \u001B[38;5;66;03m# even if no files are added to the archive\u001B[39;00m\n\u001B[0;32m 1273\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_didModify \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mTrue\u001B[39;00m\n", - "File \u001B[1;32mc:\\users\\b5anderson\\appdata\\local\\programs\\python\\python38\\lib\\zipfile.py:1336\u001B[0m, in \u001B[0;36mZipFile._RealGetContents\u001B[1;34m(self)\u001B[0m\n\u001B[0;32m 1334\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m BadZipFile(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mFile is not a zip file\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[0;32m 1335\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m endrec:\n\u001B[1;32m-> 1336\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m BadZipFile(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mFile is not a zip file\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[0;32m 1337\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdebug \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[0;32m 1338\u001B[0m \u001B[38;5;28mprint\u001B[39m(endrec)\n", - "\u001B[1;31mBadZipFile\u001B[0m: File is not a zip file" + "Estimated unzip time is 2 minutes\n", + "Done unzipping images.\n", + "All required files downloaded and unzipped!\n", + "CPU times: total: 31.8 s\n", + "Wall time: 36.1 s\n" ] } ], @@ -296,8 +287,7 @@ "metadata": { "pycharm": { "name": "#%%\n" - }, - "scrolled": false + } }, "outputs": [], "source": [ @@ -313,8 +303,7 @@ "metadata": { "pycharm": { "name": "#%%\n" - }, - "scrolled": false + } }, "outputs": [ { @@ -507,8 +496,7 @@ "metadata": { "pycharm": { "name": "#%%\n" - }, - "scrolled": false + } }, "outputs": [], "source": [ @@ -1164,9 +1152,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.8.0" } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/MANIFEST.in b/MANIFEST.in index 4f84cad..d83146f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,3 +5,4 @@ recursive-include src *.dcm recursive-include src *.ipynb recursive-include src *.py recursive-include src *.txt +include requirements.txt \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b45a367..c5f4313 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,5 @@ check-manifest tqdm~=4.64.0 pytest -PlotScrollNumpyArrays~=0.0.1 +PlotScrollNumpyArrays setuptools~=62.1.0 \ No newline at end of file