Skip to content

Commit d8d0f05

Browse files
committed
update default docs and release process, drop bumpversion for
bump-my-version
1 parent ea09f5f commit d8d0f05

13 files changed

+412
-123
lines changed

.bumpversion.cfg

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

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exclude: '.project-template|docs/conf.py|.bumpversion.cfg'
1+
exclude: '.project-template|docs/conf.py'
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
44
rev: v4.5.0

Makefile

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign)
55
help:
66
@echo "clean-build - remove build artifacts"
77
@echo "clean-pyc - remove Python file artifacts"
8+
@echo "clean - run clean-build and clean-pyc"
9+
@echo "dist - build package and cat contents of the dist directory"
810
@echo "lint - fix linting issues with pre-commit"
911
@echo "test - run tests quickly with the default Python"
1012
@echo "docs - generate docs and open in browser (linux-docs for version on linux)"
1113
@echo "autobuild-docs - live update docs when changes are saved"
12-
@echo "notes - consume towncrier newsfragments/ and update release notes in docs/"
13-
@echo "release - package and upload a release (does not run notes target)"
14-
@echo "dist - package"
15-
16-
clean: clean-build clean-pyc
14+
@echo "package-test - build package and install it in a venv for manual testing"
15+
@echo "notes - consume towncrier newsfragments and update release notes in docs - requires bump to be set"
16+
@echo "release - package and upload a release (does not run notes target) - requires bump to be set"
1717

1818
clean-build:
1919
rm -fr build/
@@ -26,6 +26,12 @@ clean-pyc:
2626
find . -name '*~' -exec rm -f {} +
2727
find . -name '__pycache__' -exec rm -rf {} +
2828

