File tree Expand file tree Collapse file tree 9 files changed +64
-55
lines changed Expand file tree Collapse file tree 9 files changed +64
-55
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ """Ensure that current version is not in conflict with published releases."""
2
+ import requests
3
+ from pkg_resources import parse_version
4
+ import subprocess as subp
5
+ from pathlib import PurePath
6
+
7
+ project_dir = PurePath (__file__ ).parent .parent
8
+ version_fn = project_dir / "src/iminuit/version.py"
9
+ changelog_fn = project_dir / "doc/changelog.rst"
10
+
11
+ with open (version_fn ) as f :
12
+ version = {}
13
+ exec (f .read (), version ) # this loads __version__
14
+ version = version ["__version__" ]
15
+
16
+ # make sure that changelog was updated
17
+ with open (changelog_fn ) as f :
18
+ assert version in f .read (), "changelog entry missing"
19
+
20
+ # make sure that version is not already tagged
21
+ tags = subp .check_output (["git" , "tag" ]).decode ().strip ().split ("\n " )
22
+ assert f"v{ version } " not in tags , "tag exists"
23
+
24
+ # make sure that version itself was updated
25
+ r = requests .get ("https://pypi.org/pypi/iminuit/json" )
26
+ releases = r .json ()["releases" ]
27
+ pypi_versions = [parse_version (v ) for v in releases ]
28
+ this_version = parse_version (version )
29
+ assert this_version not in pypi_versions , "pypi version exists"
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ name: Coverage
2
2
3
3
on :
4
4
pull_request :
5
- branches :
6
- - master
7
- - develop
8
5
paths-ignore :
9
6
- ' doc/**'
10
7
- ' .ci/**'
13
10
branches :
14
11
- master
15
12
- develop
13
+ - beta/*
16
14
17
15
jobs :
18
16
coverage :
29
27
run : |
30
28
python -m pip install --upgrade pip wheel
31
29
python -m pip install -r requirements-dev.txt
32
- - run : pre-commit run -a
33
- # -e is required here to track coverage properly
34
30
- run : python -m pip install -e .
35
31
- run : coverage run -m pytest
36
32
- uses : AndreMiras/coveralls-python-action@develop
Original file line number Diff line number Diff line change @@ -2,15 +2,11 @@ name: Docs
2
2
3
3
on :
4
4
pull_request :
5
- branches :
6
- - master
7
- - develop
8
5
paths-ignore :
9
6
- ' .ci/**'
10
7
push :
11
8
branches :
12
- - master
13
- - develop
9
+ - beta/*
14
10
15
11
jobs :
16
12
docs :
Original file line number Diff line number Diff line change
1
+ name : pre-commit
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - master
8
+ - develop
9
+ - beta/*
10
+
11
+ jobs :
12
+ version :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - uses : actions/checkout@v2
17
+ - uses : actions/setup-python@v2
18
+ with :
19
+ python-version : 3.8
20
+ - run : python -m pip install --upgrade pip wheel
21
+ - run : python -m pip install pre-commit
22
+ - run : pre-commit run -a
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ name: Test
2
2
3
3
on :
4
4
pull_request :
5
- # test every branch except master, master is tested by wheels.yml
6
- branches-ignore :
7
- - master
8
5
paths-ignore :
9
6
- ' doc/**'
10
7
- ' .ci/**'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Wheels
3
3
on :
4
4
push :
5
5
branches :
6
- - beta- *
6
+ - beta/ *
7
7
pull_request :
8
8
branches :
9
9
- master
44
44
path : ./wheelhouse/*.whl
45
45
46
46
sdist :
47
- name : Build source distribution
47
+ name : Build source package
48
48
runs-on : ubuntu-latest
49
49
steps :
50
50
- uses : actions/checkout@v2
68
68
path : dist/*.tar.gz
69
69
70
70
upload :
71
- if : " github.event.release.published "
71
+ if : " github.event.release"
72
72
needs : [wheels, sdist]
73
73
runs-on : ubuntu-latest
74
74
steps :
Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ repos:
32
32
- id : trailing-whitespace
33
33
exclude : ^doc/_static/.*.svg
34
34
35
+ - repo : local
36
+ hooks :
37
+ - id : version-check
38
+ name : version-check
39
+ language : python
40
+ additional_dependencies : [requests]
41
+ entry : python .ci/version_check.py
42
+
35
43
# Python linter (Flake8)
36
44
- repo : https://gitlab.com/pycqa/flake8
37
45
rev : 3.8.4
You can’t perform that action at this time.
0 commit comments