Skip to content

Commit f0755c4

Browse files
authored
Merge pull request #834 from benjeffery/version_check
PEP 440 version check in CI
2 parents 50460b2 + 58fcf03 commit f0755c4

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
command: |
4444
pre-commit run --all-files --show-diff-on-failure
4545
46-
4746
- run:
4847
name: Compile C with gcc
4948
command: |

appveyor.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ build_script:
2525
- cmd: cd python
2626
- cmd: python setup.py build_ext --inplace
2727
# Install some modules needed for tests
28-
- cmd: python -m pip install PyVCF
29-
- cmd: python -m pip install newick
30-
- cmd: python -m pip install python_jsonschema_objects
31-
- cmd: python -m pip install xmlunittest
32-
- cmd: python -m pip install portion
28+
- cmd: python -m pip install -r requirements/appveyor-pypi.txt
3329
- cmd: python -m nose -vs --processes=%NUMBER_OF_PROCESSORS% --process-timeout=5000
3430

3531
after_test:

python/requirements/appveyor-pypi.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PyVCF
2+
newick
3+
python_jsonschema_objects
4+
xmlunittest
5+
portion
6+
packaging

python/requirements/development.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ networkx
1515
newick
1616
nose
1717
numpy
18+
packaging
1819
portion
1920
pre-commit
2021
pyparsing

python/tests/test_version.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# MIT License
2+
#
3+
# Copyright (c) 2020 Tskit Developers
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
"""
23+
Test python package versioning
24+
"""
25+
import unittest
26+
27+
from packaging.version import Version
28+
29+
from tskit import _version
30+
31+
32+
class TestPythonVersion(unittest.TestCase):
33+
"""
34+
Test that the version is PEP440 compliant
35+
"""
36+
37+
def test_version(self):
38+
self.assertEqual(str(Version(_version.tskit_version)), _version.tskit_version)

python/tskit/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Definitive location for the version number.
22
# During development, should be x.y.z.devN
33
# For beta should be x.y.zbN
4-
tskit_version = "0.3.1dev1"
4+
tskit_version = "0.3.1.dev1"

0 commit comments

Comments
 (0)