Skip to content

Commit 09bff70

Browse files
nightly build (#248)
* Create pythonpublish.yml * Update setup.py * Update pythonpublish.yml * Update README.md * Update setup.py
1 parent 90c6a95 commit 09bff70

File tree

3 files changed

+43
-9
lines changed

3 files changed

+43
-9
lines changed
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: Upload Python Package
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
deploy:
13+
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
- name: Set up Python
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: '3.7'
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel twine pypandoc
26+
- name: Build and publish
27+
env:
28+
TWINE_USERNAME: ${{ secrets. PYPI_USERNAME }}
29+
TWINE_PASSWORD: ${{ secrets. PYPI_PASSWORD }}
30+
run: |
31+
python setup.py sdist bdist_wheel
32+
twine upload dist/* --verbose

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![PyPI](https://img.shields.io/pypi/v/torch-encoding.svg)](https://pypi.python.org/pypi/torch-encoding)
2+
[![PyPI Pre-release](https://img.shields.io/badge/pypi--prerelease-v1.1.0-ff69b4.svg)](https://pypi.org/project/torch-encoding/#history)
3+
[![Upload Python Package](https://github.com/zhanghang1989/PyTorch-Encoding/workflows/Upload%20Python%20Package/badge.svg)](https://github.com/zhanghang1989/PyTorch-Encoding/actions)
4+
15
# PyTorch-Encoding
26

37
created by [Hang Zhang](http://hangzh.com/)

setup.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919
cwd = os.path.dirname(os.path.abspath(__file__))
2020

21-
version = '1.0.1'
21+
version = '1.1.1'
2222
try:
23-
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
24-
cwd=cwd).decode('ascii').strip()
25-
version += '+' + sha[:7]
23+
from datetime import date
24+
today = date.today()
25+
day = today.strftime("b%d%m%Y")
26+
version += day
2627
except Exception:
2728
pass
2829

@@ -47,11 +48,7 @@ def run(self):
4748
setuptools.command.develop.develop.run(self)
4849
#subprocess.check_call("python tests/unit_test.py".split())
4950

50-
try:
51-
import pypandoc
52-
readme = pypandoc.convert('README.md', 'rst')
53-
except(IOError, ImportError):
54-
readme = open('README.md').read()
51+
readme = open('README.md').read()
5552

5653
requirements = [
5754
'numpy',
@@ -79,6 +76,7 @@ def run(self):
7976
url="https://github.com/zhanghang1989/PyTorch-Encoding",
8077
description="PyTorch Encoding Package",
8178
long_description=readme,
79+
long_description_content_type='text/markdown',
8280
license='MIT',
8381
install_requires=requirements,
8482
packages=find_packages(exclude=["tests", "experiments"]),

0 commit comments

Comments
 (0)