diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..59723d5 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +repo_token: pimxLpnWK3uJUfmMCBoLfww8iHhEIaoXs + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fdb55e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +on: push + +jobs: + test: + strategy: + matrix: + os: [ubuntu-18.04, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tox on ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + tox + + - name: Run tox on windows/mac + # Matches the 'o' in 'windows' or 'macos' + if: contains(matrix.os, 'o') + run: | + tox + + - name: Run coveralls + run: | + pip install coveralls pyyaml + coveralls + + deploy: + runs-on: ubuntu-18.04 + needs: test + steps: + - uses: actions/checkout@v2 + - uses: actions/checkout@master + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install dependencies + run: python -m pip install wheel twine setuptools + + - name: Build wheel + run: | + python setup.py sdist + + - name: Publish package if tagged release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 1eb195e..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,81 +0,0 @@ -#Tell Gitlab to load these environental vars from the variables list -variables: - PYPI_USER: SECURE - PYPI_PASS: SECURE - -stages: - - build - - test - - deploy - -# Define a template stage with common settings -# that can be extended by specific stages. -# The except block will skip this stage if the commit -# message contains [skip build] -.build-skip-template: &build-skip-template - stage: build - except: - variables: - - $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i - -build docs: - <<: *build-skip-template - script: - - tox -e docs - tags: - - shared-linux - artifacts: - paths: - - doc/ - expire_in: 1 week - -test Linux: - stage: test - script: - - tox - tags: - - shared-linux - coverage: '/^TOTAL.*\s+(\d+\%)$/' - -test macOS: - stage: test - script: - - tox - tags: - - shared-mac - -test Windows: - stage: test - script: - - tox - tags: - - shared-win - -deploy pip to PyPI: - stage: deploy - when: manual - only: - - tags - - environment: - name: PyPI - url: https://pypi.python.org/pypi/scikit-surgery-sphere-fitting - - tags: - - pip-production - - artifacts: - paths: - - dist/ - - script: - # Install packages required to build/publish - # remove any previous distribution files - - pip install wheel twine setuptools - - rm -rf dist - - # bundle installer - - python setup.py bdist_wheel - - # Upload to pypi - - twine upload --repository pypi dist/* --username $PYPI_USER --password $PYPI_PASS diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 64c64b3..7225a9f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -10,7 +10,7 @@ We welcome contributions to scikit-surgery-sphere-fitting. Reporting bugs and feature requests ----------------------------------- -Please create a new issue on https://weisslab.cs.ucl.ac.uk/StephenThompson/sksurgeryspherefitting/issues/new +Please create a new issue on https://github.com/thompson318/sksurgeryspherefitting/issues/new When reporting a bug, please include: * The version of scikit-surgery-sphere-fitting you are using @@ -23,13 +23,13 @@ Fixing bugs or implement features The easiest way to contribute is to follow these guidelines: -1. Look through the issues on https://weisslab.cs.ucl.ac.uk/StephenThompson/sksurgeryspherefitting/issues and assign the relevant issue to yourself. If there is not an existing issue that covers your work, please create one: https://weisslab.cs.ucl.ac.uk/StephenThompson/sksurgeryspherefitting/issues/new +1. Look through the issues on https://github.com/thompson318/sksurgeryspherefitting/issues and assign the relevant issue to yourself. If there is not an existing issue that covers your work, please create one: https://github.com/thompson318/sksurgeryspherefitting/issues/new 2. Read the design considerations below. -3. Fork the repository: https://weisslab.cs.ucl.ac.uk/StephenThompson/sksurgeryspherefitting/forks/new +3. Fork the repository: https://github.com/thompson318/sksurgeryspherefitting/forks/new 4. Create a branch for your changes. The branch name should start with the issue number, followed by hyphen separated words describing the issue. For example: 1-update-contribution-guidelines 5. Make your changes following the coding guidelines below. 6. Commit and push your changes to your fork. The commit message should start with `Issue #`, for example: "Issue #1: Fixed typo". Commit in small, related chunks. Review each commit and explain its purpose in the commit message. -7. Submit a merge request: https://weisslab.cs.ucl.ac.uk/StephenThompson/sksurgeryspherefitting/merge_requests/new +7. Submit a merge request: https://github.com/thompson318/sksurgeryspherefitting/merge_requests/new Design Considerations --------------------- diff --git a/README.rst b/README.rst index b63845d..68c44e9 100644 --- a/README.rst +++ b/README.rst @@ -1,18 +1,18 @@ scikit-surgery-sphere-fitting -=============================== +============================= -.. image:: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/raw/master/project-icon.png +.. image:: https://github.com/thompson318/scikit-surgery-sphere-fitting/raw/master/project-icon.png :height: 128px :width: 128px - :target: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting + :target: https://github.com/thompson318/scikit-surgery-sphere-fitting :alt: Logo -.. image:: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/badges/master/build.svg - :target: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/pipelines - :alt: GitLab-CI test status +.. image:: https://github.com/thompson318/scikit-surgery-sphere-fitting/workflows/.github/workflows/ci.yml/badge.svg + :target: https://github.com/thompson318/scikit-surgery-sphere-fitting/actions + :alt: GitHub Actions CI status -.. image:: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/badges/master/coverage.svg - :target: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/commits/master +.. image:: https://coveralls.io/repos/github/thompson318/scikit-surgery-sphere-fitting/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/thompson318/scikit-surgery-sphere-fitting?branch=master :alt: Test coverage .. image:: https://readthedocs.org/projects/scikit-surgery-sphere-fitting/badge/?version=latest @@ -20,10 +20,9 @@ scikit-surgery-sphere-fitting :alt: Documentation Status - Author: Stephen Thompson -scikit-surgery-sphere-fitting is part of the `SNAPPY`_ software project, developed at the `Wellcome EPSRC Centre for Interventional and Surgical Sciences`_, part of `University College London (UCL)`_. +scikit-surgery-sphere-fitting is part of the `SciKit-Surgery`_ software project, developed at the `Wellcome EPSRC Centre for Interventional and Surgical Sciences`_, part of `University College London (UCL)`_. scikit-surgery-sphere-fitting supports Python 3.6. @@ -39,6 +38,13 @@ It was created in part to provide a simple demonstration of algorithm developmen program of SNAPPY Tutorials, but also provides a useful service should you want to fit a sphere to some data. +Citing +------ +If you use SciKit-Surgery-Sphere-Fitting in your research or teaching please cite it. Individual releases can be cited via the Zenodo tag above. SciKit-Surgery should be cited as: + +Thompson S, Dowrick T, Ahmad M, et al. "SciKit-Surgery: compact libraries for surgical navigation." International Journal of Computer Assisted Radiology and Surgery. 2020 May. DOI: `10.1007/s11548-020-02180-5`_. + + Developing ---------- @@ -49,7 +55,7 @@ You can clone the repository using the following command: :: - git clone https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting + git clone https://github.com/thompson318/scikit-surgery-sphere-fitting Running tests @@ -79,7 +85,7 @@ You can pip install directly from the repository as follows: :: - pip install git+https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting + pip install git+https://github.com/thompson318/scikit-surgery-sphere-fitting or directly from pypi @@ -115,12 +121,12 @@ Supported by `Wellcome`_ and `EPSRC`_. .. _`Wellcome EPSRC Centre for Interventional and Surgical Sciences`: http://www.ucl.ac.uk/weiss -.. _`source code repository`: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting +.. _`source code repository`: https://github.com/thompson318/scikit-surgery-sphere-fitting .. _`Documentation`: https://scikit-surgery-sphere-fitting.readthedocs.io -.. _`SNAPPY`: https://weisslab.cs.ucl.ac.uk/WEISS/PlatformManagement/SNAPPY/wikis/home +.. _`SciKit-Surgery`: https://github.com/UCL/scikit-surgery/wiki .. _`University College London (UCL)`: http://www.ucl.ac.uk/ .. _`Wellcome`: https://wellcome.ac.uk/ .. _`EPSRC`: https://www.epsrc.ac.uk/ -.. _`contributing guidelines`: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/blob/master/CONTRIBUTING.rst -.. _`license file`: https://weisslab.cs.ucl.ac.uk/StephenThompson/scikit-surgery-sphere-fitting/blob/master/LICENSE - +.. _`contributing guidelines`: https://github.com/thompson318/scikit-surgery-sphere-fitting/blob/master/CONTRIBUTING.rst +.. _`license file`: https://github.com/thompson318/scikit-surgery-sphere-fitting/blob/master/LICENSE +.. _`10.1007/s11548-020-02180-5`: https://doi.org/10.1007/s11548-020-02180-5 diff --git a/requirements.txt b/requirements.txt index 551331e..d246df3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ # doc/requirements.rst numpy>=1.11 scipy -vtk +vtk<9.0 scikit-surgeryvtk diff --git a/setup.py b/setup.py index 5746102..234c567 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ install_requires=[ 'numpy>=1.11', 'scipy', - 'vtk', + 'vtk<9.0', 'scikit-surgeryvtk' ], diff --git a/tox.ini b/tox.ini index ed1bdc3..2e9ff34 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ # content of: tox.ini , put in same dir as setup.py [tox] -envlist = py36,lint +envlist = py37,lint skipsdist = True [travis] python = - 3.6: py36, docs, lint + 3.7: py37, docs, lint [testenv] deps=-rrequirements-dev.txt @@ -16,22 +16,22 @@ commands = coverage erase coverage report -m [testenv:lint] -basepython=python3.6 +basepython=python3.7 deps=pylint {[testenv]deps} commands=pylint --rcfile=tests/pylintrc sksurgeryspherefitting tests [testenv:docs] -basepython=python3.6 +basepython=python3.7 changedir = doc commands = sphinx-build -M html . build [testenv:installer] -basepython=python3.6 +basepython=python3.7 commands=pyinstaller --onefile sksurgeryspherefitting.py --noconfirm --windowed [testenv:pip3] -basepython=python3.6 +basepython=python3.7 changedir=pip_test skip_install=True commands = pip install {posargs}