Skip to content

Commit 55dc362

Browse files
committed
Use version.py instead of version.txt and add coverage.xml reporting
1 parent 419efdc commit 55dc362

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
.tox/
99
__pycache__/
1010
build/
11+
coverage.xml
1112
dist/
1213
htmlcov/
1314
venv/
14-
version.txt
15+
version.py

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ _Be sure to update the various properties so they pertain to your project._
2727
- Defines build system characteristics, more specifically those pertaining to `setuptools_scm` which provides automatic versioning based off git repo state.
2828
- Configures `pytest`.
2929

30-
_The only property that will need updating is the `write_to` destination for the `version.txt`-file._
30+
_The only property that will need updating is the `write_to` destination for the `version.py`-file._
3131

3232
> _While it would be ideal to fully migrate to `pyproject.toml` there are still several aspects of configuration that have not yet fully migrated to support the finalized [PEP 621] standard._
3333

blur_python_example/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .version import version as __version__ # noqa: F401

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77
build-backend = "setuptools.build_meta"
88

99
[tool.setuptools_scm]
10-
write_to = "blur_python_example/version.txt"
10+
write_to = "blur_python_example/version.py"
1111

1212
[tool.black]
1313
skip-string-normalization = true

setup.cfg

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = blur_python_example
3-
version = file: blur_python_example/version.txt
3+
version = file: blur_python_example/version.py
44
description = Template python project for blurstudio developed packages.
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -59,9 +59,6 @@ dev =
5959
pytest
6060
tox
6161

62-
[options.package_data]
63-
* = version.txt
64-
6562
[bdist_wheel]
6663
universal = 1
6764

tox.ini

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,36,37,38,39},black,flake8
2+
envlist = begin,py{27,36,37,38,39},end,black,flake8
33
skip_missing_interpreters = True
44
skipsdist = True
55

@@ -14,9 +14,24 @@ deps =
1414
coverage
1515
pytest
1616
commands =
17-
coverage erase
18-
coverage run -m pytest {posargs:tests/}
17+
# Ensure the version.py file is created
18+
python setup.py egg_info
19+
20+
coverage run --append -m pytest {posargs:tests/}
21+
22+
[testenv:begin]
23+
basepython = python3
24+
deps =
25+
coverage
26+
commands = coverage erase
27+
28+
[testenv:end]
29+
basepython = python3
30+
deps =
31+
coverage
32+
commands =
1933
coverage report
34+
coverage xml
2035

2136
[testenv:black]
2237
basepython = python3

0 commit comments

Comments
 (0)