Skip to content

Commit

Permalink
Merge pull request #241 from Dana-Farber-AIOS/fix_ci
Browse files Browse the repository at this point in the history
Fix ci
  • Loading branch information
jacob-rosenthal committed Nov 29, 2021
2 parents 60f6a59 + a6a7a41 commit 0baf8fb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Publish PathML distribution to PyPI and TestPyPI

on:
push:
tags: ['v*']
branches: [master]
release:
types: [published]

Expand Down
2 changes: 1 addition & 1 deletion pathml/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
License: GNU GPL 2.0
"""

__version__ = "1.0.5"
__version__ = "1.0.dev4"
37 changes: 35 additions & 2 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,38 @@


def test_version_format():
# semantic versioning format: major.minor.patch
assert re.match("^[\d]+.[\d]+.[\d]+$", pathml.__version__)
# regex to check that version specification complies with PEP440
# This regex pattern copied directly from pypa:
# https://github.com/pypa/packaging/blob/b5f0efdf3986725c2a45437e03d0ee5939c21192/packaging/version.py#L159-L188
VERSION_PATTERN = r"""
v?
(?:
(?:(?P<epoch>[0-9]+)!)? # epoch
(?P<release>[0-9]+(?:\.[0-9]+)*) # release segment
(?P<pre> # pre-release
[-_\.]?
(?P<pre_l>(a|b|c|rc|alpha|beta|pre|preview))
[-_\.]?
(?P<pre_n>[0-9]+)?
)?
(?P<post> # post release
(?:-(?P<post_n1>[0-9]+))
|
(?:
[-_\.]?
(?P<post_l>post|rev|r)
[-_\.]?
(?P<post_n2>[0-9]+)?
)
)?
(?P<dev> # dev release
[-_\.]?
(?P<dev_l>dev)
[-_\.]?
(?P<dev_n>[0-9]+)?
)?
)
(?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))? # local version
"""
_regex = re.compile(VERSION_PATTERN, re.VERBOSE | re.IGNORECASE)
assert _regex.search(pathml.__version__)

0 comments on commit 0baf8fb

Please sign in to comment.