Skip to content

Commit 46a8f96

Browse files
authored
Merge pull request #50 from pacrob/upgrade-template
Upgrade template
2 parents 1b59804 + 2837968 commit 46a8f96

File tree

16 files changed

+138
-94
lines changed

16 files changed

+138
-94
lines changed

.circleci/config.yml

Lines changed: 70 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ docs: &docs
101101
name: install latexpdf dependencies
102102
command: |
103103
sudo apt-get update
104-
sudo apt-get install latexmk tex-gyre texlive-fonts-extra
104+
sudo apt-get install latexmk tex-gyre texlive-fonts-extra texlive-xetex xindy
105105
- run:
106106
name: run tox
107107
command: python -m tox run -r
108+
- store_artifacts:
109+
path: /home/circleci/repo/docs/_build
108110
- save_cache:
109111
paths:
110112
- .tox
@@ -117,7 +119,7 @@ jobs:
117119
docs:
118120
<<: *docs
119121
docker:
120-
- image: cimg/python:3.8
122+
- image: cimg/python:3.10
121123
environment:
122124
TOXENV: docs
123125

@@ -151,6 +153,12 @@ jobs:
151153
- image: cimg/python:3.12
152154
environment:
153155
TOXENV: py312-core
156+
py313-core:
157+
<<: *common
158+
docker:
159+
- image: cimg/python:3.13
160+
environment:
161+
TOXENV: py313-core
154162

155163
py38-lint:
156164
<<: *common
@@ -182,6 +190,12 @@ jobs:
182190
- image: cimg/python:3.12
183191
environment:
184192
TOXENV: py312-lint
193+
py313-lint:
194+
<<: *common
195+
docker:
196+
- image: cimg/python:3.13
197+
environment:
198+
TOXENV: py313-lint
185199

186200
py38-wheel:
187201
<<: *common
@@ -213,6 +227,12 @@ jobs:
213227
- image: cimg/python:3.12
214228
environment:
215229
TOXENV: py312-wheel
230+
py313-wheel:
231+
<<: *common
232+
docker:
233+
- image: cimg/python:3.13
234+
environment:
235+
TOXENV: py313-wheel
216236

217237
py311-windows-wheel:
218238
<<: *windows-wheel-setup
@@ -240,25 +260,54 @@ jobs:
240260
- <<: *run-tox-step
241261
- <<: *save-cache-step
242262

263+
py313-windows-wheel:
264+
<<: *windows-wheel-setup
265+
steps:
266+
- checkout
267+
- <<: *restore-cache-step
268+
- <<: *install-pyenv-step
269+
- run:
270+
name: set minor version
271+
command: echo "export MINOR_VERSION='3.13'" >> $BASH_ENV
272+
- <<: *install-latest-python-step
273+
- <<: *run-tox-step
274+
- <<: *save-cache-step
275+
276+
define: &all_jobs
277+
- docs
278+
- py38-core
279+
- py39-core
280+
- py310-core
281+
- py311-core
282+
- py312-core
283+
- py313-core
284+
- py38-lint
285+
- py39-lint
286+
- py310-lint
287+
- py311-lint
288+
- py312-lint
289+
- py313-lint
290+
- py38-wheel
291+
- py39-wheel
292+
- py310-wheel
293+
- py311-wheel
294+
- py312-wheel
295+
- py313-wheel
296+
- py311-windows-wheel
297+
- py312-windows-wheel
298+
- py313-windows-wheel
299+
243300
workflows:
244301
version: 2
245302
test:
246-
jobs:
247-
- docs
248-
- py38-core
249-
- py39-core
250-
- py310-core
251-
- py311-core
252-
- py312-core
253-
- py38-lint
254-
- py39-lint
255-
- py310-lint
256-
- py311-lint
257-
- py312-lint
258-
- py38-wheel
259-
- py39-wheel
260-
- py310-wheel
261-
- py311-wheel
262-
- py312-wheel
263-
- py311-windows-wheel
264-
- py312-windows-wheel
303+
jobs: *all_jobs
304+
nightly:
305+
triggers:
306+
- schedule:
307+
# Weekdays 12:00p UTC
308+
cron: "0 12 * * 1,2,3,4,5"
309+
filters:
310+
branches:
311+
only:
312+
- main
313+
jobs: *all_jobs

