diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..837e722 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: napatrackmater_deploy +on: + workflow_dispatch: + inputs: + name: + description: "Hello KapoorLabs Lab member" + default: "Ready to dispach your code to PyPi" + +jobs: + + deploy: + + #needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U setuptools setuptools_scm wheel twine build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} + run: | + git tag + python -m build . + twine upload dist/* diff --git a/.github/workflows/napari-hub-preview.yml b/.github/workflows/napari-hub-preview.yml new file mode 100644 index 0000000..2f93c71 --- /dev/null +++ b/.github/workflows/napari-hub-preview.yml @@ -0,0 +1,21 @@ +name: napari hub Preview Page # we use this name to find your preview page artifact, so don't change it! +# For more info on this action, see https://github.com/chanzuckerberg/napari-hub-preview-action/blob/main/action.yml + +on: + pull_request: + branches: + - '**' + +jobs: + preview-page: + name: Preview Page Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: napari hub Preview Page Builder + uses: chanzuckerberg/napari-hub-preview-action@v0.1.5 + with: + hub-ref: main diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 7f34905..4df0937 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,7 +1,7 @@ # This workflows will upload a Python Package using Twine when a release is created # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: Manual Tests Trigger +name: napatrackmater_test_deploy on: workflow_dispatch: @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.platform }} strategy: matrix: - platform: [ubuntu-latest, windows-latest, macos-latest] + platform: [ubuntu-latest, macos-latest] python-version: ['3.8', '3.9', '3.10'] steps: @@ -27,41 +27,25 @@ jobs: with: python-version: ${{ matrix.python-version }} - # these libraries enable testing on Qt on linux - - uses: tlambert03/setup-qt-libs@v1 - - # strategy borrowed from vispy for installing opengl libs on windows - - name: Install Windows OpenGL - if: runner.os == 'Windows' - run: | - git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git - powershell gl-ci-helpers/appveyor/install_opengl.ps1 - - # note: if you need dependencies from conda, considering using - # setup-miniconda: https://github.com/conda-incubator/setup-miniconda - # and - # tox-conda: https://github.com/tox-dev/tox-conda - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install setuptools tox tox-gh-actions + pip install setuptools tox tox-gh-actions # this runs the platform-specific tests declared in tox.ini - name: Test with tox - uses: GabrielBB/xvfb-action@v1 - with: - run: python -m tox + run: tox env: PLATFORM: ${{ matrix.platform }} - name: Coverage uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: false 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] + + #needs: [test] runs-on: ubuntu-latest if: contains(github.ref, 'tags') steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e32296c..d2dd223 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,29 +5,33 @@ repos: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace - - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort + + - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.2.3 hooks: - id: pyupgrade args: [--py38-plus, --keep-runtime-typing] - repo: https://github.com/myint/autoflake - rev: v2.2.1 + rev: v2.0.0 hooks: - id: autoflake args: ["--in-place", "--remove-all-unused-imports"] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 22.10.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: [flake8-typing-imports>=1.9.0] args: ["--ignore=E501,E203,W503"] - + # Add a custom hook to update _version.py + - repo: local + hooks: + - id: update-version + name: Update _version.py with Git tag + entry: python update_version.py + language: system + pass_filenames: false