ethereum / hexbytes

Python `bytes` subclass that decodes hex, with a readable console output
MIT License
27 stars 19 forks source link

update release process, replace bumpversion with bump-my-version, update docs #44

Closed pacrob closed 4 months ago

pacrob commented 5 months ago

What was wrong?

Build and test the wheel before pushing a release - https://github.com/ethereum/ethereum-python-project-template/issues/18

Build out default docs - https://github.com/ethereum/ethereum-python-project-template/issues/78

bumpversion is no longer maintained - https://github.com/ethereum/ethereum-python-project-template/issues/109

How was it fixed?

Wheel Testing

I took the idea of make package from py-evm, renaming it to make package-test for clarity. It builds the package, then opens a venv and installs that package, then runs scripts/tests_to_run_on_package.py within the venv. Currently it just verifies that it can be imported and that the __version__ is available for the package, but this can be built out on a per-lib basis.

Some cleaning/organizing of the Makefile while I was in there.

Default Docs

Again, copied basic concepts from py-evm. I didn't update the usage documentation much here (hexbytes isn't very complex), but the landing page is much more friendly and the Contribution and Code of Conduct are new and can be mostly generalized for the template.

As part of this, cleaned up the main README - most of it went into the Contributing docs.

replacing bumpversion

bump-my-version is the currently maintained fork for bumpversion. It does the same thing as the original + config can be in pyproject.toml.

Bonus: bump-my-version show-bump shows what the version will be with any bump option

╰─➤  bump-my-version show-bump  
0.1.0-alpha.0 ── bump ─┬─ major ── 1.0.0
                       ├─ minor ── 0.2.0
                       ├─ patch ── 0.1.1
                       ├─ stage ── 0.1.0-beta.0
                       ╰─ devnum ─ 0.1.0-alpha.1
╰─➤  bump-my-version bump devnum
╰─➤  bump-my-version show-bump  
0.1.0-alpha.1 ── bump ─┬─ major ── 1.0.0
                       ├─ minor ── 0.2.0
                       ├─ patch ── 0.1.1
                       ├─ stage ── 0.1.0-beta.0
                       ╰─ devnum ─ 0.1.0-alpha.2
╰─➤  bump-my-version bump devnum
╰─➤  bump-my-version show-bump  
0.1.0-alpha.2 ── bump ─┬─ major ── 1.0.0
                       ├─ minor ── 0.2.0
                       ├─ patch ── 0.1.1
                       ├─ stage ── 0.1.0-beta.0
                       ╰─ devnum ─ 0.1.0-alpha.3
╰─➤  bump-my-version bump stage 
╰─➤  bump-my-version show-bump 
0.1.0-beta.0 ── bump ─┬─ major ── 1.0.0
                      ├─ minor ── 0.2.0
                      ├─ patch ── 0.1.1
                      ├─ stage ── 0.1.0
                      ╰─ devnum ─ 0.1.0-beta.1
╰─➤  bump-my-version bump devnum
╰─➤  bump-my-version show-bump  
0.1.0-beta.1 ── bump ─┬─ major ── 1.0.0
                      ├─ minor ── 0.2.0
                      ├─ patch ── 0.1.1
                      ├─ stage ── 0.1.0
                      ╰─ devnum ─ 0.1.0-beta.2
╰─➤  bump-my-version bump stage 
╰─➤  bump-my-version show-bump 
0.1.0 ── bump ─┬─ major ── 1.0.0
               ├─ minor ── 0.2.0
               ├─ patch ── 0.1.1
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 0.1.0-stable.1
╰─➤  bump-my-version bump patch
╰─➤  bump-my-version show-bump 
0.1.1 ── bump ─┬─ major ── 1.0.0
               ├─ minor ── 0.2.0
               ├─ patch ── 0.1.2
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 0.1.1-stable.1
╰─➤  bump-my-version bump minor
╰─➤  bump-my-version show-bump 
0.2.0 ── bump ─┬─ major ── 1.0.0
               ├─ minor ── 0.3.0
               ├─ patch ── 0.2.1
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 0.2.0-stable.1
╰─➤  bump-my-version bump major
╰─➤  bump-my-version show-bump 
1.0.0 ── bump ─┬─ major ── 2.0.0
               ├─ minor ── 1.1.0
               ├─ patch ── 1.0.1
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 1.0.0-stable.1
╰─➤  bump-my-version bump minor 
╰─➤  bump-my-version show-bump 
1.1.0 ── bump ─┬─ major ── 2.0.0
               ├─ minor ── 1.2.0
               ├─ patch ── 1.1.1
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 1.1.0-stable.1
╰─➤  bump-my-version bump --new-version 2.0.0-beta.1
╰─➤  bump-my-version show-bump                      
2.0.0-beta.1 ── bump ─┬─ major ── 3.0.0
                      ├─ minor ── 2.1.0
                      ├─ patch ── 2.0.1
                      ├─ stage ── 2.0.0
                      ╰─ devnum ─ 2.0.0-beta.2
╰─➤  bump-my-version bump devnum                    
╰─➤  bump-my-version show-bump  
2.0.0-beta.2 ── bump ─┬─ major ── 3.0.0
                      ├─ minor ── 2.1.0
                      ├─ patch ── 2.0.1
                      ├─ stage ── 2.0.0
                      ╰─ devnum ─ 2.0.0-beta.3
╰─➤  bump-my-version bump stage 
╰─➤  bump-my-version show-bump 
2.0.0 ── bump ─┬─ major ── 3.0.0
               ├─ minor ── 2.1.0
               ├─ patch ── 2.0.1
               ├─ stage ── invalid: The part has already the maximum value among ['alpha', 'beta', 'stable'] and cannot be bumped.
               ╰─ devnum ─ 2.0.0-stable.1

Plus some pre-commit : added "no .rst files in the top level dir" check and blocklint

Todo:

Cute Animal Picture

image