Skip to content

Commit 59a7398

Browse files
authored
Merge pull request #58 from ryan-rs/feature/ASC-1352/add_make_targets_for_releasing_dev_builds_to_pypi
ASC-1352 Make Targets for Publishing "dev" Builds to PyPI
2 parents 0228e19 + 491092b commit 59a7398

File tree

4 files changed

+108
-33
lines changed

4 files changed

+108
-33
lines changed

Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ coverage-html: ## check code coverage with an HTML report
8484
coverage-term: ## check code coverage with a simple terminal report
8585
py.test --cov-report term-missing --cov=pytest_rpc tests/
8686

87-
release: clean ## package and upload a release
88-
python setup.py sdist upload
89-
python setup.py bdist_wheel upload
90-
9187
dist: clean ## builds source and wheel package
9288
python setup.py sdist
9389
python setup.py bdist_wheel
@@ -113,23 +109,33 @@ build: ## build a wheel
113109
re-build: ## build a wheel
114110
python setup.py bdist_wheel
115111

116-
bump-major: ## bumps the version of by major
112+
bump-major: ## bumps the major version
117113
bumpversion major
118114

119-
bump-minor: ## bumps the version of by minor
115+
bump-minor: ## bumps the minor version
120116
bumpversion minor
121117

122-
bump-patch: ## bumps the version of by patch
118+
bump-patch: ## bumps the patch version
123119
bumpversion patch
124120

125-
release-major: clean-build build develop lint test re-clean-build bump-major re-build publish ## package and upload a major release
121+
bump-build: ## bumps the build version
122+
bumpversion build
123+
124+
bump-release: ## prepares the version number for production release
125+
bumpversion --tag release
126+
127+
release-major: clean-build build develop lint test re-clean-build bump-major bump-release re-build publish ## package and upload a major release
128+
echo 'Successfully released!'
129+
echo 'Please push the newly created tag and commit to GitHub.'
130+
131+
release-minor: clean-build build develop lint test re-clean-build bump-minor bump-release re-build publish ## package and upload a minor release
126132
echo 'Successfully released!'
127133
echo 'Please push the newly created tag and commit to GitHub.'
128134

129-
release-minor: clean-build build develop lint test re-clean-build bump-minor re-build publish ## package and upload a minor release
135+
release-patch: clean-build build develop lint test re-clean-build bump-patch bump-release re-build publish ## package and upload a patch release
130136
echo 'Successfully released!'
131137
echo 'Please push the newly created tag and commit to GitHub.'
132138

133-
release-patch: clean-build build develop lint test re-clean-build bump-patch re-build publish ## package and upload a patch release
139+
release: clean-build build develop lint test re-clean-build bump-release re-build publish ## package and upload a patch release
134140
echo 'Successfully released!'
135141
echo 'Please push the newly created tag and commit to GitHub.'

docs/release_process.rst

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,86 @@
1-
===============
2-
Release Process
3-
===============
1+
==========================
2+
Production Release Process
3+
==========================
44

5-
The easiest way to release a new version of pytest-rpc is to use make.
5+
The workflow below is targeted at releasing production ready code to `PyPI`_.
6+
This workflow assumes that the current branch is up-to-date with desired changes
7+
and the code is validated to work for end users who are working with this
8+
project in production.
69

7-
1. First you will need to know the username and password for the account you want to use to release to PyPI shared_accounts_
10+
1. First you will need to know the username and password for the account you
11+
want to use to release to PyPI shared_accounts_.
812

9-
2. You will need to make sure that you are on the master branch, your working directory is clean and up to date.
13+
2. You will need to make sure that you are on the master branch, your working
14+
directory is clean and up to date.
1015

11-
3. Decide if you are going to increment the major, minor, or patch version. You can refer to semver_ to help you make that decision.
16+
3. Decide if you are going to increment the major, minor, or patch version.
17+
You can refer to semver_ to help you make that decision.
1218

