File tree Expand file tree Collapse file tree 3 files changed +43
-9
lines changed
Expand file tree Collapse file tree 3 files changed +43
-9
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
37created by [ Hang Zhang] ( http://hangzh.com/ )
Original file line number Diff line number Diff line change 1818
1919cwd = os .path .dirname (os .path .abspath (__file__ ))
2020
21- version = '1.0 .1'
21+ version = '1.1 .1'
2222try :
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
2627except 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
5653requirements = [
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" ]),
You can’t perform that action at this time.
0 commit comments