From 92679c845aa589d25f4eaab22d8538dfba0e4f72 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 11 Jun 2020 21:05:59 +0100 Subject: [PATCH 1/9] Issue #4 added coveralls --- .coveralls.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .coveralls.yml 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 + From 3566dfbfe665d4e5d680402bf2bae7724a918d75 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 11 Jun 2020 21:09:21 +0100 Subject: [PATCH 2/9] Issue #4 added github stuff --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++ .gitlab-ci.yml | 81 ---------------------------------------- 2 files changed, 61 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .gitlab-ci.yml 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 From 1083db3129411d56a63d671541235c44f669ca24 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 11 Jun 2020 21:22:55 +0100 Subject: [PATCH 3/9] Issue #4 3.6 to 3.7 --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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} From 36f789da2261bb6d011716dc0b2d316ec5e4e93b Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 11 Jun 2020 21:30:55 +0100 Subject: [PATCH 4/9] Issue #4 updated readme etc --- CONTRIBUTING.rst | 8 ++++---- README.rst | 33 ++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 17 deletions(-) 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..284ac8d 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 +.. image:: https://github.com/thompson318/scikit-surgery-sphere-fitting/badges/master/build.svg + :target: https://github.com/thompson318/scikit-surgery-sphere-fitting/pipelines :alt: GitLab-CI test 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/github/thompson318/scikit-surgery-sphere-fitting + :target: https://coveralls.io/github/thompson318/scikit-surgery-sphere-fitting :alt: Test coverage .. image:: https://readthedocs.org/projects/scikit-surgery-sphere-fitting/badge/?version=latest @@ -23,7 +23,7 @@ scikit-surgery-sphere-fitting 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 +39,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. 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 +56,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 +86,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 +122,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 From 5c326efebaef87f64a9a80f4eb5506f17a400cd6 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Fri, 12 Jun 2020 08:12:49 +0100 Subject: [PATCH 5/9] Issue #4 hold back vtk, lint threw 'vtk' has no 'vtkSphereSource' or vtkXMLPolyDataWriter on mac for vtk 9.0.0 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 551331e..0b6ae31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ numpy>=1.11 scipy vtk -scikit-surgeryvtk +scikit-surgeryvtk<9.0 diff --git a/setup.py b/setup.py index 5746102..969c2ea 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ 'numpy>=1.11', 'scipy', 'vtk', - 'scikit-surgeryvtk' + 'scikit-surgeryvtk<9.0' ], entry_points={ From 363ea69fb7dfb59ed5eb6282cb9b04a970edc1f5 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Fri, 12 Jun 2020 08:25:19 +0100 Subject: [PATCH 6/9] Issue #4 hold back vtk not surgeryvtk --- requirements.txt | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0b6ae31..d246df3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ # doc/requirements.rst numpy>=1.11 scipy -vtk -scikit-surgeryvtk<9.0 +vtk<9.0 +scikit-surgeryvtk diff --git a/setup.py b/setup.py index 969c2ea..234c567 100644 --- a/setup.py +++ b/setup.py @@ -53,8 +53,8 @@ install_requires=[ 'numpy>=1.11', 'scipy', - 'vtk', - 'scikit-surgeryvtk<9.0' + 'vtk<9.0', + 'scikit-surgeryvtk' ], entry_points={ From 3641eeb911e85d49eb26386950314f0c9453d1a2 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Fri, 12 Jun 2020 08:46:07 +0100 Subject: [PATCH 7/9] Issue #4 tidied readme --- README.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 284ac8d..8616779 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ scikit-surgery-sphere-fitting -=============================== +============================= .. image:: https://github.com/thompson318/scikit-surgery-sphere-fitting/raw/master/project-icon.png :height: 128px @@ -7,12 +7,13 @@ scikit-surgery-sphere-fitting :target: https://github.com/thompson318/scikit-surgery-sphere-fitting :alt: Logo -.. image:: https://github.com/thompson318/scikit-surgery-sphere-fitting/badges/master/build.svg - :target: https://github.com/thompson318/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 -.. image:: https://coveralls.io/github/thompson318/scikit-surgery-sphere-fitting - :target: https://coveralls.io/github/thompson318/scikit-surgery-sphere-fitting + :target: https://github.com/thompson318/scikit-surgery-sphere-fitting/actions + :alt: GitHub Actions CI status + +.. image:: https://coveralls.io/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 @@ -41,9 +42,9 @@ 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. SciKit-Surgery should be cited as: +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. +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 @@ -130,4 +131,4 @@ Supported by `Wellcome`_ and `EPSRC`_. .. _`EPSRC`: https://www.epsrc.ac.uk/ .. _`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 From f11146fddbcd1a5343a1f0edc54245d3e77c1f78 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Fri, 12 Jun 2020 08:58:03 +0100 Subject: [PATCH 8/9] Issue #4 tidy readme again --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index 8616779..7f93d9e 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,6 @@ scikit-surgery-sphere-fitting :alt: Logo .. 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 @@ -21,7 +20,6 @@ scikit-surgery-sphere-fitting :alt: Documentation Status - Author: Stephen Thompson 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)`_. From d0585d4f2f688d448bc336bddd67f129ca323ace Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Fri, 12 Jun 2020 09:38:22 +0100 Subject: [PATCH 9/9] Issue #4 more readme tidy --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 7f93d9e..68c44e9 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ scikit-surgery-sphere-fitting :target: https://github.com/thompson318/scikit-surgery-sphere-fitting/actions :alt: GitHub Actions CI status -.. image:: https://coveralls.io/github/thompson318/scikit-surgery-sphere-fitting/badge.svg?branch=master&service=github +.. 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 @@ -40,7 +40,7 @@ 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: +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`_.