@@ -55,6 +55,7 @@ Finally, install all development dependencies:
5555.. code :: sh
5656
5757 $ pip install -e " .[dev]"
58+ $ pre-commit install
5859
5960
6061 Using Docker
@@ -424,93 +425,82 @@ published and the test runs are updated to use the new stable version.
424425Releasing
425426~~~~~~~~~
426427
427- Final Test Before Each Release
428- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
428+ Releases are typically done from the ``main `` branch, except when releasing a beta (in
429+ which case the beta is released from ``main ``, and the previous stable branch is
430+ released from said branch).
429431
430- Before releasing a new version, build and test the package that will be released.
431- There's a script to build and install the wheel locally, then generate a temporary
432- virtualenv for smoke testing:
432+ Final test before each release
433+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
433434
434- .. code :: sh
435-
436- $ git checkout main && git pull
437-
438- $ make package
435+ Before releasing a new version, build and test the package that will be released:
439436
440- # in another shell, navigate to the virtualenv mentioned in output of ^
441-
442- # load the virtualenv with the packaged web3.py release
443- $ source package-smoke-test/bin/activate
444-
445- # smoke test the release
446- $ pip install ipython
447- $ ipython
448- >>> from web3 import Web3, IPCProvider
449- >>> w3 = Web3(IPCProvider(provider_url))
450- >>> w3.is_connected ()
451- >>> ...
437+ .. code :: sh
452438
439+ git checkout main && git pull
440+ make package-test
453441
454- Verify The Latest Documentation
455- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
442+ This will build the package and install it in a temporary virtual environment. Follow
443+ the instructions to activate the venv and test whatever you think is important.
456444
457- To preview the documentation that will get published:
445+ Review the documentation that will get published:
458446
459447.. code :: sh
460448
461- $ make docs
449+ make docs
462450
463-
464- Preview The Release Notes
465- ^^^^^^^^^^^^^^^^^^^^^^^^^
451+ Validate and preview the release notes:
466452
467453.. code :: sh
468454
469- $ towncrier build --draft
470-
455+ make validate-newsfragments
471456
472- Compile The Release Notes
473- ^^^^^^^^^^^^^^^^^^^^^^^^^
457+ Build the release notes
458+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
474459
475- After confirming that the release package looks okay, compile the release notes:
460+ Before bumping the version number, build the release notes. You must include the part of
461+ the version to bump (see below), which changes how the version number will show in the
462+ release notes.
476463
477464.. code :: sh
478465
479- $ make notes bump=$$ VERSION_PART_TO_BUMP$$
480-
466+ make notes bump=$$ VERSION_PART_TO_BUMP$$
481467
482- You may need to fix up any broken release note fragments before committing. Keep
483- running ``make build-docs `` until it passes, then commit and carry on.
468+ If there are any errors, be sure to re-run make notes until it works.
484469
470+ Push the release to github & pypi
471+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
485472
486- Push The Release to GitHub & PyPI
487- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
488-
489- After committing the compiled release notes and pushing them to the main
490- branch, release a new version:
473+ After confirming that the release package looks okay, release a new version:
491474
492475.. code :: sh
493476
494- $ make release bump=$$ VERSION_PART_TO_BUMP$$
477+ make release bump=$$ VERSION_PART_TO_BUMP$$
478+
479+ This command will:
495480
481+ - Bump the version number as specified in ``.pyproject.toml `` and ``setup.py ``.
482+ - Create a git commit and tag for the new version.
483+ - Build the package.
484+ - Push the commit and tag to github.
485+ - Push the new package files to pypi.
496486
497- Which Version Part to Bump
498- ^^^^^^^^^^^^^^^^^^^^^^^^^^
487+ Which version part to bump
488+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
499489
500- The version format for this repo is ``{major}.{minor}.{patch} `` for
501- stable, and ``{major}.{minor}.{patch}-{stage}.{devnum} `` for unstable
502- (``stage `` can be alpha or beta).
490+ ``$$VERSION_PART_TO_BUMP$$ `` must be one of: ``major ``, ``minor ``, ``patch ``, ``stage ``,
491+ or ``devnum ``.
503492
504- During a release, specify which part to bump, like
505- ``make release bump=minor `` or ``make release bump=devnum ``.
493+ The version format for this repo is ``{major}.{minor}.{patch} `` for stable, and
494+ ``{major}.{minor}.{patch}-{stage}.{devnum} `` for unstable (``stage `` can be alpha or
495+ beta).
506496
507- If you are in an alpha version, ``make release bump=stage `` will bump to beta.
508- If you are in a beta version, ``make release bump=stage `` will bump to a stable
509- version.
497+ If you are in a beta version, ``make release bump=stage `` will switch to a stable.
510498
511- To issue an unstable version when the current version is stable, specify the new
512- version explicitly, like ``make release bump="--new-version 4.0.0-alpha.1 devnum " ``.
499+ To issue an unstable version when the current version is stable, specify the new version
500+ explicitly, like ``make release bump="--new-version 4.0.0-alpha.1" ``
513501
502+ You can see what the result of bumping any particular version part would be with
503+ ``bump-my-version show-bump ``
514504
515505.. _Python Discord server : https://discord.gg/GHryRvPB84
516506.. _style guide : https://github.com/ethereum/snake-charmers-tactical-manual/blob/main/style-guide.md
0 commit comments