Skip to content

Commit 1cd64ee

Browse files
committed
merge template and fill vars
2 parents 7d05e02 + ae5b634 commit 1cd64ee

File tree

15 files changed

+214
-68
lines changed

15 files changed

+214
-68
lines changed

.bumpversion.cfg

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

.circleci/config.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,11 @@ docs: &docs
100100
command: |
101101
python -m pip install --upgrade pip
102102
python -m pip install tox
103-
- run:
104-
name: install latexpdf dependencies
105-
command: |
106-
sudo apt-get update
107-
sudo apt-get install latexmk tex-gyre texlive-fonts-extra
108103
- run:
109104
name: run tox
110105
command: python -m tox run -r
106+
- store_artifacts:
107+
path: /home/circleci/repo/docs/_build
111108
- save_cache:
112109
paths:
113110
- .tox
@@ -120,7 +117,7 @@ jobs:
120117
docs:
121118
<<: *docs
122119
docker:
123-
- image: cimg/python:3.9
120+
- image: cimg/python:3.10
124121
environment:
125122
TOXENV: docs
126123

@@ -154,6 +151,12 @@ jobs:
154151
- image: cimg/python:3.12
155152
environment:
156153
TOXENV: py312-core
154+
py313-core:
155+
<<: *common
156+
docker:
157+
- image: cimg/python:3.13
158+
environment:
159+
TOXENV: py313-core
157160

158161
py38-lint:
159162
<<: *common
@@ -185,6 +188,12 @@ jobs:
185188
- image: cimg/python:3.12
186189
environment:
187190
TOXENV: py312-lint
191+
py313-lint:
192+
<<: *common
193+
docker:
194+
- image: cimg/python:3.13
195+
environment:
196+
TOXENV: py313-lint
188197

189198
py38-wheel:
190199
<<: *common
@@ -216,6 +225,12 @@ jobs:
216225
- image: cimg/python:3.12
217226
environment:
218227
TOXENV: py312-wheel
228+
py313-wheel:
229+
<<: *common
230+
docker:
231+
- image: cimg/python:3.13
232+
environment:
233+
TOXENV: py313-wheel
219234

220235
py311-windows-wheel:
221236
<<: *windows-wheel-setup
@@ -243,25 +258,42 @@ jobs:
243258
- <<: *run-tox-step
244259
- <<: *save-cache-step
245260

261+
py313-windows-wheel:
262+
<<: *windows-wheel-setup
263+
steps:
264+
- checkout
265+
- <<: *restore-cache-step
266+
- <<: *install-pyenv-step
267+
- run:
268+
name: set minor version
269+
command: echo "export MINOR_VERSION='3.13'" >> $BASH_ENV
270+
- <<: *install-latest-python-step
271+
- <<: *run-tox-step
272+
- <<: *save-cache-step
273+
246274
define: &all_jobs
247275
- docs
248276
- py38-core
249277
- py39-core
250278
- py310-core
251279
- py311-core
252280
- py312-core
281+
- py313-core
253282
- py38-lint
254283
- py39-lint
255284
- py310-lint
256285
- py311-lint
257286
- py312-lint
287+
- py313-lint
258288
- py38-wheel
259289
- py39-wheel
260290
- py310-wheel
261291
- py311-wheel
262292
- py312-wheel
293+
- py313-wheel
263294
- py311-windows-wheel
264295
- py312-windows-wheel
296+
- py313-windows-wheel
265297

266298
workflows:
267299
version: 2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ logs
8181
# vs-code
8282
.vscode
8383

84+
# jupyter notebook files
85+
*.ipynb
86+
8487
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
8588
# For a more precise, explicit template, see:
8689
# https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.pre-commit-config.yaml

Lines changed: 1 addition & 6 deletions
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
@@ -43,11 +43,6 @@ repos:
4343
- id: mdformat
4444
additional_dependencies:
4545
- mdformat-gfm
46-
- repo: https://github.com/pre-commit/mirrors-mypy
47-
rev: v1.5.1
48-
hooks:
49-
- id: mypy
50-
exclude: 'tests/|trie/'
5146
- repo: https://github.com/PrincetonUniversity/blocklint
5247
rev: v0.2.5
5348
hooks:

.readthedocs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
fail_on_warning: true
11+
12+
python:
13+
install:
14+
- method: pip
15+
path: .
16+
extra_requirements:
17+
- docs
18+
19+
# Build all formats for RTD Downloads - htmlzip, pdf, epub
20+
formats: all

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017-2023 The Ethereum Foundation
3+
Copyright (c) 2017-2025 The Ethereum Foundation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,32 @@ 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 - view draft of newsfragments to be added to CHANGELOG"
11-
@echo "notes - consume towncrier newsfragments/ and update CHANGELOG"
12-
@echo "release - package and upload a release (does not run notes target)"
13-
@echo "dist - package"
14-
15-
clean: clean-build clean-pyc
13+
@echo "autobuild-docs - live update docs when changes are saved"
14+
@echo "notes - consume towncrier newsfragments/ and update CHANGELOG - requires bump to be set"
15+
@echo "release - package and upload a release (does not run notes target) - requires bump to be set"
1616

1717
clean-build:
1818
rm -fr build/
1919
rm -fr dist/
20+
rm -fr *.egg-info
2021

