mirror of
https://github.com/niess/python-appimage.git
synced 2026-03-13 20:00:19 +01:00
Add VERSION for PyPI
This commit is contained in:
6
.github/workflows/pypi.yml
vendored
6
.github/workflows/pypi.yml
vendored
@@ -2,11 +2,7 @@ name: PyPI
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/pypi.yml'
|
||||
- 'LICENSE'
|
||||
- 'python_appimage/**'
|
||||
- 'README.md'
|
||||
- 'setup.py'
|
||||
- 'VERSION'
|
||||
|
||||
jobs:
|
||||
Test:
|
||||
|
||||
26
setup.py
26
setup.py
@@ -25,26 +25,14 @@ with open('README.md') as f:
|
||||
def get_version():
|
||||
'''Get the next version number from PyPI
|
||||
'''
|
||||
version = os.getenv('PYTHON_APPIMAGE_VERSION')
|
||||
if not version:
|
||||
try:
|
||||
_create_unverified_https_context = ssl._create_unverified_context
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
ssl._create_default_https_context = _create_unverified_https_context
|
||||
with open('VERSION') as f:
|
||||
version = f.read().strip()
|
||||
|
||||
meta = json.load(
|
||||
urlopen('https://pypi.org/pypi/python-appimage/json'))
|
||||
|
||||
version = meta['info']['version']
|
||||
numbers = version.split('.')
|
||||
numbers[-1] = str(int(numbers[-1]) + 1)
|
||||
version = '.'.join(numbers)
|
||||
|
||||
p = subprocess.Popen('git describe --match=NeVeRmAtCh --always --dirty',
|
||||
shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
p = subprocess.Popen(
|
||||
'git describe --match=NeVeRmAtCh --always --dirty 2> /dev/null || '
|
||||
'echo unknown',
|
||||
shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
stdout, _ = p.communicate()
|
||||
try:
|
||||
stdout = stdout.decode()
|
||||
|
||||
Reference in New Issue
Block a user