Skip to content

Commit

Permalink
template cleanup following initial merge with py-evm (ethereum#80)
Browse files Browse the repository at this point in the history
* template cleanup following initial merge with py-evm

* add flake8 pin comment

* correct license years

* add pin note to mypy
  • Loading branch information
pacrob committed May 1, 2023
1 parent 68d37fa commit 431db89
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
15 changes: 9 additions & 6 deletions .project-template/fill_template_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


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):
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Empty file.
1 change: 0 additions & 1 deletion newsfragments/validate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"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": [
Expand Down
Empty file removed tests/core/conftest.py
Empty file.
2 changes: 0 additions & 2 deletions tests/core/test_import.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@


def test_import():
import <MODULE_NAME> # noqa: F401

0 comments on commit 431db89

Please sign in to comment.