Skip to content

Commit

Permalink
Automatic PyPi publishing (#15)
Browse files Browse the repository at this point in the history
* Changed distribution type from setup.py to pep517

* Update to workflow

* Changed version number. Fixed last problems with the packaging.

* Update README.md

Changed install instructions to represent new way of installation
  • Loading branch information
Thyre committed Oct 21, 2020
1 parent dee274c commit f022c0e
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 28 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish package

on: [ release ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install pep517
run: |
python -m pip install pep517 --user
- name: Build a binary wheel and a source tarball
run: |
python -m pep517.build --source --binary --out-dir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: SLIX
name: Test package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
build:
Expand All @@ -19,21 +15,27 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install flake8 pytest
pip install pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=SLIX --cov-report=xml --cov-report=html
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/dist/
/build/
/SLIX.egg-info/
dist/
build/
SLIX.egg-info/
/venv/
/.idea/
/*/__pycache__/
.vscode/settings.json
.vscode/settings.json
SLIX.egg-info/
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ By evaluating the SLI profiles of each image pixel, *SLIX* generates different p
With [`SLIXLineplotParameterGenerator`](#evaluation-of-sli-profiles), it is possible to evaluate individual SLI profiles and compute characteristics such as the number of peaks, their positions, and in-plane fiber direction angles. For a given SLI image stack, [`SLIXParameterGenerator`](#generation-of-parameter-maps) computes the desired parameter maps for all image pixels.

## Installation of SLIX
##### How to clone SLIX
##### How to clone SLIX (for further work)
```
git clone [email protected]:3d-pli/SLIX.git
cd SLIX
Expand All @@ -81,10 +81,13 @@ pip3 install -r requirements.txt

##### How to install SLIX as Python package
```
# Install via PyPi
pip install SLIX
# Install after cloning locally
git clone [email protected]:3d-pli/SLIX.git
cd SLIX
python3 setup.py install
pip install .
```

## Evaluation of SLI Profiles
Expand Down
5 changes: 5 additions & 0 deletions SLIX/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Module docstring text"""
__version__ = 'v1.2.1'

from . import toolbox
from . import visualization
2 changes: 1 addition & 1 deletion SLIX/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def create_background_mask(IMAGE, threshold=10):
return mask


def create_roiset(IMAGE, ROISIZE, extend=True):
def create_roiset(IMAGE, ROISIZE=1, extend=True):
"""
Create roi set of the given image by creating an image containing the average value of pixels within the
specified ROISIZE. The returned image will have twice the size in the third axis as the both halfs will be doubled
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
"wheel",
]
build-backend = "setuptools.build_meta"
37 changes: 37 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[metadata]
name = SLIX
version = v1.2.1-3
author = Jan Andre Reuter, Miriam Menzel
author_email = [email protected], [email protected]
description = SLIX allows an automated evaluation of SLI measurements and generates different parameter maps.
license_file = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
zip_safe = False
include_package_data = True
packages = find:
scripts =
bin/SLIXParameterGenerator
bin/SLIXLineplotParameterGenerator
install_requires =
numpy
scipy
matplotlib
pymp-pypi
nibabel
tifffile
tqdm
Pillow
tests_require =
pytest
flake8
pytest-cov
python_requires =
>= 3.6
13 changes: 0 additions & 13 deletions setup.py

This file was deleted.

0 comments on commit f022c0e

Please sign in to comment.