Skip to content

Commit deb62e6

Browse files
author
goodboy
authored
Merge pull request #139 from nicoddemus/travis-deploy
Deploy using Travis
2 parents e778f7a + 9f4f954 commit deb62e6

File tree

5 files changed

+50
-16
lines changed

5 files changed

+50
-16
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ docs/_build/
5656
# PyBuilder
5757
target/
5858
*.swp
59+
60+
# generated by setuptools_scm
61+
pluggy/_version.py

.travis.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: false
22
language: python
33

4-
matrix:
4+
jobs:
55
include:
66
- python: '3.6'
77
env: TOXENV=check
@@ -30,6 +30,22 @@ matrix:
3030
- python: '3.6'
3131
env: TOXENV=benchmark
3232

33+
- stage: deploy
34+
python: '3.6'
35+
env:
36+
install: pip install -U setuptools setuptools_scm
37+
script: skip
38+
deploy:
39+
provider: pypi
40+
user: nicoddemus
41+
distributions: sdist bdist_wheel
42+
skip_upload_docs: true
43+
password:
44+
secure: PDvQCKfXrF1V/tdwEOfeDEjDs6vJ9gKWo4yrMUmBx1JL5plHZaqfHLftlGMoHekaQTHcfyYYbxignFw5IGsn97/nFKKWDPNBfZA+3RJJmeJfz2NQunYkSnoqtBtfEtWHzFPdkCm0w/CN9C8IpRjhvLnFTUQzil6iMy6wZG276gU=
45+
on:
46+
tags: true
47+
repo: pytest-dev/pluggy
48+
3349
install:
3450
- pip install -U setuptools pip
3551
- pip install -U tox
@@ -44,5 +60,3 @@ notifications:
4460
on_success: change
4561
on_failure: change
4662
skip_join: true
47-
# email:
48-

HOWTORELEASE.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Release Procedure
2+
-----------------
3+
4+
#. Update the ``CHANGELOG.rst`` for the new release and commit.
5+
6+
#. Open a PR named ``release-X.Y.Z`` targeting ``master``.
7+
8+
#. All tests must pass and the PR must be approved by at least another maintainer.
9+
10+
#. Publish to PyPI by pushing a tag::
11+
12+
git tag X.Y.Z release-X.Y.Z
13+
git push [email protected]:pytest-dev/pluggy.git X.Y.Z
14+
15+
The tag will trigger a new build, which will deploy to PyPI.
16+
17+
#. Make sure it is `available on PyPI <https://pypi.org/project/pluggy>`_.
18+
19+
#. Merge ``release-X.Y.Z`` into ``master``, either manually or using GitHub's web interface.
20+

pluggy/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
__version__ = '0.6.1.dev'
1+
try:
2+
from ._version import version as __version__
3+
except ImportError:
4+
# broken installation, we don't even try
5+
# unknown only works because we do poor mans version compare
6+
__version__ = 'unknown'
27

38
__all__ = ["PluginManager", "PluginValidationError", "HookCallError",
49
"HookspecMarker", "HookimplMarker"]

setup.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from setuptools import setup
32

43
classifiers = [
@@ -20,22 +19,15 @@
2019
long_description = fd.read()
2120

2221

23-
def get_version():
24-
p = os.path.join(os.path.dirname(
25-
os.path.abspath(__file__)), "pluggy/__init__.py")
26-
with open(p) as f:
27-
for line in f.readlines():
28-
if "__version__" in line:
29-
return line.strip().split("=")[-1].strip(" '")
30-
raise ValueError("could not read version")
31-
32-
3322
def main():
3423
setup(
3524
name='pluggy',
3625
description='plugin and hook calling mechanisms for python',
3726
long_description=long_description,
38-
version=get_version(),
27+
use_scm_version={
28+
'write_to': 'pluggy/_version.py',
29+
},
30+
setup_requires=['setuptools-scm'],
3931
license='MIT license',
4032
platforms=['unix', 'linux', 'osx', 'win32'],
4133
author='Holger Krekel',

0 commit comments

Comments
 (0)