Skip to content

Commit

Permalink
merge template, refill vars, run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Feb 10, 2025
2 parents 4259c5e + 788305f commit b06ef17
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 66 deletions.
22 changes: 0 additions & 22 deletions .bumpversion.cfg

This file was deleted.

51 changes: 45 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,11 @@ docs: &docs
command: |
python -m pip install --upgrade pip
python -m pip install tox
- run:
name: install latexpdf dependencies
command: |
sudo apt-get update
sudo apt-get install latexmk tex-gyre texlive-fonts-extra
- run:
name: run tox
command: python -m tox run -r
- store_artifacts:
path: /home/circleci/repo/docs/_build
- save_cache:
paths:
- .tox
Expand All @@ -117,7 +114,7 @@ jobs:
docs:
<<: *docs
docker:
- image: cimg/python:3.9
- image: cimg/python:3.10
environment:
TOXENV: docs

Expand Down Expand Up @@ -151,6 +148,12 @@ jobs:
- image: cimg/python:3.12
environment:
TOXENV: py312-core
py313-core:
<<: *common
docker:
- image: cimg/python:3.13
environment:
TOXENV: py313-core

py38-lint:
<<: *common
Expand Down Expand Up @@ -182,6 +185,12 @@ jobs:
- image: cimg/python:3.12
environment:
TOXENV: py312-lint
py313-lint:
<<: *common
docker:
- image: cimg/python:3.13
environment:
TOXENV: py313-lint

py38-wheel:
<<: *common
Expand Down Expand Up @@ -213,6 +222,12 @@ jobs:
- image: cimg/python:3.12
environment:
TOXENV: py312-wheel
py313-wheel:
<<: *common
docker:
- image: cimg/python:3.13
environment:
TOXENV: py313-wheel

py311-windows-wheel:
<<: *windows-wheel-setup
Expand Down Expand Up @@ -240,6 +255,19 @@ jobs:
- <<: *run-tox-step
- <<: *save-cache-step

py313-windows-wheel:
<<: *windows-wheel-setup
steps:
- checkout
- <<: *restore-cache-step
- <<: *install-pyenv-step
- run:
name: set minor version
command: echo "export MINOR_VERSION='3.13'" >> $BASH_ENV
- <<: *install-latest-python-step
- <<: *run-tox-step
- <<: *save-cache-step

py38-pyevm:
<<: *common
docker:
Expand Down Expand Up @@ -270,6 +298,12 @@ jobs:
- image: cimg/python:3.12
environment:
TOXENV: py312-pyevm
py313-pyevm:
<<: *common
docker:
- image: cimg/python:3.13
environment:
TOXENV: py313-pyevm

define: &all_jobs
- docs
Expand All @@ -278,23 +312,28 @@ define: &all_jobs
- py310-core
- py311-core
- py312-core
- py313-core
- py38-lint
- py39-lint
- py310-lint
- py311-lint
- py312-lint
- py313-lint
- py38-wheel
- py39-wheel
- py310-wheel
- py311-wheel
- py312-wheel
- py313-wheel
- py311-windows-wheel
- py312-windows-wheel
- py313-windows-wheel
- py38-pyevm
- py39-pyevm
- py310-pyevm
- py311-pyevm
- py312-pyevm
- py313-pyevm

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ body:
attributes:
label: Operating System
description: Which operating system are you using?
placeholder: osx/linux/win
placeholder: macos/linux/win
validations:
required: false
- type: textarea
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ logs
# vs-code
.vscode

# jupyter notebook files
*.ipynb

# 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
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: '.project-template|docs/conf.py|.bumpversion.cfg'
exclude: '.project-template|docs/conf.py'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down Expand Up @@ -43,11 +43,6 @@ repos:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
exclude: 'tests/|eth_tester/'
- repo: https://github.com/PrincetonUniversity/blocklint
rev: v0.2.5
hooks:
Expand Down
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"

sphinx:
configuration: docs/conf.py
fail_on_warning: true

python:
install:
- method: pip
path: .
extra_requirements:
- docs

# Build all formats for RTD Downloads - htmlzip, pdf, epub
formats: all
56 changes: 36 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,32 @@ CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign)
help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean - run clean-build and clean-pyc"
@echo "dist - build package and cat contents of the dist directory"
@echo "lint - fix linting issues with pre-commit"
@echo "test - run tests quickly with the default Python"
@echo "docs - view draft of newsfragments to be added to CHANGELOG"
@echo "notes - consume towncrier newsfragments/ and update CHANGELOG"
@echo "release - package and upload a release (does not run notes target)"
@echo "dist - package"