13-
4. Use the `release-major`, `release-minor`, or `release-patch`.
19+
4. Use the `release-major`, `release-minor`, or `release-patch`. ::
1420

15-
**make release** ::
21+
make release-minor
1622

17-
make release-minor
18-
5. The task will stop and prompt you for you PyPI username and password if you dont have these set in your `.pypirc` file.
23+
5. The task will stop and prompt you for your `PyPI`_ username and password if
24+
you dont have these set in your `.pypirc` file.
1925

20-
6. Once the task has successfully completed you need to push the tag and commit.
26+
6. Once the task has successfully completed you need to push the tag and
27+
commit. ::
2128

22-
**push tag** ::
29+
git push origin && git push origin refs/tags/<tagname>
2330

24-
git push origin && git push origin refs/tags/<tagname>
25-
7. Create a release on GitHub. GitHub_release_
31+
7. Create a release on GitHub. (`GitHub release`_)
32+
33+
=================================
34+
Development Build Release Process
35+
=================================
36+
37+
The workflow below is targeted at releasing 'dev' builds to `PyPI`_.
38+
The purpose of this workflow is to put experimental or release candidate builds
39+
onto `PyPI`_ in order to test other projects that are dependent on this one.
40+
41+
1. First you will need to know the username and password for the account you
42+
want to use to release to PyPI shared_accounts_.
43+
44+
2. You will need to make sure that you are on your working directory is clean
45+
and up to date and you're on the correct branch that contains the
46+
experimental/non-production code.
47+
48+
3. Decide if you are going to increment the major, minor, or patch version.
49+
You can refer to semver_ to help you make that decision.
50+
51+
4. Use the `bump-major`, `bump-minor`, `bump-patch` or `bump-build` to move the
52+
version forward. ::
53+
54+
make bump-minor
55+
56+
5. Build the experimental/non-production package. ::
57+
58+
make build
59+
60+
6. Publish the experimental/non-production package to `PyPI`_. ::
61+
62+
make publish
63+
64+
7. If you need to make updates to the experimental build it is suggested to
65+
bump the build version, build and re-publish. ::
66+
67+
make bump-build
68+
make build
69+
make publish
70+
71+
8. Once you're satisfied that the changes are ready to be released to production
72+
use the `make release` target. ::
73+
74+
make release
75+
76+
9. Once the task has successfully completed you need to push the tag and
77+
commit. ::
78+
79+
git push origin && git push origin refs/tags/<tagname>
80+
81+
10. Create a release on GitHub. (`GitHub release`_)
2682

2783
.. _semver: https://semver.org
2884
.. _shared_accounts: https://rpc-openstack.atlassian.net/wiki/spaces/ASC/pages/143949893/Useful+Links#UsefulLinks-SharedAccounts
29-
.. _GitHub_release: https://help.github.com/articles/creating-releases/
85+
.. _GitHub release: https://help.github.com/articles/creating-releases/
86+
.. _`PyPI`: https://pypi.python.org/pypi

requirements.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
-c constraints.txt
2-
tox
2+
bumpversion
33
flake8
4-
python-dateutil
4+
ipython
55
pytest
66
pytest-cov
77
pytest-mock
8-
lxml
8+
python-dateutil
99
setuptools
10-
ipython
11-
bumpversion
12-
twine
1310
sh
1411
testinfra
12+
tox
13+
twine

setup.cfg

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
[bumpversion]
22
current_version = 0.13.0
33
commit = True
4-
tag = True
4+
tag = False
5+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
6+
serialize =
7+
{major}.{minor}.{patch}-{release}{build}
8+
{major}.{minor}.{patch}
9+
10+
[bumpversion:part:release]
11+
optional_value = prod
12+
first_value = dev
13+
values =
14+
dev
15+
prod
16+
17+
[bumpversion:part:build]
518

619
[bumpversion:file:setup.py]
720
search = version='{current_version}'

0 commit comments

Comments
 (0)