mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
@ -3,14 +3,14 @@ current_version = 0.1.0-alpha.0
|
||||
commit = True
|
||||
tag = True
|
||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<stage>[^.]*)\.(?P<devnum>\d+))?
|
||||
serialize =
|
||||
serialize =
|
||||
{major}.{minor}.{patch}-{stage}.{devnum}
|
||||
{major}.{minor}.{patch}
|
||||
|
||||
[bumpversion:part:stage]
|
||||
optional_value = stable
|
||||
first_value = stable
|
||||
values =
|
||||
values =
|
||||
alpha
|
||||
beta
|
||||
stable
|
||||
@ -18,6 +18,6 @@ values =
|
||||
[bumpversion:part:devnum]
|
||||
|
||||
[bumpversion:file:setup.py]
|
||||
search = version='{current_version}',
|
||||
replace = version='{new_version}',
|
||||
search = version="{current_version}",
|
||||
replace = version="{new_version}",
|
||||
|
||||
|
||||
@ -39,21 +39,15 @@ jobs:
|
||||
docs:
|
||||
<<: *common
|
||||
docker:
|
||||
- image: cimg/python:3.6
|
||||
- image: cimg/python:3.7
|
||||
environment:
|
||||
TOXENV: docs
|
||||
lint:
|
||||
<<: *common
|
||||
docker:
|
||||
- image: cimg/python:3.6
|
||||
- image: cimg/python:3.7
|
||||
environment:
|
||||
TOXENV: lint
|
||||
py36-core:
|
||||
<<: *common
|
||||
docker:
|
||||
- image: cimg/python:3.6
|
||||
environment:
|
||||
TOXENV: py36-core
|
||||
py37-core:
|
||||
<<: *common
|
||||
docker:
|
||||
@ -90,6 +84,8 @@ workflows:
|
||||
jobs:
|
||||
- docs
|
||||
- lint
|
||||
- py36-core
|
||||
- py37-core
|
||||
- py38-core
|
||||
- py39-core
|
||||
- py310-core
|
||||
- pypy3-core
|
||||
|
||||
9
Makefile
9
Makefile
@ -32,6 +32,7 @@ lint:
|
||||
|
||||
lint-roll:
|
||||
isort --recursive <MODULE_NAME> tests
|
||||
black {toxinidir}/<MODULE_NAME> {toxinidir}/tests setup.py
|
||||
$(MAKE) lint
|
||||
|
||||
test:
|
||||
@ -48,12 +49,14 @@ build-docs:
|
||||
|
||||
validate-docs:
|
||||
python ./newsfragments/validate_files.py
|
||||
towncrier --draft --version preview
|
||||
towncrier build --draft --version preview
|
||||
|
||||
docs: build-docs validate-docs
|
||||
check-docs: build-docs validate-docs
|
||||
|
||||
docs: check-docs
|
||||
open docs/_build/html/index.html
|
||||
|
||||
linux-docs: build-docs
|
||||
linux-docs: check-docs
|
||||
xdg-open docs/_build/html/index.html
|
||||
|
||||
check-bump:
|
||||
|
||||
169
docs/conf.py
169
docs/conf.py
@ -15,46 +15,46 @@
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
import os
|
||||
|
||||
DIR = os.path.dirname('__file__')
|
||||
with open (os.path.join(DIR, '../setup.py'), 'r') as f:
|
||||
DIR = os.path.dirname("__file__")
|
||||
with open(os.path.join(DIR, "../setup.py"), "r") as f:
|
||||
for line in f:
|
||||
if 'version=' in line:
|
||||
setup_version = line.split('\'')[1]
|
||||
if "version=" in line:
|
||||
setup_version = line.split('"')[1]
|
||||
break
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinx.ext.intersphinx',
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.doctest",
|
||||
"sphinx.ext.intersphinx",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ["_templates"]
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
source_suffix = ".rst"
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = '<PROJECT_NAME>'
|
||||
copyright = '2020, The Ethereum Foundation'
|
||||
project = "<PROJECT_NAME>"
|
||||
copyright = "2020, The Ethereum Foundation"
|
||||
|
||||
__version__ = setup_version
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
@ -62,176 +62,179 @@ __version__ = setup_version
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '.'.join(__version__.split('.')[:2])
|
||||
version = ".".join(__version__.split(".")[:2])
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = __version__
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
# language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = [
|
||||
'_build',
|
||||
'modules.rst',
|
||||
"_build",
|
||||
"modules.rst",
|
||||
]
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
pygments_style = "sphinx"
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
# keep_warnings = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
# html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = ["_static"]
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
# html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
# html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
# html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = '<MODULE_NAME>doc'
|
||||
htmlhelp_basename = "<MODULE_NAME>doc"
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', '<MODULE_NAME>.tex', '<PROJECT_NAME> Documentation',
|
||||
'The Ethereum Foundation', 'manual'),
|
||||
(
|
||||
"index",
|
||||
"<MODULE_NAME>.tex",
|
||||
"<PROJECT_NAME> Documentation",
|
||||
"The Ethereum Foundation",
|
||||
"manual",
|
||||
),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
@ -239,12 +242,17 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', '<MODULE_NAME>', '<PROJECT_NAME> Documentation',
|
||||
['The Ethereum Foundation'], 1)
|
||||
(
|
||||
"index",
|
||||
"<MODULE_NAME>",
|
||||
"<PROJECT_NAME> Documentation",
|
||||
["The Ethereum Foundation"],
|
||||
1,
|
||||
)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
@ -253,34 +261,41 @@ man_pages = [
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', '<PROJECT_NAME>', '<PROJECT_NAME> Documentation',
|
||||
'The Ethereum Foundation', '<PROJECT_NAME>', '<SHORT_DESCRIPTION>',
|
||||
'Miscellaneous'),
|
||||
(
|
||||
"index",
|
||||
"<PROJECT_NAME>",
|
||||
"<PROJECT_NAME> Documentation",
|
||||
"The Ethereum Foundation",
|
||||
"<PROJECT_NAME>",
|
||||
"<SHORT_DESCRIPTION>",
|
||||
"Miscellaneous",
|
||||
),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
# -- Intersphinx configuration ------------------------------------------------
|
||||
|
||||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3.6', None),
|
||||
"python": ("https://docs.python.org/3.10", None),
|
||||
}
|
||||
|
||||
# -- Doctest configuration ----------------------------------------
|
||||
|
||||
import doctest
|
||||
|
||||
doctest_default_flags = (0
|
||||
doctest_default_flags = (
|
||||
0
|
||||
| doctest.DONT_ACCEPT_TRUE_FOR_1
|
||||
| doctest.ELLIPSIS
|
||||
| doctest.IGNORE_EXCEPTION_DETAIL
|
||||
|
||||
@ -24,5 +24,5 @@ then open up the PR first and use the PR number for the newsfragment.
|
||||
|
||||
Note that the `towncrier` tool will automatically
|
||||
reflow your text, so don't try to do any fancy formatting. Run
|
||||
`towncrier --draft` to get a preview of what the release notes entry
|
||||
`towncrier build --draft` to get a preview of what the release notes entry
|
||||
will look like in the final release notes.
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
[pytest]
|
||||
addopts= -v --showlocals --durations 10
|
||||
python_paths= .
|
||||
xfail_strict=true
|
||||
|
||||
[pytest-watch]
|
||||
|
||||
66
setup.py
66
setup.py
@ -6,23 +6,24 @@ from setuptools import (
|
||||
)
|
||||
|
||||
extras_require = {
|
||||
'test': [
|
||||
"test": [
|
||||
"pytest>=6.2.5,<7",
|
||||
"pytest-xdist>=2.4.0,<3",
|
||||
"tox==3.14.6",
|
||||
],
|
||||
'lint': [
|
||||
"lint": [
|
||||
"flake8==3.7.9",
|
||||
"isort>=4.2.15,<5",
|
||||
"mypy==0.770",
|
||||
"pydocstyle>=5.0.0,<6",
|
||||
"black>=22,<23",
|
||||
],
|
||||
'doc': [
|
||||
"doc": [
|
||||
"Sphinx>=1.6.5,<2",
|
||||
"sphinx_rtd_theme>=0.1.9,<1",
|
||||
"towncrier>=21,<22",
|
||||
],
|
||||
'dev': [
|
||||
"dev": [
|
||||
"bumpversion>=0.5.3,<1",
|
||||
"pytest-watch>=4.1.0,<5",
|
||||
"wheel",
|
||||
@ -31,53 +32,52 @@ extras_require = {
|
||||
],
|
||||
}
|
||||
|
||||
extras_require['dev'] = (
|
||||
extras_require['dev'] + # noqa: W504
|
||||
extras_require['test'] + # noqa: W504
|
||||
extras_require['lint'] + # noqa: W504
|
||||
extras_require['doc']
|
||||
extras_require["dev"] = (
|
||||
extras_require["dev"]
|
||||
+ extras_require["test"]
|
||||
+ extras_require["lint"]
|
||||
+ extras_require["doc"]
|
||||
)
|
||||
|
||||
|
||||
with open('./README.md') as readme:
|
||||
with open("./README.md") as readme:
|
||||
long_description = readme.read()
|
||||
|
||||
|
||||
setup(
|
||||
name='<PYPI_NAME>',
|
||||
name="<PYPI_NAME>",
|
||||
# *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme
|
||||
version='0.1.0-alpha.0',
|
||||
version="0.1.0-alpha.0",
|
||||
description="""<PYPI_NAME>: <SHORT_DESCRIPTION>""",
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
author='The Ethereum Foundation',
|
||||
author_email='snakecharmers@ethereum.org',
|
||||
url='https://github.com/ethereum/<REPO_NAME>',
|
||||
long_description_content_type="text/markdown",
|
||||
author="The Ethereum Foundation",
|
||||
author_email="snakecharmers@ethereum.org",
|
||||
url="https://github.com/ethereum/<REPO_NAME>",
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
"eth-utils>=2,<3",
|
||||
],
|
||||
python_requires='>=3.6, <4',
|
||||
python_requires=">=3.7, <4",
|
||||
extras_require=extras_require,
|
||||
py_modules=['<MODULE_NAME>'],
|
||||
py_modules=["<MODULE_NAME>"],
|
||||
license="MIT",
|
||||
zip_safe=False,
|
||||
keywords='ethereum',
|
||||
keywords="ethereum",
|
||||
packages=find_packages(exclude=["tests", "tests.*"]),
|
||||
package_data={'<MODULE_NAME>': ['py.typed']},
|
||||
package_data={"<MODULE_NAME>": ["py.typed"]},
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Natural Language :: English',
|
||||
'Operating System :: MacOS',
|
||||
'Operating System :: POSIX',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Natural Language :: English",
|
||||
"Operating System :: MacOS",
|
||||
"Operating System :: POSIX",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
],
|
||||
)
|
||||
|
||||
6
tox.ini
6
tox.ini
@ -1,6 +1,6 @@
|
||||
[tox]
|
||||
envlist=
|
||||
py{36,37,38,39,310,py3}-core
|
||||
py{37,38,39,310,py3}-core
|
||||
lint
|
||||
docs
|
||||
|
||||
@ -23,10 +23,9 @@ ignore=
|
||||
usedevelop=True
|
||||
commands=
|
||||
core: pytest {posargs:tests/core}
|
||||
docs: make build-docs
|
||||
docs: make check-docs
|
||||
basepython =
|
||||
docs: python
|
||||
py36: python3.6
|
||||
py37: python3.7
|
||||
py38: python3.8
|
||||
py39: python3.9
|
||||
@ -45,3 +44,4 @@ commands=
|
||||
flake8 {toxinidir}/<MODULE_NAME> {toxinidir}/tests
|
||||
isort --recursive --check-only --diff {toxinidir}/<MODULE_NAME> {toxinidir}/tests
|
||||
pydocstyle --explain {toxinidir}/<MODULE_NAME> {toxinidir}/tests
|
||||
black --check {toxinidir}/<MODULE_NAME> {toxinidir}/tests setup.py
|
||||
|
||||
Reference in New Issue
Block a user