Skip to content

Commit b66937a

Browse files
Merge pull request #40 from webknjaz/release/v1.2.0-build-automation
Refactor the build automation
2 parents 06ecb2b + b49d180 commit b66937a

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ matrix:
2020
include:
2121
- python: '3.8'
2222
env: TOXENV=flakes
23-
- python: '3.8'
24-
env: TOXENV=readme
23+
- stage: Release
24+
name: Build and verify dists (and publish if tagged)
25+
python: '3.8'
26+
env:
27+
TOXENV: build-dists,metadata-validation
2528

2629
# piggyback on existing build for releases
30+
before_deploy:
31+
# make setup.py no-op because tox has already produced verified dists:
32+
- echo > setup.py
2733
deploy:
2834
provider: pypi
2935
user: nicoddemus
@@ -32,7 +38,8 @@ matrix:
3238
on:
3339
tags: true
3440
repo: pytest-dev/pytest-forked
35-
distributions: sdist bdist_wheel
41+
# keep the dists generated by tox:
42+
skip-cleanup: true
3643

3744
script: tox
3845
notifications:

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use_scm_version=True,
66
description='run tests in isolated forked subprocesses',
77
long_description=open('README.rst').read(),
8+
long_description_content_type='text/x-rst',
89
license='MIT',
910
author='pytest-dev',
1011
author_email='[email protected]',

tox.ini

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ isolated_build = true
55
envlist=
66
py{27,35,36,37,38}-pytest{310,46,54,latest}
77
flakes
8-
readme
8+
build-dists
9+
metadata-validation
910

1011
[testenv]
1112
deps =
@@ -25,11 +26,36 @@ changedir=
2526
deps = flake8
2627
commands = flake8 setup.py testing src/pytest_forked/
2728

28-
[testenv:readme]
29-
changedir =
30-
deps = readme
29+
[testenv:build-dists]
30+
basepython = python3
31+
isolated_build = true
32+
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
33+
usedevelop = false
34+
# don't install pytest-forked itself in this env
35+
skip_install = true
36+
deps =
37+
pep517 >= 0.7.0
38+
commands =
39+
rm -rfv {toxinidir}/dist/
40+
{envpython} -m pep517.build \
41+
--source \
42+
--binary \
43+
--out-dir {toxinidir}/dist/ \
44+
{toxinidir}
45+
whitelist_externals =
46+
rm
47+
48+
[testenv:metadata-validation]
49+
description =
50+
Verify that dists under the dist/ dir have valid metadata
51+
depends =
52+
build-dists
53+
deps =
54+
twine
55+
usedevelop = false
3156
skip_install = true
32-
commands = python setup.py check -r -s
57+
commands =
58+
twine check {toxinidir}/dist/*
3359

3460
[pytest]
3561
addopts = -rsfxX

0 commit comments

Comments
 (0)