diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c45b11f..7f1627f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.9, "3.10"] + python-version: [3.9, "3.10", "3.11"] env: DISPLAY: ':99.0' steps: @@ -114,4 +114,44 @@ jobs: files: src/server/coverage.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + + deploy: + # this will run when you have tagged a commit, starting with "v*" + # and requires that you have put your twine API key in your + # github secrets (see readme for details) + needs: [test_client, test_server] + runs-on: ubuntu-latest + if: contains(github.ref, 'tags') + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install twine + pip install build + + - name: Build and publish dcp_client + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} + run: | + git tag + python -m build . + twine upload dist/* + working-directory: src/client + + - name: Build and publish dcp_server + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} + run: | + git tag + python -m build . + twine upload dist/* + working-directory: src/server diff --git a/src/client/README.md b/src/client/README.md index dd0c6947..dc5c02f4 100644 --- a/src/client/README.md +++ b/src/client/README.md @@ -4,7 +4,14 @@ The client of our data centric platform for microscopy imaging. ![stability-wip](https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg) ## How to use? + ### Installation +This has been tested on Python versions 3.9, 3.10 and 3.11 on latest versions of Windows, Ubuntu and MacOS. In your dedicated environment run: +``` +pip install dcp_client +``` + +### Installation for developers Before starting, make sure you have navigated to ```data-centric-platform/src/client```. All future steps expect you are in the client directory. This installation has been tested using a conda environment with python version 3.9 on a mac local machine. In your dedicated environment run: ``` pip install -e . diff --git a/src/client/test/test_main_window.py b/src/client/test/test_main_window.py index b42fb588..d5fae533 100644 --- a/src/client/test/test_main_window.py +++ b/src/client/test/test_main_window.py @@ -158,14 +158,13 @@ def cleanup_files(request): # This code runs after all tests from all files have completed yield # Clean up - for fname in os.listdir('train_data_path'): - os.remove(os.path.join('train_data_path', fname)) - os.rmdir('train_data_path') - - for fname in os.listdir('in_prog'): - os.remove(os.path.join('in_prog', fname)) - os.rmdir('in_prog') - - for fname in os.listdir('eval_data_path'): - os.remove(os.path.join('eval_data_path', fname)) - os.rmdir('eval_data_path') + paths_to_clean = ['train_data_path', 'in_prog', 'eval_data_path'] + for path in paths_to_clean: + try: + for fname in os.listdir(path): + os.remove(os.path.join(path, fname)) + os.rmdir(path) + except FileNotFoundError: pass + except Exception as e: + # Handle other exceptions + print(f"An error occurred while cleaning up {path}: {e}") \ No newline at end of file diff --git a/src/server/README.md b/src/server/README.md index 208de07d..3978918b 100644 --- a/src/server/README.md +++ b/src/server/README.md @@ -9,6 +9,12 @@ The client and server communicate via the [bentoml](https://www.bentoml.com/?gcl ## How to use? ### Installation +This has been tested on Python versions 3.9, 3.10 and 3.11 on latest versions of Windows, Ubuntu and MacOS. In your dedicated environment run: +``` +pip install dcp_server +``` + +### Installation for developers Before starting make sure you have navigated to ```data-centric-platform/src/server```. All future steps expect you are in the server directory. In your dedicated environment run: ``` pip install -e .