.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

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: "ubuntu-22.04"
55
tools:
6-
python: "3.11"
6+
python: "3.10"
77

88
sphinx:
99
configuration: docs/conf.py

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) 2019-2023 The Ethereum Foundation
3+
Copyright (c) 2019-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

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include LICENSE
22
include README.md
33

4+
recursive-include scripts *
45
recursive-include tests *
56

67
global-include *.pyi

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ help:
66
@echo "clean-build - remove build artifacts"
77
@echo "clean-pyc - remove Python file artifacts"
88
@echo "clean - run clean-build and clean-pyc"
9+
@echo "dist - build package and cat contents of the dist directory"
910
@echo "lint - fix linting issues with pre-commit"
1011
@echo "test - run tests quickly with the default Python"
1112
@echo "docs - generate docs and open in browser (linux-docs for version on linux)"
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)"
13+
@echo "autobuild-docs - live update docs when changes are saved"
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"
1417

1518
clean-build:
1619
rm -fr build/
1720
rm -fr dist/
21+
rm -fr *.egg-info
1822

1923
clean-pyc:
2024
find . -name '*.pyc' -exec rm -f {} +
@@ -24,14 +28,18 @@ clean-pyc:
2428

2529
clean: clean-build clean-pyc
2630

31+
dist: clean
32+
python -m build
33+
ls -l dist
34+
2735
lint:
2836
@pre-commit run --all-files --show-diff-on-failure || ( \
2937
echo "\n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \
3038
&& pre-commit run --all-files --show-diff-on-failure \
3139
)
3240

3341
test:
34-
pytest tests
42+
python -m pytest tests
3543

3644
# docs commands
3745

@@ -41,6 +49,9 @@ docs: check-docs
4149
linux-docs: check-docs
4250
xdg-open docs/_build/html/index.html
4351

52+
autobuild-docs:
53+
sphinx-autobuild --open-browser docs docs/_build/html
54+
4455
# docs helpers
4556

4657
validate-newsfragments:
@@ -55,8 +66,6 @@ build-docs:
5566
$(MAKE) -C docs html
5667
$(MAKE) -C docs doctest
5768

58-
# docs helpers for CI, which requires extra dependencies
59-
6069
check-docs-ci: build-docs build-docs-ci validate-newsfragments
6170

