Skip to content

Commit 3b6ea3c

Browse files
authored
Library version based on tags (#22)
* Add versioneer lib * Add version file * Update library * Add autogenerate documents
1 parent 6921679 commit 3b6ea3c

File tree

9 files changed

+2377
-4
lines changed

9 files changed

+2377
-4
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PuppeteerLibrary/_version.py export-subst

.github/workflows/pythonpublish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
run: |
1818
python -m pip install --upgrade pip
1919
pip install setuptools wheel twine
20+
- name: Update keywords document
21+
run: |
22+
python -m robot.libdoc -f html PuppeteerLibrary docs/PuppeteerLibrary.html
23+
- name: Git-Commit update documents
24+
uses: matheusalbino/[email protected]
2025
- name: Build and publish
2126
env:
2227
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include PuppeteerLibrary/_version.py

PuppeteerLibrary/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
WaitingKeywords,
2222
WaitingKeywordsAsync)
2323

24-
__version__ = '0.4.2'
24+
# Get the version from the _version.py versioneer file. For a git checkout,
25+
# this is computed based on the number of commits since the last tag.
26+
from ._version import get_versions
27+
__version__ = str(get_versions()['version']).split('+')[0]
28+
del get_versions
2529

2630

2731
class PuppeteerLibrary(DynamicCore):
@@ -134,3 +138,7 @@ def failure_occurred(self):
134138
except Exception as err:
135139
logger.warn("Keyword '%s' could not be run on failure: %s"
136140
% (self.run_on_failure_keyword, err))
141+
142+
from ._version import get_versions
143+
__version__ = get_versions()['version']
144+
del get_versions

0 commit comments

Comments
 (0)