Skip to content

Commit

Permalink
version v1.2.1 -> v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeberhardt committed Aug 16, 2021
1 parent a352641 commit 29b388f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pypi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist
name: dist
path: ./dist
- name: Publish sdist and wheel to PyPI
run: |
twine upload dist/*
Expand Down
2 changes: 1 addition & 1 deletion build/makefile_common
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ INCFLAGS = -I $(BOOST_INCLUDE)

GIT_VERSION := $(shell git describe --abbrev=7 --dirty --always --tags | sed 's/dirty/mod/g')
ifeq (,$(GIT_VERSION))
GIT_VERSION := v1.2.0
GIT_VERSION := v1.2.2
endif
C_OPTIONS+=-DVERSION=\"$(GIT_VERSION)\"

Expand Down
47 changes: 33 additions & 14 deletions build/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,47 @@ def in_conda():


def find_version():
"""Extract the current version of these python bindings from the __init__.py file."""
"""Extract the current version of AutoDock Vina.
The version will be obtained from (in priority order):
1. version.py (file created only when using GitHub Actions)
2. git describe
3. __init__.py (as failback)
"""
version_file = os.path.join(base_dir, 'vina', 'version.py')
if os.path.isfile(version_file):
with open(version_file) as f:
version = f.read().strip()

print('Version found: %s (from version.py)' % version)
return version

try:
git_output = subprocess.check_output(['git', 'describe', '--abbrev=7', '--dirty', '--always', '--tags'])
git_output = git_output.strip().decode()

if git_output.startswith('v'):
git_output = git_output[1:]
git_version = git_output.replace('dirty', 'mod').replace('-', '+', 1).replace('-', '.')
version = git_output.replace('dirty', 'mod').replace('-', '+', 1).replace('-', '.')

return git_version
print('Version found %s (from git describe)' % version)
return version
except:
try:
with open(os.path.join(base_dir, 'vina', '__init__.py')) as fp:
for line in fp:
version_match = re.match(r'^__version__ = "(.+?)"$', line)

if version_match:
version = version_match.group(1)
return version
raise RuntimeError('Could not find version string in vina/__init__.py.')
except IOError:
raise RuntimeError('Could not find vina/__init__.py.')
pass

init_file = os.path.join(base_dir, 'vina', '__init__.py')
with open(init_file) as f:
for line in f:
version_match = re.match(r'^__version__ = "(.+?)"$', line)

if version_match:
version = version_match.group(1)

print('Version found %s (from __init__.py)' % version)
return version

raise RuntimeError('Could not find version string for AutoDock Vina.')


def execute_command(cmd_line):
Expand Down
2 changes: 1 addition & 1 deletion build/python/vina/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Vina
#

__version__ = "1.2.0"
#__version__ = "1.2.2"

from .vina import Vina

Expand Down

0 comments on commit 29b388f

Please sign in to comment.