Skip to content

Commit 7c2647e

Browse files
authored
Drop coverage, add release instructions (#28)
* removing coverage, drop deps and makefile targets * more coverage removal, add new release instructions to contributing * newsfragments
1 parent 480c2bc commit 7c2647e

File tree

9 files changed

+72
-169
lines changed

9 files changed

+72
-169
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ var/
3535
pip-log.txt
3636
pip-delete-this-directory.txt
3737

38-
# Unit test / coverage reports
38+
# Unit test reports
3939
htmlcov/
4040
.tox/
41-
.coverage
42-
.coverage.*
4341
.cache
4442
nosetests.xml
45-
coverage.xml
46-
*,cover
4743
.hypothesis/
4844

4945
# Translations

CONTRIBUTING.rst

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ The project provides several ``make`` targets to help with development:
118118
run linting, type checking, and tests. This is the recommended command to run
119119
before submitting a pull request.
120120

121-
* ``make coverage`` - Run tests with coverage reporting and open the HTML report
122-
in your browser.
123-
124121
For a full list of available commands, run ``make help``.
125122

126123
7. Commit your changes and push your branch to GitHub::
@@ -151,16 +148,76 @@ To run a subset of tests::
151148

152149
$ pytest tests/test_multibase.py
153150

154-
155-
Deploying
151+
Releasing
156152
---------
157153

158-
A reminder for the maintainers on how to deploy.
159-
Make sure all your changes are committed (including an entry in HISTORY.rst).
160-
Then run::
154+
Releases are typically done from the ``master`` branch, except when releasing a beta (in
155+
which case the beta is released from ``master``, and the previous stable branch is
156+
released from said branch).
157+
158+
Final test before each release
159+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160+
161+
Before releasing a new version, build and test the package that will be released:
162+
163+
.. code:: sh
164+
165+
git checkout master && git pull
166+
make package-test
167+
168+
This will build the package and install it in a temporary virtual environment. Follow
169+
the instructions to activate the venv and test whatever you think is important.
170+
171+
You can also preview the release notes:
172+
173+
.. code:: sh
174+
175+
towncrier --draft
176+
177+
Build the release notes
178+
~~~~~~~~~~~~~~~~~~~~~~~
179+
180+
Before bumping the version number, build the release notes. You must include the part of
181+
the version to bump (see below), which changes how the version number will show in the
182+
release notes.
183+
184+
.. code:: sh
185+
186+
make notes bump=$$VERSION_PART_TO_BUMP$$
187+
188+
If there are any errors, be sure to re-run make notes until it works.
189+
190+
Push the release to github & pypi
191+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192+
193+
After confirming that the release package looks okay, release a new version:
194+
195+
.. code:: sh
196+
197+
make release bump=$$VERSION_PART_TO_BUMP$$
198+
199+
This command will:
200+
201+
- Bump the version number as specified wherever it appears in the repo.
202+
- Create a git commit and tag for the new version.
203+
- Build the package.
204+
- Push the commit and tag to github.
205+
- Push the new package files to pypi.
206+
207+
Which version part to bump
208+
~~~~~~~~~~~~~~~~~~~~~~~~~~
209+
210+
``$$VERSION_PART_TO_BUMP$$`` must be one of: ``major``, ``minor``, ``patch``, ``stage``,
211+
or ``devnum``.
212+
213+
The version format for this repo is ``{major}.{minor}.{patch}`` for stable, and
214+
``{major}.{minor}.{patch}-{stage}.{devnum}`` for unstable (``stage`` can be alpha or
215+
beta).
216+
217+
If you are in a beta version, ``make release bump=stage`` will switch to a stable.
161218

162-
$ bump-my-version bump patch # possible: major / minor / patch
163-
$ git push
164-
$ git push --tags
219+
To issue an unstable version when the current version is stable, specify the new version
220+
explicitly, like ``make release bump="--new-version 4.0.0-alpha.1"``
165221

166-
GitHub Actions will then deploy to PyPI if tests pass.
222+
You can see what the result of bumping any particular version part would be with
223+
``bump-my-version show-bump``

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ help:
2222
@echo "lint - run pre-commit hooks on all files"
2323
@echo "typecheck - run mypy type checking"
2424
@echo "test - run tests quickly with the default Python"
25-
@echo "coverage - run tests with coverage report"
2625
@echo "docs-ci - generate docs for CI"
2726
@echo "docs - generate docs and open in browser"
2827
@echo "servedocs - serve docs with live reload"
@@ -48,7 +47,6 @@ clean-test:
4847
rm -fr .tox/
4948
rm -fr .mypy_cache
5049
rm -fr .ruff_cache
51-
rm -f .coverage
5250
rm -fr htmlcov/
5351

5452
setup:
@@ -66,12 +64,6 @@ typecheck:
6664
test:
6765
python -m pytest tests
6866

69-
coverage:
70-
coverage run --source multibase -m pytest tests
71-
coverage report -m
72-
coverage html
73-
$(BROWSER) htmlcov/index.html
74-
7567
docs-ci:
7668
rm -f docs/multibase.rst
7769
rm -f docs/modules.rst

README.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ py-multibase
99
.. image:: https://github.com/multiformats/py-multibase/actions/workflows/tox.yml/badge.svg
1010
:target: https://github.com/multiformats/py-multibase/actions
1111

12-
.. image:: https://codecov.io/gh/multiformats/py-multibase/branch/master/graph/badge.svg
13-
:target: https://codecov.io/gh/multiformats/py-multibase
14-
1512
.. image:: https://readthedocs.org/projects/py-multibase/badge/?version=stable
1613
:target: https://py-multibase.readthedocs.io/en/stable/?badge=stable
1714
:alt: Documentation Status

codecov.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

newsfragments/23.docs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added release documentation to contributing docs.

newsfragments/23.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dropped ``coverage`` and ``codecov`` references, no longer using it.

pyproject.toml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ dev = [
3838
"Sphinx>=5.0.0",
3939
"build>=0.9.0",
4040
"bump-my-version>=1.2.0",
41-
"codecov",
42-
"coverage>=6.5.0",
4341
"mypy",
4442
"pre-commit",
4543
"pytest",
46-
"pytest-cov",
4744
"pytest-runner",
4845
"ruff",
4946
"towncrier>=24,<25",
@@ -65,21 +62,6 @@ include = ["multibase*"]
6562
testpaths = ["tests"]
6663
python_classes = "*TestCase"
6764

68-
[tool.coverage.run]
69-
source = ["multibase"]
70-
71-
[tool.coverage.report]
72-
exclude_lines = [
73-
"pragma: no cover",
74-
"def __repr__",
75-
"if self.debug:",
76-
"if settings.DEBUG",
77-
"raise AssertionError",
78-
"raise NotImplementedError",
79-
"if 0:",
80-
"if __name__ == .__main__.:",
81-
]
82-
8365
[tool.towncrier]
8466
# Read https://github.com/multiformats/py-multibase/blob/master/newsfragments/README.md for instructions
8567
directory = "newsfragments"

travis_pypi_setup.py

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)