29+
clean: clean-build clean-pyc
30+
31+
dist: clean
32+
python -m build
33+
ls -l dist
34+
2935
lint:
3036
@pre-commit run --all-files --show-diff-on-failure || ( \
3137
echo "\n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \
@@ -35,62 +41,78 @@ lint:
3541
test:
3642
python -m pytest tests
3743

44+
# docs commands
45+
46+
docs: check-docs
47+
open docs/_build/html/index.html
48+
49+
linux-docs: check-docs
50+
xdg-open docs/_build/html/index.html
51+
3852
autobuild-docs:
3953
sphinx-autobuild --open-browser docs docs/_build/html
4054

41-
build-docs:
42-
sphinx-apidoc -o docs/ . setup.py "*conftest*"
43-
$(MAKE) -C docs clean
44-
$(MAKE) -C docs html
45-
$(MAKE) -C docs doctest
46-
47-
build-docs-ci:
48-
$(MAKE) -C docs latexpdf
49-
$(MAKE) -C docs epub
55+
# docs helpers
5056

5157
validate-newsfragments:
5258
python ./newsfragments/validate_files.py
5359
towncrier build --draft --version preview
5460

5561
check-docs: build-docs validate-newsfragments
5662

63+
build-docs:
64+
sphinx-apidoc -o docs/ . setup.py "*conftest*"
65+
$(MAKE) -C docs clean
66+
$(MAKE) -C docs html
67+
$(MAKE) -C docs doctest
68+
5769
check-docs-ci: build-docs build-docs-ci validate-newsfragments
5870

59-
docs: check-docs
60-
open docs/_build/html/index.html
71+
build-docs-ci:
72+
$(MAKE) -C docs latexpdf
73+
$(MAKE) -C docs epub
6174

62-
linux-docs: check-docs
63-
xdg-open docs/_build/html/index.html
75+
# release commands
6476

65-
check-bump:
66-
ifndef bump
67-
$(error bump must be set, typically: major, minor, patch, or devnum)
68-
endif
77+
package-test: clean
78+
python -m build
79+
python scripts/release/test_package.py
6980

70-
notes: check-bump validate-newsfragments
81+
notes: check-bump
7182
# Let UPCOMING_VERSION be the version that is used for the current bump
72-
$(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g'))
83+
$(eval UPCOMING_VERSION=$(shell bump-my-version show --increment $(bump) new_version))
7384
# Now generate the release notes to have them included in the release commit
7485
towncrier build --yes --version $(UPCOMING_VERSION)
7586
# Before we bump the version, make sure that the towncrier-generated docs will build
7687
make build-docs
7788
git commit -m "Compile release notes for v$(UPCOMING_VERSION)"
7889

79-
release: check-bump clean
80-
# require that upstream is configured for ethereum/<REPO_NAME>
81-
@git remote -v | grep "upstream[[:space:]][email protected]:ethereum/<REPO_NAME>.git (push)\|upstream[[:space:]]https://github.com/ethereum/<REPO_NAME> (push)"
82-
# verify that docs build correctly
90+
release: check-bump check-git clean
91+
# verify that notes command ran correctly
8392
./newsfragments/validate_files.py is-empty
84-
make build-docs
8593
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
8694
git config commit.gpgSign true
87-
bumpversion $(bump)
88-
git push upstream && git push upstream --tags
95+
bump-my-version bump $(bump)
8996
python -m build
90-
twine upload dist/*
9197
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"
98+
git push upstream && git push upstream --tags
99+
twine upload dist/*
92100

101+
# release helpers
93102

94-
dist: clean
95-
python -m build
96-
ls -l dist
103+
check-bump:
104+
ifndef bump
105+
$(error bump must be set, typically: major, minor, patch, or devnum)
106+
endif
107+
108+
check-git:
109+
# require that you be on a branch that's linked to upstream/main
110+
@if ! git status -s -b | head -1 | grep -q "\.\.upstream/main"; then \
111+
echo "Error: You must be on a branch that's linked to upstream/main"; \
112+
exit 1; \
113+
fi
114+
# require that upstream is configured for ethereum/<REPO_NAME>
115+
@if ! git remote -v | grep "upstream[[:space:]][email protected]:ethereum/<REPO_NAME>.git (push)\|upstream[[:space:]]https://github.com/ethereum/<REPO_NAME> (push)"; then \
116+
echo "Error: You must have a remote named 'upstream' that points to '<REPO_NAME>'"; \
117+
exit 1; \
118+
fi

README.md

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,12 @@
88

99
<SHORT_DESCRIPTION>
1010

11-
Read more in the [documentation on ReadTheDocs](https://<RTD_NAME>.readthedocs.io/). [View the change log](https://<RTD_NAME>.readthedocs.io/en/latest/release_notes.html).
11+
Read the [documentation](https://<RTD_NAME>.readthedocs.io/).
1212

13-
## Quickstart
13+
View the [change log](https://<RTD_NAME>.readthedocs.io/en/latest/release_notes.html).
1414

15-
```sh
16-
python -m pip install <PYPI_NAME>
17-
```
18-
19-
## Developer Setup
20-
21-
If you would like to hack on <REPO_NAME>, please check out the [Snake Charmers
22-
Tactical Manual](https://github.com/ethereum/snake-charmers-tactical-manual)
23-
for information on how we do:
24-
25-
- Testing
26-
- Pull Requests
27-
- Documentation
28-
29-
We use [pre-commit](https://pre-commit.com/) to maintain consistent code style. Once
30-
installed, it will run automatically with every commit. You can also run it manually
31-
with `make lint`. If you need to make a commit that skips the `pre-commit` checks, you
32-
can do so with `git commit --no-verify`.
33-
34-
### Development Environment Setup
35-
36-
You can set up your dev environment with:
37-
38-
```sh
39-
git clone [email protected]:ethereum/<REPO_NAME>.git
40-
cd <REPO_NAME>
41-
virtualenv -p python3 venv
42-
. venv/bin/activate
43-
python -m pip install -e ".[dev]"
44-
pre-commit install
45-
```
46-
47-
### Release setup
48-
49-
To release a new version:
15+
## Installation
5016

5117
```sh
52-
make release bump=$$VERSION_PART_TO_BUMP$$
18+
python -m pip install <PYPI_NAME>
5319
```
54-
55-
#### How to bumpversion
56-
57-
The version format for this repo is `{major}.{minor}.{patch}` for stable, and
58-
`{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta).
59-
60-
To issue the next version in line, specify which part to bump,
61-
like `make release bump=minor` or `make release bump=devnum`. This is typically done from the
62-
main branch, except when releasing a beta (in which case the beta is released from main,
63-
and the previous stable branch is released from said branch).
64-
65-
If you are in a beta version, `make release bump=stage` will switch to a stable.
66-
67-
To issue an unstable version when the current version is stable, specify the
68-
new version explicitly, like `make release bump="--new-version 4.0.0-alpha.1 devnum"`

docs/MODULE_NAME.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Usage
2+
-----
3+
4+
Example usage:
5+
6+
<MODULE_NAME>
7+
-------------
8+
9+
.. automodule:: <MODULE_NAME>
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

docs/code_of_conduct.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Code of Conduct
2+
---------------
3+
4+
Our Pledge
5+
~~~~~~~~~~
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our project and
9+
our community a harassment-free experience for everyone, regardless of age, body
10+
size, disability, ethnicity, gender identity and expression, level of experience,
11+
education, socio-economic status, nationality, personal appearance, race,
12+
religion, or sexual identity and orientation.
13+
14+
Our Standards
15+
~~~~~~~~~~~~~
16+
17+
Examples of behavior that contributes to creating a positive environment
18+
include:
19+
20+
* Using welcoming and inclusive language
21+
* Being respectful of differing viewpoints and experiences
22+
* Gracefully accepting constructive criticism
23+
* Focusing on what is best for the community
24+
* Showing empathy towards other community members
25+
26+
Examples of unacceptable behavior by participants include:
27+
28+
* The use of sexualized language or imagery and unwelcome sexual attention or
29+
advances
30+
* Trolling, insulting/derogatory comments, and personal or political attacks
31+
* Public or private harassment
32+
* Publishing others' private information, such as a physical or electronic
33+
address, without explicit permission
34+
* Other conduct which could reasonably be considered inappropriate in a
35+
professional setting
36+
37+
Our Responsibilities
38+
~~~~~~~~~~~~~~~~~~~~
39+
40+
Project maintainers are responsible for clarifying the standards of acceptable
41+
behavior and are expected to take appropriate and fair corrective action in
42+
response to any instances of unacceptable behavior.
43+
44+
Project maintainers have the right and responsibility to remove, edit, or
45+
reject comments, commits, code, wiki edits, issues, and other contributions
46+
that are not aligned to this Code of Conduct, or to ban temporarily or
47+
permanently any contributor for other behaviors that they deem inappropriate,
48+
threatening, offensive, or harmful.
49+
50+
Scope
51+
~~~~~
52+
53+
This Code of Conduct applies both within project spaces and in public spaces
54+
when an individual is representing the project or its community. Examples of
55+
representing a project or community include using an official project e-mail
56+
address, posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event. Representation of a project may be
58+
further defined and clarified by project maintainers.
59+
60+
Enforcement
61+
~~~~~~~~~~~
62+
63+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
64+
reported by contacting the project team at [email protected]. All
65+
complaints will be reviewed and investigated and will result in a response that
66+
is deemed necessary and appropriate to the circumstances. The project team is
67+
obligated to maintain confidentiality with regard to the reporter of an incident.
68+
Further details of specific enforcement policies may be posted separately.
69+
70+
Project maintainers who do not follow or enforce the Code of Conduct in good
71+
faith may face temporary or permanent repercussions as determined by other
72+
members of the project's leadership.
73+
74+
Attribution
75+
~~~~~~~~~~~
76+
77+
This Code of Conduct is adapted from the `Contributor Covenant <https://www.contributor-covenant.org>`_, version 1.4,
78+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

0 commit comments

Comments
 (0)