mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +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
|
||||
- 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:
|
||||
|
||||
@ -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():
|
||||
|
||||
2
LICENSE
2
LICENSE
@ -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
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
# <PROJECT_NAME>
|
||||
|
||||
[](https://discord.gg/GHryRvPB84)
|
||||
[](https://circleci.com/gh/ethereum/<REPO_NAME>)
|
||||
[](https://badge.fury.io/py/<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>
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
setup.py
8
setup.py
@ -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": [
|
||||
|
||||
@ -1,4 +1,2 @@
|
||||
|
||||
|
||||
def test_import():
|
||||
import <MODULE_NAME> # noqa: F401
|
||||
|
||||
Reference in New Issue
Block a user