6271
build-docs-ci:

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,8 @@ Read the [documentation](https://hexbytes.readthedocs.io/).
1212

1313
View the [change log](https://hexbytes.readthedocs.io/en/latest/release_notes.html).
1414

15-
## Quickstart
15+
## Installation
1616

1717
```sh
1818
python -m pip install hexbytes
1919
```
20-
21-
```py
22-
# convert from bytes to a prettier representation at the console
23-
>>> HexBytes(b"\x03\x08wf\xbfh\xe7\x86q\xd1\xeaCj\xe0\x87\xdat\xa1'a\xda\xc0 \x01\x1a\x9e\xdd\xc4\x90\x0b\xf1;")
24-
HexBytes('0x03087766bf68e78671d1ea436ae087da74a12761dac020011a9eddc4900bf13b')
25-
26-
# HexBytes accepts the hex string representation as well, ignoring case and 0x prefixes
27-
>>> hb = HexBytes('03087766BF68E78671D1EA436AE087DA74A12761DAC020011A9EDDC4900BF13B')
28-
HexBytes('0x03087766bf68e78671d1ea436ae087da74a12761dac020011a9eddc4900bf13b')
29-
30-
# get the first byte:
31-
>>> hb[0]
32-
3
33-
34-
# show how many bytes are in the value
35-
>>> len(hb)
36-
32
37-
38-
# cast back to the basic `bytes` type
39-
>>> bytes(hb)
40-
b"\x03\x08wf\xbfh\xe7\x86q\xd1\xeaCj\xe0\x87\xdat\xa1'a\xda\xc0 \x01\x1a\x9e\xdd\xc4\x90\x0b\xf1;"
41-
```

docs/code_of_conduct.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Our Pledge
55
~~~~~~~~~~
66

77
In the interest of fostering an open and welcoming environment, we as
8-
contributors and maintainers pledge to making participation in our project and
8+
contributors and maintainers pledge to make participation in our project and
99
our community a harassment-free experience for everyone, regardless of age, body
1010
size, disability, ethnicity, gender identity and expression, level of experience,
1111
education, socio-economic status, nationality, personal appearance, race,

docs/conf.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# HexBytes documentation build configuration file, created by
42
# sphinx-quickstart on Thu Oct 16 20:43:24 2014.
53
#
@@ -19,7 +17,7 @@
1917

2018
import os
2119

22-
DIR = os.path.dirname("__file__")
20+
DIR = os.path.dirname(__file__)
2321
with open(os.path.join(DIR, "../setup.py"), "r") as f:
2422
for line in f:
2523
if "version=" in line:
@@ -195,14 +193,16 @@
195193

196194
# -- Options for LaTeX output ---------------------------------------------
197195

198-
# latex_elements = {
199-
# # The paper size ('letterpaper' or 'a4paper').
200-
# 'papersize': 'letterpaper',
201-
# # The font size ('10pt', '11pt' or '12pt').
202-
# 'pointsize': '10pt',
203-
# # Additional stuff for the LaTeX preamble.
204-
# 'preamble': '',
205-
# }
196+
latex_engine = "xelatex"
197+
198+
latex_elements = {
199+
# The paper size ('letterpaper' or 'a4paper').
200+
#'papersize': 'letterpaper',
201+
# The font size ('10pt', '11pt' or '12pt').
202+
#'pointsize': '10pt',
203+
# Additional stuff for the LaTeX preamble.
204+
#'preamble': '',
205+
}
206206

207207
# Grouping the document tree into LaTeX files. List of tuples
208208
# (source start file, target name, title,

docs/contributing.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ development machine:
1515
1616
git clone git@github.com:your-github-username/hexbytes.git
1717
18-
1918
Next, install the development dependencies. We recommend using a virtual environment,
2019
such as `virtualenv <https://virtualenv.pypa.io/en/stable/>`_.
2120

@@ -38,7 +37,6 @@ We can run all tests with:
3837
3938
pytest tests
4039
41-
4240
Code Style
4341
~~~~~~~~~~
4442

@@ -50,7 +48,6 @@ manually with:
5048
5149
make lint
5250
53-
5451
If you need to make a commit that skips the ``pre-commit`` checks, you can do so with
5552
``git commit --no-verify``.
5653

@@ -74,7 +71,7 @@ a discussion, and doesn't necessarily need to be the final, finished submission.
7471
GitHub's documentation for working on pull requests is
7572
`available here <https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`_.
7673

77-
Once you've made a pull request take a look at the Circle CI build status in the
74+
Once you've made a pull request, take a look at the Circle CI build status in the
7875
GitHub interface and make sure all tests are passing. In general pull requests that
7976
do not pass the CI build yet won't get reviewed unless explicitly requested.
8077

@@ -100,10 +97,8 @@ Before releasing a new version, build and test the package that will be released
10097
.. code:: sh
10198
10299
git checkout main && git pull
103-
104100
make package-test
105101
106-
107102
This will build the package and install it in a temporary virtual environment. Follow
108103
the instructions to activate the venv and test whatever you think is important.
109104

@@ -113,7 +108,6 @@ You can also preview the release notes:
113108
114109
towncrier --draft
115110
116-
117111
Build the release notes
118112
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119113

@@ -136,7 +130,6 @@ After confirming that the release package looks okay, release a new version:
136130
137131
make release bump=$$VERSION_PART_TO_BUMP$$
138132
139-
140133
This command will:
141134

142135
- Bump the version number as specified in ``.pyproject.toml`` and ``setup.py``.

0 commit comments

Comments
 (0)