From c72ec7f6d96779f61c87d591062df1cbeacd58fc Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:34:14 -0700 Subject: [PATCH 01/26] add validate-newsfragments to make notes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d1c5c7a2..4d04dfc9 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ ifndef bump $(error bump must be set, typically: major, minor, patch, or devnum) endif -notes: check-bump +notes: check-bump validate-newsfragments # 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')) # Now generate the release notes to have them included in the release commit From d74895903dcb6ce0dc5237a8c6aeb345955e4a9d Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Mon, 18 Mar 2024 16:34:27 -0600 Subject: [PATCH 02/26] blocklint for linting project code for non-inclusive language (#122) --- .pre-commit-config.yaml | 5 +++++ tox.ini | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82b01b7c..49dc049e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,3 +48,8 @@ repos: hooks: - id: mypy exclude: tests/ +- repo: https://github.com/PrincetonUniversity/blocklint + rev: v0.2.4 + hooks: + - id: blocklint + exclude: 'docs/Makefile|docs/release_notes.rst|tox.ini' diff --git a/tox.ini b/tox.ini index ce1da94b..90d502d2 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,9 @@ extend-ignore=E203 max-line-length=88 per-file-ignores=__init__.py:F401 +[blocklint] +max_issue_threshold=1 + [testenv] usedevelop=True commands= From e29e67f4f041e78ef85305e26793b4111cba1314 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:22:54 -0600 Subject: [PATCH 03/26] update isort config and multi-platform grepping in Makefile --- Makefile | 2 +- pyproject.toml | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 4d04dfc9..8ed201bf 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ notes: check-bump validate-newsfragments release: check-bump clean # require that upstream is configured for ethereum/ - @git remote -v | grep -E "upstream\tgit@github.com:ethereum/.git \(push\)|upstream\thttps://(www.)?github.com/ethereum/ \(push\)" + @git remote -v | grep "upstream[[:space:]]git@github.com:ethereum/.git (push)\|upstream[[:space:]]https://github.com/ethereum/ (push)" # verify that docs build correctly ./newsfragments/validate_files.py is-empty make build-docs diff --git a/pyproject.toml b/pyproject.toml index f244df2c..e46b7434 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,28 +1,30 @@ [tool.autoflake] -remove_all_unused_imports = true exclude = "__init__.py" +remove_all_unused_imports = true [tool.isort] combine_as_imports = true extra_standard_library = "pytest" force_grid_wrap = 1 force_sort_within_sections = true -known_third_party = "hypothesis,pytest" +honor_noqa = true known_first_party = "" +known_third_party = "hypothesis" multi_line_output = 3 profile = "black" +use_parentheses = true [tool.mypy] check_untyped_defs = true -disallow_incomplete_defs = true -disallow_untyped_defs = true disallow_any_generics = true +disallow_incomplete_defs = true +disallow_subclassing_any = true disallow_untyped_calls = true disallow_untyped_decorators = true -disallow_subclassing_any = true +disallow_untyped_defs = true ignore_missing_imports = true -strict_optional = true strict_equality = true +strict_optional = true warn_redundant_casts = true warn_return_any = true warn_unused_configs = true @@ -63,18 +65,18 @@ add-ignore = "D200,D203,D204,D205,D212,D302,D400,D401,D412,D415" [tool.pytest.ini_options] addopts = "-v --showlocals --durations 10" -xfail_strict = true -log_format = "%(levelname)8s %(asctime)s %(filename)20s %(message)s" log_date_format = "%m-%d %H:%M:%S" +log_format = "%(levelname)8s %(asctime)s %(filename)20s %(message)s" +xfail_strict = true [tool.towncrier] # Read https://github.com/ethereum//blob/main/newsfragments/README.md for instructions -package = "" -filename = "docs/release_notes.rst" directory = "newsfragments" -underlines = ["-", "~", "^"] -title_format = " v{version} ({project_date})" +filename = "docs/release_notes.rst" issue_format = "`#{issue} /issues/{issue}>`__" +package = "" +title_format = " v{version} ({project_date})" +underlines = ["-", "~", "^"] [[tool.towncrier.type]] directory = "breaking" From 870286948614f7ac6aa70cacf9bb2e8e6d8fda69 Mon Sep 17 00:00:00 2001 From: kclowes Date: Fri, 22 Mar 2024 15:16:16 -0600 Subject: [PATCH 04/26] Add nightly CI run (#125) --- .circleci/config.yml | 52 +++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d9e28eb9..71e64413 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,7 +84,7 @@ windows-wheel-steps: paths: - .tox key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} - + docs: &docs docker: - image: common @@ -222,25 +222,37 @@ jobs: - <<: *run-tox-step - <<: *save-cache-step +define: &all_jobs + - docs + - py38-core + - py39-core + - py310-core + - py311-core + - py312-core + - py38-lint + - py39-lint + - py310-lint + - py311-lint + - py312-lint + - py38-wheel + - py39-wheel + - py310-wheel + - py311-wheel + - py312-wheel + - py311-windows-wheel + - py312-windows-wheel + workflows: version: 2 test: - jobs: - - docs - - py38-core - - py39-core - - py310-core - - py311-core - - py312-core - - py38-lint - - py39-lint - - py310-lint - - py311-lint - - py312-lint - - py38-wheel - - py39-wheel - - py310-wheel - - py311-wheel - - py312-wheel - - py311-windows-wheel - - py312-windows-wheel + jobs: *all_jobs + nightly: + triggers: + - schedule: + # Weekdays 12:00p UTC + cron: "0 12 * * 1,2,3,4,5" + filters: + branches: + only: + - main + jobs: *all_jobs From 80551030664d8527518bd06eff932e2ea88bcba6 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:29:45 -0600 Subject: [PATCH 05/26] rename github template files, minor editing --- .github/ISSUE_TEMPLATE/{bug_report.yaml => bug_report.yml} | 0 .github/ISSUE_TEMPLATE/{config.yaml => config.yml} | 0 .../{feature_request.yaml => feature_request.yml} | 0 .github/pull_request_template.md | 2 -- 4 files changed, 2 deletions(-) rename .github/ISSUE_TEMPLATE/{bug_report.yaml => bug_report.yml} (100%) rename .github/ISSUE_TEMPLATE/{config.yaml => config.yml} (100%) rename .github/ISSUE_TEMPLATE/{feature_request.yaml => feature_request.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yaml rename to .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/config.yaml rename to .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yaml rename to .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 18c01e24..12669bad 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,9 +8,7 @@ Closes # ### Todo: - [ ] Clean up commit history - - [ ] Add or update documentation related to these changes - - [ ] Add entry to the [release notes](https://github.com/ethereum//blob/main/newsfragments/README.md) #### Cute Animal Picture From d950ee737644e679ad9f137df564a702dfcb3e8c Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:06:08 -0600 Subject: [PATCH 06/26] add lint check for .rst files incorrectly placed in the top-level dir, also bump blocklint version --- .pre-commit-config.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49dc049e..051fdb8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,15 @@ repos: - id: mypy exclude: tests/ - repo: https://github.com/PrincetonUniversity/blocklint - rev: v0.2.4 + rev: v0.2.5 hooks: - id: blocklint exclude: 'docs/Makefile|docs/release_notes.rst|tox.ini' +- repo: local + hooks: + - id: check-rst-files + name: Check for .rst files in the top-level directory + entry: sh -c 'ls *.rst 1>/dev/null 2>&1 && { echo "found .rst file in top-level folder"; exit 1; } || exit 0' + language: system + always_run: true + pass_filenames: false From 74f0a2fac926aba086d2f59cfac00a4844904fce Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Mon, 15 Apr 2024 11:23:46 -0600 Subject: [PATCH 07/26] `sphinx-autobuild` for live docs updates (#129) * `sphinx-autobuild` for live docs updates. * Use Python 3.9 and `sphinx-autobuild` `2024.2.4` --- .circleci/config.yml | 2 +- .readthedocs.yaml | 2 +- Makefile | 4 ++++ setup.py | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71e64413..f42d71a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: docs: <<: *docs docker: - - image: cimg/python:3.8 + - image: cimg/python:3.9 environment: TOXENV: docs diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e55e07e4..acf57208 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py diff --git a/Makefile b/Makefile index 8ed201bf..fdbe5cb5 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ help: @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 "autobuild-docs - live update docs when changes are saved" @echo "notes - consume towncrier newsfragments/ and update release notes in docs/" @echo "release - package and upload a release (does not run notes target)" @echo "dist - package" @@ -33,6 +34,9 @@ lint: test: pytest tests +autobuild-docs: + sphinx-autobuild --open-browser docs docs/_build/html + build-docs: sphinx-apidoc -o docs/ . setup.py "*conftest*" $(MAKE) -C docs clean diff --git a/setup.py b/setup.py index c2247fee..484f113b 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ extras_require = { ], "docs": [ "sphinx>=6.0.0", + "sphinx-autobuild>=2024.2.4", "sphinx_rtd_theme>=1.0.0", "towncrier>=21,<22", ], From 6a869e7d24951b7ecfd4c2ce21ece92e8cb33131 Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:44:13 -0600 Subject: [PATCH 08/26] Update Makefile add `python -m` to the Makefile `test` command --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fdbe5cb5..b4ec6503 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ lint: ) test: - pytest tests + python -m pytest tests autobuild-docs: sphinx-autobuild --open-browser docs docs/_build/html From f29c8ad8f0a408ed909bf494bb1538f4c69efa8e Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Wed, 17 Apr 2024 10:50:30 -0600 Subject: [PATCH 09/26] `scripts` directory included in dist but not in wheel. (#130) --- MANIFEST.in | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index a122460c..0584923e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include LICENSE include README.md +recursive-include scripts * recursive-include tests * global-include *.pyi diff --git a/setup.py b/setup.py index 484f113b..4fbeceb5 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ setup( license="MIT", zip_safe=False, keywords="ethereum", - packages=find_packages(exclude=["tests", "tests.*"]), + packages=find_packages(exclude=["scripts", "tests", "tests.*"]), package_data={"": ["py.typed"]}, classifiers=[ "Development Status :: 3 - Alpha", From b87ee6a4a951209e7d5a823fd0df64e9c9f19fcb Mon Sep 17 00:00:00 2001 From: fselmo Date: Wed, 17 Apr 2024 12:53:36 -0600 Subject: [PATCH 10/26] Successfully unmark scripts as a package for wheels --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4fbeceb5..6ab16705 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ setup( license="MIT", zip_safe=False, keywords="ethereum", - packages=find_packages(exclude=["scripts", "tests", "tests.*"]), + packages=find_packages(exclude=["scripts", "scripts.*", "tests", "tests.*"]), package_data={"": ["py.typed"]}, classifiers=[ "Development Status :: 3 - Alpha", From eb6d44b72846d1da24c49790b0366f1e071033f4 Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:13:19 -0600 Subject: [PATCH 11/26] Update setup.py drop sphinx-autobuild dep back to allow py3.8 to install --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6ab16705..76a45df6 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ extras_require = { ], "docs": [ "sphinx>=6.0.0", - "sphinx-autobuild>=2024.2.4", + "sphinx-autobuild>=2021.3.14", "sphinx_rtd_theme>=1.0.0", "towncrier>=21,<22", ], From 2a68b314f1a1718244cbc4ade145eaaac0f3a444 Mon Sep 17 00:00:00 2001 From: kclowes Date: Fri, 19 Apr 2024 15:14:27 -0600 Subject: [PATCH 12/26] Add Docs Tox CI back (#131) --- .circleci/config.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f42d71a0..d5accebe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,14 +86,32 @@ windows-wheel-steps: key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} docs: &docs - docker: - - image: common + working_directory: ~/repo steps: + - checkout + - restore_cache: + keys: + - cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - run: + name: install dependencies + 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 + - save_cache: + paths: + - .tox + - ~/.cache/pip + - ~/.local + key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + resource_class: xlarge jobs: docs: From 04cce0c925f5c50a2c23f15fe05620a3874c2000 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:21:39 -0600 Subject: [PATCH 13/26] switch to xelatex for building latexpdf as it supports more unicode --- .circleci/config.yml | 2 +- docs/conf.py | 4 ++-- setup.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d5accebe..403fe74a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,7 @@ docs: &docs name: install latexpdf dependencies command: | sudo apt-get update - sudo apt-get install latexmk tex-gyre texlive-fonts-extra + sudo apt-get install latexmk tex-gyre texlive-fonts-extra texlive-xetex xindy - run: name: run tox command: python -m tox run -r diff --git a/docs/conf.py b/docs/conf.py index 1d0560df..7aaef77c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # documentation build configuration file, created by # sphinx-quickstart on Thu Oct 16 20:43:24 2014. # @@ -195,6 +193,8 @@ htmlhelp_basename = "docs" # -- Options for LaTeX output --------------------------------------------- +latex_engine = "xelatex" + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', diff --git a/setup.py b/setup.py index 76a45df6..c9e821d9 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- from setuptools import ( find_packages, setup, From 21c5fe3e2ba6919adf9071230da9fa2071cc481e Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:42:18 -0600 Subject: [PATCH 14/26] add *.ipynb to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 57eac529..2eb3d432 100644 --- a/.gitignore +++ b/.gitignore @@ -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 From ae8113250e52ec8550b6c9de243ee106de6f32db Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:48:50 -0600 Subject: [PATCH 15/26] add removing of *.egg-info to Makefile clean-build command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index b4ec6503..2be3c1ab 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ clean: clean-build clean-pyc clean-build: rm -fr build/ rm -fr dist/ + rm -fr *.egg-info clean-pyc: find . -name '*.pyc' -exec rm -f {} + From ea09f5ff5c96607054e2d62e720de0e913c18dfd Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Thu, 2 May 2024 16:36:41 -0600 Subject: [PATCH 16/26] Store Docs Artifacts (#133) * Store artifacts in docs CI * Force `pytest` import above all else --- .circleci/config.yml | 2 ++ pyproject.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 403fe74a..1e82e034 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,8 @@ docs: &docs - run: name: run tox command: python -m tox run -r + - store_artifacts: + path: /home/circleci/repo/docs/_build - save_cache: paths: - .tox diff --git a/pyproject.toml b/pyproject.toml index e46b7434..23b8399e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "" known_third_party = "hypothesis" From d8d0f05a88651d05a7ec1592cf130d839d9f0a3c Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Mon, 20 May 2024 15:20:59 -0600 Subject: [PATCH 17/26] update default docs and release process, drop bumpversion for bump-my-version --- .bumpversion.cfg | 22 ---- .pre-commit-config.yaml | 2 +- Makefile | 106 ++++++++++-------- README.md | 57 +--------- docs/MODULE_NAME.rst | 12 +++ docs/code_of_conduct.rst | 78 ++++++++++++++ docs/contributing.rst | 149 ++++++++++++++++++++++++++ docs/index.rst | 24 +++-- pyproject.toml | 43 ++++++++ scripts/release/test_package.py | 50 +++++++++ setup.py | 2 +- tests/core/test_import_and_version.py | 2 +- tox.ini | 2 +- 13 files changed, 419 insertions(+), 130 deletions(-) delete mode 100644 .bumpversion.cfg create mode 100644 docs/MODULE_NAME.rst create mode 100644 docs/code_of_conduct.rst create mode 100644 docs/contributing.rst create mode 100644 scripts/release/test_package.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 39ae22d4..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[bumpversion] -current_version = 0.1.0-alpha.0 -commit = True -tag = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-(?P[^.]*)\.(?P\d+))? -serialize = - {major}.{minor}.{patch}-{stage}.{devnum} - {major}.{minor}.{patch} - -[bumpversion:part:stage] -optional_value = stable -first_value = stable -values = - alpha - beta - stable - -[bumpversion:part:devnum] - -[bumpversion:file:setup.py] -search = version="{current_version}", -replace = version="{new_version}", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 051fdb8f..52554889 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/Makefile b/Makefile index 2be3c1ab..46778052 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,15 @@ 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 - generate docs and open in browser (linux-docs for version on linux)" @echo "autobuild-docs - live update docs when changes are saved" - @echo "notes - consume towncrier newsfragments/ and update release notes in docs/" - @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 release notes in docs - 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/ @@ -26,6 +26,12 @@ clean-pyc: 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..." \ @@ -35,26 +41,7 @@ lint: test: python -m pytest tests -autobuild-docs: - sphinx-autobuild --open-browser docs docs/_build/html - -build-docs: - sphinx-apidoc -o docs/ . setup.py "*conftest*" - $(MAKE) -C docs clean - $(MAKE) -C docs html - $(MAKE) -C docs doctest - -build-docs-ci: - $(MAKE) -C docs latexpdf - $(MAKE) -C docs epub - -validate-newsfragments: - python ./newsfragments/validate_files.py - towncrier build --draft --version preview - -check-docs: build-docs validate-newsfragments - -check-docs-ci: build-docs build-docs-ci validate-newsfragments +# docs commands docs: check-docs open docs/_build/html/index.html @@ -62,35 +49,70 @@ docs: check-docs linux-docs: check-docs xdg-open docs/_build/html/index.html -check-bump: -ifndef bump - $(error bump must be set, typically: major, minor, patch, or devnum) -endif +autobuild-docs: + sphinx-autobuild --open-browser docs docs/_build/html -notes: check-bump validate-newsfragments +# docs helpers + +validate-newsfragments: + python ./newsfragments/validate_files.py + towncrier build --draft --version preview + +check-docs: build-docs validate-newsfragments + +build-docs: + sphinx-apidoc -o docs/ . setup.py "*conftest*" + $(MAKE) -C docs clean + $(MAKE) -C docs html + $(MAKE) -C docs doctest + +check-docs-ci: build-docs build-docs-ci validate-newsfragments + +build-docs-ci: + $(MAKE) -C docs latexpdf + $(MAKE) -C docs epub + +# 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 show --increment $(bump) new_version)) # 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 build-docs git commit -m "Compile release notes for v$(UPCOMING_VERSION)" -release: check-bump clean - # require that upstream is configured for ethereum/ - @git remote -v | grep "upstream[[:space:]]git@github.com:ethereum/.git (push)\|upstream[[:space:]]https://github.com/ethereum/ (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 build-docs CURRENT_SIGN_SETTING=$(git config commit.gpgSign) git config commit.gpgSign true - bumpversion $(bump) - git push upstream && git push upstream --tags + bump-my-version bump $(bump) python -m build - twine upload dist/* git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" + git push upstream && git push upstream --tags + twine upload dist/* +# 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 you be on a branch that's linked to upstream/main + @if ! git status -s -b | head -1 | grep -q "\.\.upstream/main"; then \ + echo "Error: You must be on a branch that's linked to upstream/main"; \ + exit 1; \ + fi + # require that upstream is configured for ethereum/ + @if ! git remote -v | grep "upstream[[:space:]]git@github.com:ethereum/.git (push)\|upstream[[:space:]]https://github.com/ethereum/ (push)"; then \ + echo "Error: You must have a remote named 'upstream' that points to ''"; \ + exit 1; \ + fi diff --git a/README.md b/README.md index fa56f2e3..c81b3614 100644 --- a/README.md +++ b/README.md @@ -8,61 +8,12 @@ -Read more in the [documentation on ReadTheDocs](https://.readthedocs.io/). [View the change log](https://.readthedocs.io/en/latest/release_notes.html). +Read the [documentation](https://.readthedocs.io/). -## Quickstart +View the [change log](https://.readthedocs.io/en/latest/release_notes.html). + +## Installation ```sh python -m pip install ``` - -## Developer Setup - -If you would like to hack on , please check out the [Snake Charmers -Tactical Manual](https://github.com/ethereum/snake-charmers-tactical-manual) -for information on how we do: - -- Testing -- Pull Requests -- 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: - -```sh -git clone git@github.com:ethereum/.git -cd -virtualenv -p python3 venv -. venv/bin/activate -python -m pip install -e ".[dev]" -pre-commit install -``` - -### Release setup - -To release a new version: - -```sh -make release bump=$$VERSION_PART_TO_BUMP$$ -``` - -#### How to bumpversion - -The version format for this repo is `{major}.{minor}.{patch}` for stable, and -`{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta). - -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 -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. - -To issue an unstable version when the current version is stable, specify the -new version explicitly, like `make release bump="--new-version 4.0.0-alpha.1 devnum"` diff --git a/docs/MODULE_NAME.rst b/docs/MODULE_NAME.rst new file mode 100644 index 00000000..9c469afd --- /dev/null +++ b/docs/MODULE_NAME.rst @@ -0,0 +1,12 @@ +Usage +----- + +Example usage: + + +------------- + +.. automodule:: + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/code_of_conduct.rst b/docs/code_of_conduct.rst new file mode 100644 index 00000000..64954bd3 --- /dev/null +++ b/docs/code_of_conduct.rst @@ -0,0 +1,78 @@ +Code of Conduct +--------------- + +Our Pledge +~~~~~~~~~~ + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +Our Standards +~~~~~~~~~~~~~ + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +Our Responsibilities +~~~~~~~~~~~~~~~~~~~~ + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +Scope +~~~~~ + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +Enforcement +~~~~~~~~~~~ + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at snakecharmers@ethereum.org. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +Attribution +~~~~~~~~~~~ + +This Code of Conduct is adapted from the `Contributor Covenant `_, version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/docs/contributing.rst b/docs/contributing.rst new file mode 100644 index 00000000..68d258af --- /dev/null +++ b/docs/contributing.rst @@ -0,0 +1,149 @@ +Contributing +------------ + +Thank you for your interest in contributing! We welcome all contributions no matter +their size. Please read along to learn how to get started. If you get stuck, feel free +to ask for help in `Ethereum Python Discord server `_. + +Setting the stage +~~~~~~~~~~~~~~~~~ + +To get started, fork the repository to your own github account, then clone it to your +development machine: + +.. code:: sh + git clone git@github.com:your-github-username/.git + +Next, install the development dependencies. We recommend using a virtual environment, +such as `virtualenv `_. + +.. code:: sh + cd + virtualenv -p python venv + . venv/bin/activate + python -m pip install -e ".[dev]" + pre-commit install + +Running the tests +~~~~~~~~~~~~~~~~~ + +A great way to explore the code base is to run the tests. + +We can run all tests with: + +.. code:: sh + pytest tests + +Code Style +~~~~~~~~~~ + +We use `pre-commit `_ to enforce a consistent code style across +the library. This tool runs automatically with every commit, but you can also run it +manually with: + +.. code:: sh + make lint + +If you need to make a commit that skips the ``pre-commit`` checks, you can do so with +``git commit --no-verify``. + +This library uses type hints, which are enforced by the ``mypy`` tool (part of the +``pre-commit`` checks). All new code is required to land with type hints, with the +exception of code within the ``tests`` directory. + +Documentation +~~~~~~~~~~~~~ + +Good documentation will lead to quicker adoption and happier users. Please check out our +guide on +`how to create documentation for the Python Ethereum ecosystem `_. + +Pull Requests +~~~~~~~~~~~~~ + +It's a good idea to make pull requests early on. A pull request represents the start of +a discussion, and doesn't necessarily need to be the final, finished submission. + +GitHub's documentation for working on pull requests is +`available here `_. + +Once you've made a pull request, take a look at the Circle CI build status in the +GitHub interface and make sure all tests are passing. In general pull requests that +do not pass the CI build yet won't get reviewed unless explicitly requested. + +If the pull request introduces changes that should be reflected in the release notes, +please add a `newsfragment` file as explained +`here /blob/main/newsfragments/README.md>`_. + +If possible, the change to the release notes file should be included in the commit that +introduces the feature or bugfix. + +Releasing +~~~~~~~~~ + +Releases are typically done from the ``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). + +Final test before each release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before releasing a new version, build and test the package that will be released: + +.. code:: sh + git checkout main && git pull + make package-test + +This will build the package and install it in a temporary virtual environment. Follow +the instructions to activate the venv and test whatever you think is important. + +You can also preview the release notes: + +.. code:: sh + towncrier --draft + +Build the release notes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before bumping the version number, build the release notes. You must include the part of +the version to bump (see below), which changes how the version number will show in the +release notes. + +.. code:: sh + make notes bump=$$VERSION_PART_TO_BUMP$$ + +If there are any errors, be sure to re-run make notes until it works. + +Push the release to github & pypi +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +After confirming that the release package looks okay, release a new version: + +.. code:: sh + make release bump=$$VERSION_PART_TO_BUMP$$ + +This command will: + +- Bump the version number as specified in ``.pyproject.toml`` and ``setup.py``. +- Create a git commit and tag for the new version. +- Build the package. +- Push the commit and tag to github. +- Push the new package files to pypi. + +Which version part to bump +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``$$VERSION_PART_TO_BUMP$$`` must be one of: ``major``, ``minor``, ``patch``, ``stage``, +or ``devnum``. + +The version format for this repo is ``{major}.{minor}.{patch}`` for stable, and +``{major}.{minor}.{patch}-{stage}.{devnum}`` for unstable (``stage`` can be alpha or +beta). + +If you are in a beta version, ``make release bump=stage`` will switch to a stable. + +To issue an unstable version when the current version is stable, specify the new version +explicitly, like ``make release bump="--new-version 4.0.0-alpha.1"`` + +You can see what the result of bumping any particular version part would be with +``bump-my-version show-bump`` diff --git a/docs/index.rst b/docs/index.rst index 89815efa..6110067f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,18 +3,24 @@ -Contents --------- +Installation +------------ + +.. code-block:: bash + + python -m pip install + .. toctree:: - :maxdepth: 3 + :maxdepth: 1 + :caption: General - + Usage<> release_notes +.. toctree:: + :maxdepth: 1 + :caption: Community -Indices and tables ------------------- - -* :ref:`genindex` -* :ref:`modindex` + contributing + code_of_conduct diff --git a/pyproject.toml b/pyproject.toml index 23b8399e..910b3861 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -123,3 +123,46 @@ showcontent = true directory = "removal" name = "Removals" showcontent = true + +[tool.bumpversion] +current_version = "0.1.0-alpha.0" +parse = """ + (?P\\d+) + \\.(?P\\d+) + \\.(?P\\d+) + (- + (?P[^.]*) + \\.(?P\\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}\"" diff --git a/scripts/release/test_package.py b/scripts/release/test_package.py new file mode 100644 index 00000000..2f23898e --- /dev/null +++ b/scripts/release/test_package.py @@ -0,0 +1,50 @@ +from pathlib import ( + Path, +) +import subprocess +from tempfile import ( + TemporaryDirectory, +) +import venv + + +def create_venv(parent_path: Path) -> Path: + venv_path = parent_path / "package-smoke-test" + venv.create(venv_path, with_pip=True) + subprocess.run( + [venv_path / "bin" / "pip", "install", "-U", "pip", "setuptools"], check=True + ) + return venv_path + + +def find_wheel(project_path: Path) -> Path: + wheels = list(project_path.glob("dist/*.whl")) + + if len(wheels) != 1: + raise Exception( + f"Expected one wheel. Instead found: {wheels} " + f"in project {project_path.absolute()}" + ) + + return wheels[0] + + +def install_wheel(venv_path: Path, wheel_path: Path) -> None: + subprocess.run( + [venv_path / "bin" / "pip", "install", f"{wheel_path}"], + check=True, + ) + + +def test_install_local_wheel() -> None: + with TemporaryDirectory() as tmpdir: + venv_path = create_venv(Path(tmpdir)) + wheel_path = find_wheel(Path(".")) + install_wheel(venv_path, wheel_path) + print("Installed", wheel_path.absolute(), "to", venv_path) + print(f"Activate with `source {venv_path}/bin/activate`") + input("Press enter when the test has completed. The directory will be deleted.") + + +if __name__ == "__main__": + test_install_local_wheel() diff --git a/setup.py b/setup.py index c9e821d9..cbc9fb9d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import ( extras_require = { "dev": [ "build>=0.9.0", - "bumpversion>=0.5.3", + "bump_my_version>=0.19.0", "ipython", "pre-commit>=3.4.0", "tox>=4.0.0", diff --git a/tests/core/test_import_and_version.py b/tests/core/test_import_and_version.py index 6a2f8ea5..9d5ea0a8 100644 --- a/tests/core/test_import_and_version.py +++ b/tests/core/test_import_and_version.py @@ -1,4 +1,4 @@ def test_import_and_version(): import - + assert isinstance(.__version__, str) diff --git a/tox.ini b/tox.ini index 90d502d2..f7c0dfee 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ allowlist_externals=make,pre-commit [testenv:py{38,39,310,311,312}-lint] deps=pre-commit commands= - pre-commit install + pre-commit install pre-commit run --all-files --show-diff-on-failure [testenv:py{38,39,310,311,312}-wheel] From e731a9464d43a5075551b164f480107ccb4edfb6 Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:11:17 -0600 Subject: [PATCH 18/26] Update Makefile remove unneeded upstream git check --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 46778052..98d53312 100644 --- a/Makefile +++ b/Makefile @@ -106,11 +106,6 @@ ifndef bump endif check-git: - # require that you be on a branch that's linked to upstream/main - @if ! git status -s -b | head -1 | grep -q "\.\.upstream/main"; then \ - echo "Error: You must be on a branch that's linked to upstream/main"; \ - exit 1; \ - fi # require that upstream is configured for ethereum/ @if ! git remote -v | grep "upstream[[:space:]]git@github.com:ethereum/.git (push)\|upstream[[:space:]]https://github.com/ethereum/ (push)"; then \ echo "Error: You must have a remote named 'upstream' that points to ''"; \ From 40ce3a8174ed1e507b6f22c2e5143226798e40b9 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:11:12 -0600 Subject: [PATCH 19/26] fix code blocks and version parsing --- Makefile | 2 +- docs/contributing.rst | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 98d53312..b8afdba4 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ package-test: clean notes: check-bump # Let UPCOMING_VERSION be the version that is used for the current bump - $(eval UPCOMING_VERSION=$(shell bump-my-version show --increment $(bump) new_version)) + $(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 diff --git a/docs/contributing.rst b/docs/contributing.rst index 68d258af..61584f54 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -12,12 +12,14 @@ To get started, fork the repository to your own github account, then clone it to development machine: .. code:: sh + git clone git@github.com:your-github-username/.git Next, install the development dependencies. We recommend using a virtual environment, such as `virtualenv `_. .. code:: sh + cd virtualenv -p python venv . venv/bin/activate @@ -32,6 +34,7 @@ A great way to explore the code base is to run the tests. We can run all tests with: .. code:: sh + pytest tests Code Style @@ -42,6 +45,7 @@ the library. This tool runs automatically with every commit, but you can also ru manually with: .. code:: sh + make lint If you need to make a commit that skips the ``pre-commit`` checks, you can do so with @@ -91,6 +95,7 @@ Final test before each release Before releasing a new version, build and test the package that will be released: .. code:: sh + git checkout main && git pull make package-test @@ -100,6 +105,7 @@ the instructions to activate the venv and test whatever you think is important. You can also preview the release notes: .. code:: sh + towncrier --draft Build the release notes @@ -110,6 +116,7 @@ the version to bump (see below), which changes how the version number will show release notes. .. code:: sh + make notes bump=$$VERSION_PART_TO_BUMP$$ If there are any errors, be sure to re-run make notes until it works. @@ -120,6 +127,7 @@ Push the release to github & pypi After confirming that the release package looks okay, release a new version: .. code:: sh + make release bump=$$VERSION_PART_TO_BUMP$$ This command will: From 224044874e6b39da2bb050944207b7b40ef922cb Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:45:04 -0600 Subject: [PATCH 20/26] bump towncrier version pins --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cbc9fb9d..9df5e76c 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ extras_require = { "sphinx>=6.0.0", "sphinx-autobuild>=2021.3.14", "sphinx_rtd_theme>=1.0.0", - "towncrier>=21,<22", + "towncrier>=24,<25", ], "test": [ "pytest>=7.0.0", From 6a927ac1e755e062208a0949c559ad8ddba0d539 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:50:53 -0700 Subject: [PATCH 21/26] drop py38, add py13, add 2024 to license --- .circleci/config.yml | 50 ++++++++++++++++++++++++++--------------- .pre-commit-config.yaml | 2 +- .readthedocs.yaml | 2 +- LICENSE | 2 +- setup.py | 4 ++-- tox.ini | 12 +++++----- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e82e034..64fb5840 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,16 +119,10 @@ jobs: docs: <<: *docs docker: - - image: cimg/python:3.9 + - image: cimg/python:3.10 environment: TOXENV: docs - py38-core: - <<: *common - docker: - - image: cimg/python:3.8 - environment: - TOXENV: py38-core py39-core: <<: *common docker: @@ -153,13 +147,13 @@ jobs: - image: cimg/python:3.12 environment: TOXENV: py312-core - - py38-lint: + py313-core: <<: *common docker: - - image: cimg/python:3.8 + - image: cimg/python:3.13 environment: - TOXENV: py38-lint + TOXENV: py313-core + py39-lint: <<: *common docker: @@ -184,13 +178,13 @@ jobs: - image: cimg/python:3.12 environment: TOXENV: py312-lint - - py38-wheel: + py313-lint: <<: *common docker: - - image: cimg/python:3.8 + - image: cimg/python:3.13 environment: - TOXENV: py38-wheel + TOXENV: py313-lint + py39-wheel: <<: *common docker: @@ -215,6 +209,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 @@ -242,25 +242,39 @@ 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 + define: &all_jobs - docs - - py38-core - py39-core - py310-core - py311-core - py312-core - - py38-lint + - py313-core - py39-lint - py310-lint - py311-lint - py312-lint - - py38-wheel + - py313-lint - py39-wheel - py310-wheel - py311-wheel - py312-wheel + - py313-wheel - py311-windows-wheel - py312-windows-wheel + - py313-windows-wheel workflows: version: 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52554889..27e397a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/psf/black rev: 23.9.1 hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index acf57208..e72927c2 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.9" + python: "3.10" sphinx: configuration: docs/conf.py diff --git a/LICENSE b/LICENSE index b76b24d4..f62c80ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-2023 The Ethereum Foundation +Copyright (c) 2019-2024 The Ethereum Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.py b/setup.py index 9df5e76c..8d4afe03 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ setup( install_requires=[ "eth-utils>=2", ], - python_requires=">=3.8, <4", + python_requires=">=3.9, <4", extras_require=extras_require, py_modules=[""], license="MIT", @@ -63,10 +63,10 @@ setup( "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], ) diff --git a/tox.ini b/tox.ini index f7c0dfee..a7520269 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist= - py{38,39,310,311,312}-core - py{38,39,310,311,312}-lint - py{38,39,310,311,312}-wheel + py{39,310,311,312,313}-core + py{39,310,311,312,313}-lint + py{39,310,311,312,313}-wheel windows-wheel docs @@ -23,23 +23,23 @@ commands= basepython= docs: python windows-wheel: python - py38: python3.8 py39: python3.9 py310: python3.10 py311: python3.11 py312: python3.12 + py313: python3.13 extras= test docs allowlist_externals=make,pre-commit -[testenv:py{38,39,310,311,312}-lint] +[testenv:py{39,310,311,313}-lint] deps=pre-commit commands= pre-commit install pre-commit run --all-files --show-diff-on-failure -[testenv:py{38,39,310,311,312}-wheel] +[testenv:py{39,310,311,312,313}-wheel] deps= wheel build[virtualenv] From 1280617249d31d4fb069bb2a33f10535e25a3dfb Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:04:31 -0700 Subject: [PATCH 22/26] run mypy local --- .pre-commit-config.yaml | 11 +++++++---- LICENSE | 2 +- setup.py | 1 + tox.ini | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27e397a7..a8475326 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,11 +43,14 @@ repos: - id: mdformat additional_dependencies: - mdformat-gfm -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 +- repo: local hooks: - - id: mypy - exclude: tests/ + - id: mypy-local + name: run mypy with all dev dependencies present + entry: python -m mypy -p + language: system + always_run: true + pass_filenames: false - repo: https://github.com/PrincetonUniversity/blocklint rev: v0.2.5 hooks: diff --git a/LICENSE b/LICENSE index f62c80ac..2f15d339 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-2024 The Ethereum Foundation +Copyright (c) 2019-2025 The Ethereum Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.py b/setup.py index 8d4afe03..01b842c2 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ extras_require = { "build>=0.9.0", "bump_my_version>=0.19.0", "ipython", + "mypy==1.10.0", "pre-commit>=3.4.0", "tox>=4.0.0", "twine", diff --git a/tox.ini b/tox.ini index a7520269..55cce314 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,7 @@ extras= docs allowlist_externals=make,pre-commit -[testenv:py{39,310,311,313}-lint] +[testenv:py{39,310,311,312,313}-lint] deps=pre-commit commands= pre-commit install From 83887422fbc5c1088ccc0bfb6b8959f861018286 Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:13:04 -0700 Subject: [PATCH 23/26] correct use of __file__ --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 7aaef77c..771bc45e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ import os -DIR = os.path.dirname("__file__") +DIR = os.path.dirname(__file__) with open(os.path.join(DIR, "../setup.py"), "r") as f: for line in f: if "version=" in line: From c6a24e411c05df3f502a925b2162205fb8528afb Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:23:01 -0700 Subject: [PATCH 24/26] Update version update note --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 01b842c2..956036de 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ with open("./README.md") as readme: setup( name="", - # *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme + # *IMPORTANT*: Don't manually change the version here. See Contributing docs for the release process. version="0.1.0-alpha.0", description=""": """, long_description=long_description, From 4be68af0dbd56e79f93a941db64468dcbe99f938 Mon Sep 17 00:00:00 2001 From: fselmo Date: Mon, 25 Nov 2024 10:24:29 -0700 Subject: [PATCH 25/26] Put python3.8 support back in: - We should create a breaking changes branch to be merged only when we are ready to start the next major version release cycle for all our maintained libraries. --- .circleci/config.yml | 21 +++++++++++++++++++++ .pre-commit-config.yaml | 2 +- setup.py | 3 ++- tox.ini | 11 ++++++----- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64fb5840..e47bbbc1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,6 +123,12 @@ jobs: environment: TOXENV: docs + py38-core: + <<: *common + docker: + - image: cimg/python:3.8 + environment: + TOXENV: py38-core py39-core: <<: *common docker: @@ -154,6 +160,12 @@ jobs: environment: TOXENV: py313-core + py38-lint: + <<: *common + docker: + - image: cimg/python:3.8 + environment: + TOXENV: py38-lint py39-lint: <<: *common docker: @@ -185,6 +197,12 @@ jobs: environment: TOXENV: py313-lint + py38-wheel: + <<: *common + docker: + - image: cimg/python:3.8 + environment: + TOXENV: py38-wheel py39-wheel: <<: *common docker: @@ -257,16 +275,19 @@ jobs: define: &all_jobs - docs + - py38-core - py39-core - 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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8475326..3e77b024 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py38-plus] - repo: https://github.com/psf/black rev: 23.9.1 hooks: diff --git a/setup.py b/setup.py index 956036de..491f5579 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ setup( install_requires=[ "eth-utils>=2", ], - python_requires=">=3.9, <4", + python_requires=">=3.8, <4", extras_require=extras_require, py_modules=[""], license="MIT", @@ -64,6 +64,7 @@ setup( "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/tox.ini b/tox.ini index 55cce314..6f762cfe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist= - py{39,310,311,312,313}-core - py{39,310,311,312,313}-lint - py{39,310,311,312,313}-wheel + py{38,39,310,311,312,313}-core + py{38,39,310,311,312,313}-lint + py{38,39,310,311,312,313}-wheel windows-wheel docs @@ -23,6 +23,7 @@ commands= basepython= docs: python windows-wheel: python + py38: python3.8 py39: python3.9 py310: python3.10 py311: python3.11 @@ -33,13 +34,13 @@ extras= docs allowlist_externals=make,pre-commit -[testenv:py{39,310,311,312,313}-lint] +[testenv:py{38,39,310,311,312,313}-lint] deps=pre-commit commands= pre-commit install pre-commit run --all-files --show-diff-on-failure -[testenv:py{39,310,311,312,313}-wheel] +[testenv:py{38,39,310,311,312,313}-wheel] deps= wheel build[virtualenv] From ae5b634d7ba1ebf476971697e87078cc4d893c95 Mon Sep 17 00:00:00 2001 From: Paul Robinson <5199899+pacrob@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:44:50 -0700 Subject: [PATCH 26/26] Update code_of_conduct.rst making -> make --- docs/code_of_conduct.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/code_of_conduct.rst b/docs/code_of_conduct.rst index 64954bd3..a5f842ef 100644 --- a/docs/code_of_conduct.rst +++ b/docs/code_of_conduct.rst @@ -5,7 +5,7 @@ Our Pledge ~~~~~~~~~~ In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and +contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race,