summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-10-26 18:01:01 -0400
committerJason R. Coombs <jaraco@jaraco.com>2019-10-26 18:01:01 -0400
commitd4a388ebf11f045b4b122530f3fd9a10873b063a (patch)
tree739a378842ed36523105e245f0d93b97c0009434
parentcd4ea07d264e9ed914cd0dcdfaa29df09e6587c2 (diff)
parentc169e5e50fd5f18dfe554d06bfe3940cc950b13e (diff)
downloadpytest-runner-d4a388ebf11f045b4b122530f3fd9a10873b063a.tar.gz
Merge https://github.com/jaraco/skeleton
-rw-r--r--.coveragerc5
-rw-r--r--.travis.yml5
-rw-r--r--appveyor.yml2
-rw-r--r--pytest.ini2
-rw-r--r--setup.cfg1
-rw-r--r--skeleton.md22
-rw-r--r--tox.ini17
7 files changed, 34 insertions, 20 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..4582306
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,5 @@
+[run]
+omit = .tox/*
+
+[report]
+show_missing = True
diff --git a/.travis.yml b/.travis.yml
index cb30c47..6ccac8f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,11 +13,6 @@ jobs:
if: tag IS present
python: *latest_py3
before_script: skip
- env:
- - TWINE_USERNAME=jaraco
- # TWINE_PASSWORD
- - secure: Ud9UIW92Gdg2eZpuA9UwC0YjanRaD9CTpKXoLT9Cjp5C2rufwiZd8K/LXK6P6x/nVyLJ8+7HR+TQTReoO2c6kt2vVkA9i3KE2N/bD9PXQo80NwMWepFkRBJh28M9x3fGeQTYRegx3cUWVh4gaa9ZFZBwSjnRZvTtvQh1WhEvHWFzBkb/8CkifmQPmdEYT4D0JBskBAtC295G6p3FukcSdzKlDljY1G4m2ZDqUepYC0R0mr5vDz9JxbJ4axxUvvy7hVd5vrI6xshUc1lRYGocfTcc0IBCq8kw2nzG+KK06axBGFMqCioT4ohUFWB1sLj8pbwpc0uCLtjIBE9OnFZFt52ZKuJcJFAZwiQ3Mxnpg+WC39mrD+jAyIOBDIp/5+2JDCPGyD2i8RuBJrt1CzMqno+Y0K5H2g3XD7E+pclFgyj21JhqUzRAvYE9gbA6561PyFoi+JEFbk5eiNYRdWjp/7XJJSNWB3tDC6hbEAIGQLY2ZcZjnURKN92AC7361negFgwEaaCRUeHx3g7k/wrR/16Po3kFFb/vzQ4ygMxH0lVzzQ0M81121zl4fJPzs/klnBVcf4YOph8Gm6md3ARJu7CKDV2bt2Qr/TObroYFe/flAWZ+KM5DTFqd1dediYrrdVMDuvwSUn1kDjpRnrcI/v0MeT1Vx5v2yekS8iucwCY=
- - TOX_TESTENV_PASSENV="TWINE_USERNAME TWINE_PASSWORD"
script: tox -e release
cache: pip
diff --git a/appveyor.yml b/appveyor.yml
index 2b7808f..f35aa27 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -18,7 +18,7 @@ cache:
- '%LOCALAPPDATA%\pip\Cache'
test_script:
- - "python -m pip install tox tox-venv"
+ - "python -m pip install -U tox tox-venv virtualenv"
- "tox"
version: '{build}'
diff --git a/pytest.ini b/pytest.ini
index 10681ad..a86fb66 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8 --black
+addopts=--doctest-modules --flake8 --black --cov
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
filterwarnings=
ignore:Possible nested set::pycodestyle:113
diff --git a/setup.cfg b/setup.cfg
index 31585db..931d36d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -31,6 +31,7 @@ testing =
pytest-checkdocs
pytest-flake8
pytest-black-multipy
+ pytest-cov
# local
pytest-virtualenv
diff --git a/skeleton.md b/skeleton.md
index 7249407..52b97f0 100644
--- a/skeleton.md
+++ b/skeleton.md
@@ -103,13 +103,7 @@ Relies a .flake8 file to correct some default behaviors:
## Continuous Integration
-The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command. In addition to running tests, an additional deploy stage is configured to automatically release tagged commits. The username and password for PyPI must be configured for each project using the `travis` command and only after the travis project is created. As releases are cut with [twine](https://pypi.org/project/twine), the two values are supplied through the `TWINE_USERNAME` and `TWINE_PASSWORD`. To configure the latter as a secret, run the following command:
-
-```
-echo "TWINE_PASSWORD={password}" | travis encrypt
-```
-
-Or disable it in the CI definition and configure it through the web UI.
+The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command.
Features include:
- test against Python 2 and 3
@@ -118,6 +112,14 @@ Features include:
Also provided is a minimal template for running under Appveyor (Windows).
+### Continuous Deployments
+
+In addition to running tests, an additional deploy stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with Travis as the TWINE_PASSWORD environment variable. After the Travis project is created, configure the token through the web UI or with a command like the following (bash syntax):
+
+```
+TWINE_PASSWORD={token} travis env copy TWINE_PASSWORD
+```
+
## Building Documentation
Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e build-docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`.
@@ -127,3 +129,9 @@ In addition to building the sphinx docs scaffolded in `docs/`, the docs build a
## Cutting releases
By default, tagged commits are released through the continuous integration deploy stage.
+
+Releases may also be cut manually by invoking the tox environment `release` with the PyPI token set as the TWINE_PASSWORD:
+
+```
+TWINE_PASSWORD={token} tox -e release
+```
diff --git a/tox.ini b/tox.ini
index 82fb9ea..d267e16 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,14 +3,16 @@ envlist = python
minversion = 3.2
# https://github.com/jaraco/skeleton/issues/6
tox_pip_extensions_ext_venv_update = true
+# Ensure that a late version of pip is used even on tox-venv.
+requires =
+ tox-pip-version>=0.0.6
+ tox-venv
+
[testenv]
deps =
setuptools>=31.0.1
- # workaround for https://github.com/manahl/pytest-plugins/issues/110
- pytest < 4
- # workaround for https://github.com/manahl/pytest-plugins/issues/122
- virtualenv
+pip_version = pip
commands =
pytest {posargs}
usedevelop = True
@@ -28,9 +30,12 @@ commands =
skip_install = True
deps =
pep517>=0.5
- # workaround for https://github.com/pypa/twine/issues/423
- git+https://github.com/pypa/twine
+ twine>=1.13
path.py
+passenv =
+ TWINE_PASSWORD
+setenv =
+ TWINE_USERNAME = {env:TWINE_USERNAME:__token__}
commands =
python -c "import path; path.Path('dist').rmtree_p()"
python -m pep517.build .