Skip to content

Commit

Permalink
merge template and fill template variables
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Dec 4, 2023
2 parents bbcf31c + d1395aa commit b27515f
Show file tree
Hide file tree
Showing 19 changed files with 282 additions and 151 deletions.
20 changes: 4 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ common: &common
command: |
python -m pip install --upgrade pip
python -m pip install tox
- run:
name: install pre-commit
command: python -m pip install --progress-bar=off pre-commit
- run:
name: run tox
command: python -m tox run -r
Expand All @@ -34,7 +37,6 @@ common: &common
- .tox
- ~/.cache/pip
- ~/.local
- ./eggs
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

orbs:
Expand Down Expand Up @@ -71,12 +73,6 @@ jobs:
environment:
TOXENV: docs

py37-core:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-core
py38-core:
<<: *common
docker:
Expand Down Expand Up @@ -127,12 +123,6 @@ jobs:
environment:
TOXENV: py311-lint

py37-wheel:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-wheel
py38-wheel:
<<: *common
docker:
Expand Down Expand Up @@ -162,13 +152,12 @@ jobs:
<<: *windows_steps
environment:
TOXENV: py311-wheel-windows

workflows:
version: 2
test:
jobs:
- docs
- py37-core
- py38-core
- py39-core
- py310-core
Expand All @@ -177,7 +166,6 @@ workflows:
- py39-lint
- py310-lint
- py311-lint
- py37-wheel
- py38-wheel
- py39-wheel
- py310-wheel
Expand Down
72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Bug Report
description: File a bug report
labels: ["bug"]
body:
- type: markdown
attributes:
value: "## What was wrong"
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us what you expected to happen
validations:
required: true
- type: textarea
id: code-that-caused
attributes:
label: Code that produced the error
description: Formats to Python, no backticks needed
render: python
validations:
required: false
- type: textarea
id: error-output
attributes:
label: Full error output
description: Formats to shell, no backticks needed
render: shell
validations:
required: false
- type: markdown
attributes:
value: "## Potential Solutions"
- type: textarea
id: how-to-fix
attributes:
label: Fill this section in if you know how this could or should be fixed
description: Include any relevant examples or reference material
validations:
required: false
- type: input
id: lib-version
attributes:
label: eth-utils Version
description: Which version of eth-utils are you using?
placeholder: x.x.x
validations:
required: false
- type: input
id: py-version
attributes:
label: Python Version
description: Which version of Python are you using?
placeholder: x.x.x
validations:
required: false
- type: input
id: os
attributes:
label: Operating System
description: Which operating system are you using?
placeholder: osx/linux/win
validations:
required: false
- type: textarea
id: pip-freeze
attributes:
label: Output from `pip freeze`
description: Run `python -m pip freeze` and paste the output below
render: shell
validations:
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Questions about using eth-utils?
url: https://discord.gg/GHryRvPB84
about: You can ask and answer usage questions on the Ethereum Python Community Discord
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Feature Request
description: Request a new feature
labels: ["feature_request"]
body:
- type: textarea
id: feature-description
attributes:
label: What feature should we add?
description: Include any relevant examples or reference material
validations:
required: true
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Closes #
### How was it fixed?

### Todo:

- [ ] Clean up commit history

- [ ] Add or update documentation related to these changes

- [ ] Add entry to the [release notes](https://github.com/ethereum/eth-utils/blob/master/newsfragments/README.md)
- [ ] Add entry to the [release notes](https://github.com/ethereum/eth-utils/blob/main/newsfragments/README.md)

#### Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()
![Put a link to a cute animal picture inside the parenthesis-->](<>)
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.egg-info
dist
build
.build
eggs
.eggs
parts
Expand Down Expand Up @@ -60,6 +61,9 @@ chains
.cache
.pytest_cache

# pycache
__pycache__/

# Test output logs
logs

Expand All @@ -75,6 +79,9 @@ logs
# pyenv
.python-version

# vs-code
.vscode

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# For a more precise, explicit template, see:
# https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
exclude: '.project-template|docs/conf.py|.bumpversion.cfg'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.9.16
exclude: setup.py
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies:
- tomli # required until >= python311
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
exclude: tests/
30 changes: 0 additions & 30 deletions .pydocstyle.ini

This file was deleted.

7 changes: 5 additions & 2 deletions .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

build:
os: "ubuntu-22.04"
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.8"

sphinx:
configuration: docs/conf.py
Expand All @@ -15,3 +15,6 @@ python:
path: .
extra_requirements:
- docs

# Build all formats for RTD Downloads - htmlzip, pdf, epub
formats: all
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ include LICENSE
include README.md
include eth_utils/__json/eth_networks.json

recursive-include tests *

global-include *.pyi

recursive-exclude * __pycache__
Expand Down
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign)
help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with mypy, flake8, isort, pydocstyle, and black"
@echo "lint-roll - automatically fix problems with flake8 and black"
@echo "lint - fix linting issues with pre-commit"
@echo "test - run tests quickly with the default Python"
@echo "docs - generate docs and open in browser (linux-docs for version on linux)"
@echo "notes - consume towncrier newsfragments/ and update release notes in docs/"
Expand All @@ -26,12 +25,10 @@ clean-pyc:
find . -name '__pycache__' -exec rm -rf {} +

lint:
tox run -e lint

lint-roll:
isort eth_utils tests
black eth_utils tests setup.py
$(MAKE) lint
@pre-commit run --all-files --show-diff-on-failure || ( \
echo "\n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \
&& pre-commit run --all-files --show-diff-on-failure \
)

test:
pytest tests
Expand Down Expand Up @@ -70,9 +67,7 @@ notes: check-bump

release: check-bump clean
# require that upstream is configured for ethereum/eth-utils
@git remote -v | grep \
-e "upstream\tgit@github.com:ethereum/eth-utils.git (push)" \
-Ee "upstream\thttps://(www.)?github.com/ethereum/eth-utils \(push\)"
@git remote -v | grep -E "upstream\tgit@github.com:ethereum/eth-utils.git \(push\)|upstream\thttps://(www.)?github.com/ethereum/eth-utils \(push\)"
# verify that docs build correctly
./newsfragments/validate_files.py is-empty
make build-docs
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ for information on how we do:

- Testing
- Pull Requests
- Code Style
- Documentation

We use [pre-commit](https://pre-commit.com/) to maintain consistent code style. Once
installed, it will run automatically with every commit. You can also run it manually
with `make lint`. If you need to make a commit that skips the `pre-commit` checks, you
can do so with `git commit --no-verify`.

### Development Environment Setup

You can set up your dev environment with:
Expand All @@ -37,6 +41,7 @@ cd eth-utils
virtualenv -p python3 venv
. venv/bin/activate
python -m pip install -e ".[dev]"
pre-commit install
```

### Update Networks
Expand All @@ -53,6 +58,7 @@ python update_networks.py

If there are new networks they will appear in the JSON file. After checking the updates,
open a PR to make them available in a new release.
```
### Release setup
Expand All @@ -69,7 +75,7 @@ The version format for this repo is `{major}.{minor}.{patch}` for stable, and

To issue the next version in line, specify which part to bump,
like `make release bump=minor` or `make release bump=devnum`. This is typically done from the
master branch, except when releasing a beta (in which case the beta is released from master,
main branch, except when releasing a beta (in which case the beta is released from main,
and the previous stable branch is released from said branch).

If you are in a beta version, `make release bump=stage` will switch to a stable.
Expand Down
Loading

0 comments on commit b27515f

Please sign in to comment.