2122
clean-pyc:
2223
find . -name '*.pyc' -exec rm -f {} +
2324
find . -name '*.pyo' -exec rm -f {} +
2425
find . -name '*~' -exec rm -f {} +
2526
find . -name '__pycache__' -exec rm -rf {} +
2627

28+
clean: clean-build clean-pyc
29+
30+
dist: clean
31+
python -m build
32+
ls -l dist
33+
2734
lint:
2835
@pre-commit run --all-files --show-diff-on-failure || ( \
2936
echo "\n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \
@@ -33,38 +40,48 @@ lint:
3340
test:
3441
python -m pytest tests
3542

43+
# docs commands
44+
3645
docs:
3746
python ./newsfragments/validate_files.py
3847
towncrier build --draft --version preview
3948

40-
check-bump:
41-
ifndef bump
42-
$(error bump must be set, typically: major, minor, patch, or devnum)
43-
endif
49+
# release commands
50+
51+
package-test: clean
52+
python -m build
53+
python scripts/release/test_package.py
4454

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

54-
release: check-bump clean
55-
# require that upstream is configured for ethereum/py-trie
56-
@git remote -v | grep "upstream[[:space:]][email protected]:ethereum/py-trie.git (push)\|upstream[[:space:]]https://github.com/ethereum/py-trie (push)"
57-
# verify that docs build correctly
64+
release: check-bump check-git clean
65+
# verify that notes command ran correctly
5866
./newsfragments/validate_files.py is-empty
59-
make docs
6067
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
6168
git config commit.gpgSign true
62-
bumpversion $(bump)
63-
git push upstream && git push upstream --tags
69+
bump-my-version bump $(bump)
6470
python -m build
65-
twine upload dist/*
6671
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"
72+
git push upstream && git push upstream --tags
73+
twine upload dist/*
6774

68-
dist: clean
69-
python -m build
70-
ls -l dist
75+
# release helpers
76+
77+
check-bump:
78+
ifndef bump
79+
$(error bump must be set, typically: major, minor, patch, or devnum)
80+
endif
81+
82+
check-git:
83+
# require that upstream is configured for ethereum/py-trie
84+
@if ! git remote -v | grep "upstream[[:space:]][email protected]:ethereum/py-trie.git (push)\|upstream[[:space:]]https://github.com/ethereum/py-trie (push)"; then \
85+
echo "Error: You must have a remote named 'upstream' that points to 'py-trie'"; \
86+
exit 1; \
87+
fi

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
> This library and repository was previously located at [pipermerriam/py-trie](https://github.com/pipermerriam/py-trie). It was transferred to the Ethereum foundation GitHub in
99
> November 2017 and renamed to `py-trie`.
1010
11+
Read more in the documentation below.
12+
13+
View the [change log](https://github.com/ethereum/py-trie/blob/main/CHANGELOG.rst).
14+
1115
## Installation
1216

1317
```sh
@@ -69,10 +73,10 @@ like `make release bump=minor` or `make release bump=devnum`. This is typically
6973
main branch, except when releasing a beta (in which case the beta is released from main,
7074
and the previous stable branch is released from said branch).
7175

72-
If you are in a beta version, `bumpversion stage` will switch to a stable.
76+
If you are in a beta version, `make release bump=stage` will switch to a stable.
7377

7478
To issue an unstable version when the current version is stable, specify the
75-
new version explicitly, like `bumpversion --new-version 4.0.0-alpha.1 devnum`
79+
new version explicitly, like `make release bump="--new-version 4.0.0-alpha.1 devnum"`
7680

7781
## Usage
7882

newsfragments/156.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Merge template, adding py313 to CI and replacing ``bumpversion`` with ``bump-my-version``.

pyproject.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ combine_as_imports = true
77
extra_standard_library = "pytest"
88
force_grid_wrap = 1
99
force_sort_within_sections = true
10+
force_to_top = "pytest"
1011
honor_noqa = true
1112
known_first_party = "trie"
1213
known_third_party = "hypothesis"
@@ -122,3 +123,46 @@ showcontent = true
122123
directory = "removal"
123124
name = "Removals"
124125
showcontent = true
126+
127+
[tool.bumpversion]
128+
current_version = "3.0.1"
129+
parse = """
130+
(?P<major>\\d+)
131+
\\.(?P<minor>\\d+)
132+
\\.(?P<patch>\\d+)
133+
(-
134+
(?P<stage>[^.]*)
135+
\\.(?P<devnum>\\d+)
136+
)?
137+
"""
138+
serialize = [
139+
"{major}.{minor}.{patch}-{stage}.{devnum}",
140+
"{major}.{minor}.{patch}",
141+
]
142+
search = "{current_version}"
143+
replace = "{new_version}"
144+
regex = false
145+
ignore_missing_version = false
146+
tag = true
147+
sign_tags = true
148+
tag_name = "v{new_version}"
149+
tag_message = "Bump version: {current_version} → {new_version}"
150+
allow_dirty = false
151+
commit = true
152+
message = "Bump version: {current_version} → {new_version}"
153+
154+
[tool.bumpversion.parts.stage]
155+
optional_value = "stable"
156+
first_value = "stable"
157+
values = [
158+
"alpha",
159+
"beta",
160+
"stable",
161+
]
162+
163+
[tool.bumpversion.part.devnum]
164+
165+
[[tool.bumpversion.files]]
166+
filename = "setup.py"
167+
search = "version=\"{current_version}\""
168+
replace = "version=\"{new_version}\""

0 commit comments

Comments
 (0)