diff --git a/.github/workflows/pypi_release.yml b/.github/workflows/pypi_release.yml new file mode 100644 index 00000000..51d673ec --- /dev/null +++ b/.github/workflows/pypi_release.yml @@ -0,0 +1,32 @@ +# 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: Pypi Release + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-18.04 + + steps: + - 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 --upgrade pip + pip install setuptools wheel twine pypandoc + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.pypi_username }} + TWINE_PASSWORD: ${{ secrets.pypi_password }} + RELEASE: 1 + run: | + python setup.py sdist bdist_wheel + twine upload dist/* --verbose diff --git a/.github/workflows/sphix_build_master.yml b/.github/workflows/sphix_build_master.yml index 2bc2462d..d0cb61ee 100644 --- a/.github/workflows/sphix_build_master.yml +++ b/.github/workflows/sphix_build_master.yml @@ -43,7 +43,7 @@ jobs: # https://github.com/marketplace/actions/github-pages - name: Deploy if: success() - uses: crazy-max/ghaction-github-pages@master + uses: crazy-max/ghaction-github-pages@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/experiments/segmentation/test.py b/experiments/segmentation/test.py index b976ced8..67734cfa 100644 --- a/experiments/segmentation/test.py +++ b/experiments/segmentation/test.py @@ -178,7 +178,8 @@ def test(args): outname = os.path.splitext(impath)[0] + '.png' mask.save(os.path.join(outdir, outname)) - print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU)) + if args.eval: + print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU)) class ReturnFirstClosure(object): def __init__(self, data): diff --git a/setup.py b/setup.py index 02b1f369..ae35e8e2 100644 --- a/setup.py +++ b/setup.py @@ -18,10 +18,11 @@ version = '1.2.0' try: - from datetime import date - today = date.today() - day = today.strftime("b%Y%m%d") - version += day + if not os.getenv('RELEASE'): + from datetime import date + today = date.today() + day = today.strftime("b%Y%m%d") + version += day except Exception: pass