clean: clean-build clean-pyc
@echo "package-test - build package and install it in a venv for manual testing"
@echo "notes - consume towncrier newsfragments/ and update CHANGELOG - requires bump to be set"
@echo "release - package and upload a release (does not run notes target) - requires bump to be set"

clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +

clean: clean-build clean-pyc

dist: clean
python -m build
ls -l dist

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..." \
Expand All @@ -33,39 +40,48 @@ lint:
test:
python -m pytest tests

# docs commands
#
docs:
python ./newsfragments/validate_files.py
towncrier build --draft --version preview

check-bump:
ifndef bump
$(error bump must be set, typically: major, minor, patch, or devnum)
endif
# release commands

package-test: clean
python -m build
python scripts/release/test_package.py

notes: check-bump
# Let UPCOMING_VERSION be the version that is used for the current bump
$(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g'))
$(eval UPCOMING_VERSION=$(shell bump-my-version bump --dry-run $(bump) -v | awk -F"'" '/New version will be / {print $$2}'))
# Now generate the release notes to have them included in the release commit
towncrier build --yes --version $(UPCOMING_VERSION)
# Before we bump the version, make sure that the towncrier-generated docs will build
make docs
git commit -m "Compile release notes for v$(UPCOMING_VERSION)"

release: check-bump clean
# require that upstream is configured for ethereum/eth-tester
@git remote -v | grep "upstream[[:space:]][email protected]:ethereum/eth-tester.git (push)\|upstream[[:space:]]https://github.com/ethereum/eth-tester (push)"
# verify that docs build correctly
release: check-bump check-git clean
# verify that notes command ran correctly
./newsfragments/validate_files.py is-empty
make docs
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
git config commit.gpgSign true
bumpversion $(bump)
bump-my-version bump $(bump)
python -m build
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"
git push upstream && git push upstream --tags
twine upload dist/*
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"

# release helpers

dist: clean
python -m build
ls -l dist
check-bump:
ifndef bump
$(error bump must be set, typically: major, minor, patch, or devnum)
endif

check-git:
# require that upstream is configured for ethereum/eth-tester
@if ! git remote -v | grep "upstream[[:space:]][email protected]:ethereum/eth-tester.git (push)\|upstream[[:space:]]https://github.com/ethereum/eth-tester (push)"; then \
echo "Error: You must have a remote named 'upstream' that points to 'eth-tester'"; \
exit 1; \
fi
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@

Tools for testing Ethereum applications

Read more in the documentation below. [View the change log](https://github.com/ethereum/eth-tester/blob/main/CHANGELOG.rst).
Read more in the documentation below.

## Quick Start
View the [change log](https://github.com/ethereum/eth-tester/blob/main/CHANGELOG.rst).

## Installation

```sh
python -m pip install eth-tester
```

## Quick Start

```python
>>> from eth_tester import EthereumTester
>>> t = EthereumTester()
Expand Down
1 change: 1 addition & 0 deletions newsfragments/313.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Merge template, adding py313 and replacing ``bumpversion`` with ``bump-my-version``.
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ combine_as_imports = true
extra_standard_library = "pytest"
force_grid_wrap = 1
force_sort_within_sections = true
force_to_top = "pytest"
honor_noqa = true
known_first_party = "eth_tester"
known_third_party = "hypothesis"
Expand Down Expand Up @@ -122,3 +123,46 @@ showcontent = true
directory = "removal"
name = "Removals"
showcontent = true

[tool.bumpversion]
current_version = "0.12.0-beta.2"
parse = """
(?P<major>\\d+)
\\.(?P<minor>\\d+)
\\.(?P<patch>\\d+)
(-
(?P<stage>[^.]*)
\\.(?P<devnum>\\d+)
)?
"""
serialize = [
"{major}.{minor}.{patch}-{stage}.{devnum}",
"{major}.{minor}.{patch}",
]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
tag = true
sign_tags = true
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"

[tool.bumpversion.parts.stage]
optional_value = "stable"
first_value = "stable"
values = [
"alpha",
"beta",
"stable",
]

[tool.bumpversion.part.devnum]

[[tool.bumpversion.files]]
filename = "setup.py"
search = "version=\"{current_version}\""
replace = "version=\"{new_version}\""
Loading

0 comments on commit b06ef17

Please sign in to comment.