Skip to content

Commit

Permalink
Merge pull request #834 from benjeffery/version_check
Browse files Browse the repository at this point in the history
PEP 440 version check in CI
  • Loading branch information
mergify[bot] authored Sep 4, 2020
2 parents 50460b2 + 58fcf03 commit f0755c4
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
command: |
pre-commit run --all-files --show-diff-on-failure
- run:
name: Compile C with gcc
command: |
Expand Down
6 changes: 1 addition & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ build_script:
- cmd: cd python
- cmd: python setup.py build_ext --inplace
# Install some modules needed for tests
- cmd: python -m pip install PyVCF
- cmd: python -m pip install newick
- cmd: python -m pip install python_jsonschema_objects
- cmd: python -m pip install xmlunittest
- cmd: python -m pip install portion
- cmd: python -m pip install -r requirements/appveyor-pypi.txt
- cmd: python -m nose -vs --processes=%NUMBER_OF_PROCESSORS% --process-timeout=5000

after_test:
Expand Down
6 changes: 6 additions & 0 deletions python/requirements/appveyor-pypi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PyVCF
newick
python_jsonschema_objects
xmlunittest
portion
packaging
1 change: 1 addition & 0 deletions python/requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ networkx
newick
nose
numpy
packaging
portion
pre-commit
pyparsing
Expand Down
38 changes: 38 additions & 0 deletions python/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# MIT License
#
# Copyright (c) 2020 Tskit Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
Test python package versioning
"""
import unittest

from packaging.version import Version

from tskit import _version


class TestPythonVersion(unittest.TestCase):
"""
Test that the version is PEP440 compliant
"""

def test_version(self):
self.assertEqual(str(Version(_version.tskit_version)), _version.tskit_version)
2 changes: 1 addition & 1 deletion python/tskit/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Definitive location for the version number.
# During development, should be x.y.z.devN
# For beta should be x.y.zbN
tskit_version = "0.3.1dev1"
tskit_version = "0.3.1.dev1"

0 comments on commit f0755c4

Please sign in to comment.