mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
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:
@ -19,7 +19,7 @@ common: &common
|
|||||||
when: on_fail
|
when: on_fail
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
|
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
|
||||||
- run:
|
- run:
|
||||||
name: install dependencies
|
name: install dependencies
|
||||||
command: pip install --user tox
|
command: pip install --user tox
|
||||||
@ -33,7 +33,7 @@ common: &common
|
|||||||
- ~/.cache/pip
|
- ~/.cache/pip
|
||||||
- ~/.local
|
- ~/.local
|
||||||
- ./eggs
|
- ./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:
|
jobs:
|
||||||
docs:
|
docs:
|
||||||
|
|||||||
@ -7,7 +7,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
def _find_files(project_root):
|
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$"
|
file_exclude_pattern = r"fill_template_vars\.py|\.swp$"
|
||||||
filepaths = []
|
filepaths = []
|
||||||
for dir_path, _dir_names, file_names in os.walk(project_root):
|
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):
|
def _replace(pattern, replacement, project_root):
|
||||||
print(f"Replacing values: {pattern}")
|
print(f"Replacing values: {pattern}")
|
||||||
for file in _find_files(project_root):
|
for file in _find_files(project_root):
|
||||||
with open(file) as f:
|
try:
|
||||||
content = f.read()
|
with open(file) as f:
|
||||||
content = re.sub(pattern, replacement, content)
|
content = f.read()
|
||||||
with open(file, "w") as f:
|
content = re.sub(pattern, replacement, content)
|
||||||
f.write(content)
|
with open(file, "w") as f:
|
||||||
|
f.write(content)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
# <PROJECT_NAME>
|
# <PROJECT_NAME>
|
||||||
|
|
||||||
|
[](https://discord.gg/GHryRvPB84)
|
||||||
[](https://circleci.com/gh/ethereum/<REPO_NAME>)
|
[](https://circleci.com/gh/ethereum/<REPO_NAME>)
|
||||||
[](https://badge.fury.io/py/<PYPI_NAME>)
|
[](https://badge.fury.io/py/<PYPI_NAME>)
|
||||||
[](https://pypi.python.org/pypi/<PYPI_NAME>)
|
[](https://pypi.python.org/pypi/<PYPI_NAME>)
|
||||||
[](http://<RTD_NAME>.readthedocs.io/en/latest/?badge=latest)
|
[](https://<RTD_NAME>.readthedocs.io/en/latest/?badge=latest)
|
||||||
|
|
||||||
|
|
||||||
<SHORT_DESCRIPTION>
|
<SHORT_DESCRIPTION>
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
# Towncrier silently ignores files that do not match the expected ending.
|
# Towncrier silently ignores files that do not match the expected ending.
|
||||||
# We use this script to ensure we catch these as errors in CI.
|
# We use this script to ensure we catch these as errors in CI.
|
||||||
|
|
||||||
import os
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
addopts= -v --showlocals --durations 10
|
addopts= -v --showlocals --durations 10
|
||||||
xfail_strict=true
|
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]
|
[pytest-watch]
|
||||||
runner= pytest --failed-first --maxfail=1 --no-success-flaky-report
|
runner= pytest --failed-first --maxfail=1 --no-success-flaky-report
|
||||||
|
|||||||
8
setup.py
8
setup.py
@ -11,11 +11,11 @@ extras_require = {
|
|||||||
"pytest-xdist>=2.4.0",
|
"pytest-xdist>=2.4.0",
|
||||||
],
|
],
|
||||||
"lint": [
|
"lint": [
|
||||||
"flake8==6.0.0",
|
"flake8==6.0.0", # flake8 claims semver but adds new warnings at minor releases, leave it pinned.
|
||||||
"flake8-bugbear==23.3.23",
|
"flake8-bugbear==23.3.23", # flake8-bugbear does not follow semver, leave it pinned.
|
||||||
"isort>=5.10.1",
|
"isort>=5.10.1",
|
||||||
"mypy==0.971",
|
"mypy==0.971", # mypy does not follow semver, leave it pinned.
|
||||||
"pydocstyle>=5.0.0",
|
"pydocstyle>=6.0.0",
|
||||||
"black>=22",
|
"black>=22",
|
||||||
],
|
],
|
||||||
"doc": [
|
"doc": [
|
||||||
|
|||||||
@ -1,4 +1,2 @@
|
|||||||
|
|
||||||
|
|
||||||
def test_import():
|
def test_import():
|
||||||
import <MODULE_NAME> # noqa: F401
|
import <MODULE_NAME> # noqa: F401
|
||||||
|
|||||||
Reference in New Issue
Block a user