template cleanup following initial merge with py-evm (#80)

* template cleanup following initial merge with py-evm

* add flake8 pin comment

* correct license years

* add pin note to mypy
This commit is contained in:
Paul Robinson
2023-04-12 15:35:34 -06:00
committed by pacrob
parent 68d37fa50f
commit 431db89753
10 changed files with 22 additions and 18 deletions

View File

@ -19,7 +19,7 @@ common: &common
when: on_fail
- restore_cache:
keys:
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- run:
name: install dependencies
command: pip install --user tox
@ -33,7 +33,7 @@ common: &common
- ~/.cache/pip
- ~/.local
- ./eggs
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
jobs:
docs:

View File

@ -7,7 +7,7 @@ from pathlib import Path
def _find_files(project_root):
path_exclude_pattern = r"\.git($|\/)|venv|_build|\.tox"
path_exclude_pattern = r"\.git($|\/)|venv|_build"
file_exclude_pattern = r"fill_template_vars\.py|\.swp$"
filepaths = []
for dir_path, _dir_names, file_names in os.walk(project_root):
@ -22,11 +22,14 @@ def _find_files(project_root):
def _replace(pattern, replacement, project_root):
print(f"Replacing values: {pattern}")
for file in _find_files(project_root):
with open(file) as f:
content = f.read()
content = re.sub(pattern, replacement, content)
with open(file, "w") as f:
f.write(content)
try:
with open(file) as f:
content = f.read()
content = re.sub(pattern, replacement, content)
with open(file, "w") as f:
f.write(content)
except UnicodeDecodeError:
pass
def main():

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2020 The Ethereum Foundation
Copyright (c) 2019-2023 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

View File

@ -1,9 +1,10 @@
# <PROJECT_NAME>
[![Join the conversation on Discord](https://img.shields.io/discord/809793915578089484?color=blue&label=chat&logo=discord&logoColor=white)](https://discord.gg/GHryRvPB84)
[![Build Status](https://circleci.com/gh/ethereum/<REPO_NAME>.svg?style=shield)](https://circleci.com/gh/ethereum/<REPO_NAME>)
[![PyPI version](https://badge.fury.io/py/<PYPI_NAME>.svg)](https://badge.fury.io/py/<PYPI_NAME>)
[![Python versions](https://img.shields.io/pypi/pyversions/<PYPI_NAME>.svg)](https://pypi.python.org/pypi/<PYPI_NAME>)
[![Docs build](https://readthedocs.org/projects/<RTD_NAME>/badge/?version=latest)](http://<RTD_NAME>.readthedocs.io/en/latest/?badge=latest)
[![Docs build](https://readthedocs.org/projects/<RTD_NAME>/badge/?version=latest)](https://<RTD_NAME>.readthedocs.io/en/latest/?badge=latest)
<SHORT_DESCRIPTION>

View File

@ -3,7 +3,6 @@
# Towncrier silently ignores files that do not match the expected ending.
# We use this script to ensure we catch these as errors in CI.
import os
import pathlib
import sys

View File

@ -1,6 +1,9 @@
[pytest]
addopts= -v --showlocals --durations 10
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
timeout = 300
[pytest-watch]
runner= pytest --failed-first --maxfail=1 --no-success-flaky-report

View File

@ -11,11 +11,11 @@ extras_require = {
"pytest-xdist>=2.4.0",
],
"lint": [
"flake8==6.0.0",
"flake8-bugbear==23.3.23",
"flake8==6.0.0", # flake8 claims semver but adds new warnings at minor releases, leave it pinned.
"flake8-bugbear==23.3.23", # flake8-bugbear does not follow semver, leave it pinned.
"isort>=5.10.1",
"mypy==0.971",
"pydocstyle>=5.0.0",
"mypy==0.971", # mypy does not follow semver, leave it pinned.
"pydocstyle>=6.0.0",
"black>=22",
],
"doc": [

View File

View File

@ -1,4 +1,2 @@
def test_import():
import <MODULE_NAME> # noqa: F401