Skip to content

Commit 1c4e4a3

Browse files
master doc build & pypi release (#276)
1 parent b8d83b0 commit 1c4e4a3

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

.github/workflows/pypi_release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Pypi Release
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-18.04
14+
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.7'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine pypandoc
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.pypi_username }}
28+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
29+
RELEASE: 1
30+
run: |
31+
python setup.py sdist bdist_wheel
32+
twine upload dist/* --verbose

.github/workflows/sphix_build_master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
# https://github.com/marketplace/actions/github-pages
4444
- name: Deploy
4545
if: success()
46-
uses: crazy-max/ghaction-github-pages@master
46+
uses: crazy-max/ghaction-github-pages@v1
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
with:

experiments/segmentation/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ def test(args):
178178
outname = os.path.splitext(impath)[0] + '.png'
179179
mask.save(os.path.join(outdir, outname))
180180

181-
print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU))
181+
if args.eval:
182+
print( 'pixAcc: %.4f, mIoU: %.4f' % (pixAcc, mIoU))
182183

183184
class ReturnFirstClosure(object):
184185
def __init__(self, data):

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818

1919
version = '1.2.0'
2020
try:
21-
from datetime import date
22-
today = date.today()
23-
day = today.strftime("b%Y%m%d")
24-
version += day
21+
if not os.getenv('RELEASE'):
22+
from datetime import date
23+
today = date.today()
24+
day = today.strftime("b%Y%m%d")
25+
version += day
2526
except Exception:
2627
pass
2728

0 commit comments

Comments
 (0)