Misc Updates (#65)

* Tweaks to release process

* Drop python 3.6
This commit is contained in:
kclowes
2022-09-19 14:35:39 -06:00
committed by GitHub
parent 24c805c90d
commit 99af2f4d53
8 changed files with 144 additions and 131 deletions

View File

@ -18,6 +18,6 @@ values =
[bumpversion:part:devnum] [bumpversion:part:devnum]
[bumpversion:file:setup.py] [bumpversion:file:setup.py]
search = version='{current_version}', search = version="{current_version}",
replace = version='{new_version}', replace = version="{new_version}",

View File

@ -39,21 +39,15 @@ jobs:
docs: docs:
<<: *common <<: *common
docker: docker:
- image: cimg/python:3.6 - image: cimg/python:3.7
environment: environment:
TOXENV: docs TOXENV: docs
lint: lint:
<<: *common <<: *common
docker: docker:
- image: cimg/python:3.6 - image: cimg/python:3.7
environment: environment:
TOXENV: lint TOXENV: lint
py36-core:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: py36-core
py37-core: py37-core:
<<: *common <<: *common
docker: docker:
@ -90,6 +84,8 @@ workflows:
jobs: jobs:
- docs - docs
- lint - lint
- py36-core
- py37-core - py37-core
- py38-core
- py39-core
- py310-core
- pypy3-core - pypy3-core

View File

@ -32,6 +32,7 @@ lint:
lint-roll: lint-roll:
isort --recursive <MODULE_NAME> tests isort --recursive <MODULE_NAME> tests
black {toxinidir}/<MODULE_NAME> {toxinidir}/tests setup.py
$(MAKE) lint $(MAKE) lint
test: test:
@ -48,12 +49,14 @@ build-docs:
validate-docs: validate-docs:
python ./newsfragments/validate_files.py 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 open docs/_build/html/index.html
linux-docs: build-docs linux-docs: check-docs
xdg-open docs/_build/html/index.html xdg-open docs/_build/html/index.html
check-bump: check-bump:

View File

@ -19,11 +19,11 @@
import os import os
DIR = os.path.dirname('__file__') DIR = os.path.dirname("__file__")
with open (os.path.join(DIR, '../setup.py'), 'r') as f: with open(os.path.join(DIR, "../setup.py"), "r") as f:
for line in f: for line in f:
if 'version=' in line: if "version=" in line:
setup_version = line.split('\'')[1] setup_version = line.split('"')[1]
break break
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
@ -35,26 +35,26 @@ with open (os.path.join(DIR, '../setup.py'), 'r') as f:
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', "sphinx.ext.autodoc",
'sphinx.ext.doctest', "sphinx.ext.doctest",
'sphinx.ext.intersphinx', "sphinx.ext.intersphinx",
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ["_templates"]
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = ".rst"
# The encoding of source files. # The encoding of source files.
# source_encoding = 'utf-8-sig' # source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = "index"
# General information about the project. # General information about the project.
project = '<PROJECT_NAME>' project = "<PROJECT_NAME>"
copyright = '2020, The Ethereum Foundation' copyright = "2020, The Ethereum Foundation"
__version__ = setup_version __version__ = setup_version
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
@ -62,7 +62,7 @@ __version__ = setup_version
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '.'.join(__version__.split('.')[:2]) version = ".".join(__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = __version__ release = __version__
@ -79,8 +79,8 @@ release = __version__
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = [ exclude_patterns = [
'_build', "_build",
'modules.rst', "modules.rst",
] ]
# The reST default role (used for this markup: `text`) to use for all # The reST default role (used for this markup: `text`) to use for all
@ -99,7 +99,7 @@ exclude_patterns = [
# show_authors = False # show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # 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. # A list of ignored prefixes for module index sorting.
# modindex_common_prefix = [] # modindex_common_prefix = []
@ -112,7 +112,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # 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 # 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 # further. For a list of options available for each theme, see the
@ -140,7 +140,7 @@ html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here, # 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, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # 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 # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied
@ -189,7 +189,7 @@ html_static_path = ['_static']
# html_file_suffix = None # html_file_suffix = None
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = '<MODULE_NAME>doc' htmlhelp_basename = "<MODULE_NAME>doc"
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
@ -197,10 +197,8 @@ htmlhelp_basename = '<MODULE_NAME>doc'
latex_elements = { latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper', #'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt', #'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
#'preamble': '', #'preamble': '',
} }
@ -209,8 +207,13 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ 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 name of an image file (relative to this directory) to place at the top of
@ -239,8 +242,13 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ 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. # If true, show URL addresses after external links.
@ -253,9 +261,15 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
('index', '<PROJECT_NAME>', '<PROJECT_NAME> Documentation', (
'The Ethereum Foundation', '<PROJECT_NAME>', '<SHORT_DESCRIPTION>', "index",
'Miscellaneous'), "<PROJECT_NAME>",
"<PROJECT_NAME> Documentation",
"The Ethereum Foundation",
"<PROJECT_NAME>",
"<SHORT_DESCRIPTION>",
"Miscellaneous",
),
] ]
# Documents to append as an appendix to all manuals. # Documents to append as an appendix to all manuals.
@ -273,14 +287,15 @@ texinfo_documents = [
# -- Intersphinx configuration ------------------------------------------------ # -- Intersphinx configuration ------------------------------------------------
intersphinx_mapping = { intersphinx_mapping = {
'python': ('https://docs.python.org/3.6', None), "python": ("https://docs.python.org/3.10", None),
} }
# -- Doctest configuration ---------------------------------------- # -- Doctest configuration ----------------------------------------
import doctest import doctest
doctest_default_flags = (0 doctest_default_flags = (
0
| doctest.DONT_ACCEPT_TRUE_FOR_1 | doctest.DONT_ACCEPT_TRUE_FOR_1
| doctest.ELLIPSIS | doctest.ELLIPSIS
| doctest.IGNORE_EXCEPTION_DETAIL | doctest.IGNORE_EXCEPTION_DETAIL

View File

@ -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 Note that the `towncrier` tool will automatically
reflow your text, so don't try to do any fancy formatting. Run 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. will look like in the final release notes.

View File

@ -1,6 +1,5 @@
[pytest] [pytest]
addopts= -v --showlocals --durations 10 addopts= -v --showlocals --durations 10
python_paths= .
xfail_strict=true xfail_strict=true
[pytest-watch] [pytest-watch]

View File

@ -6,23 +6,24 @@ from setuptools import (
) )
extras_require = { extras_require = {
'test': [ "test": [
"pytest>=6.2.5,<7", "pytest>=6.2.5,<7",
"pytest-xdist>=2.4.0,<3", "pytest-xdist>=2.4.0,<3",
"tox==3.14.6", "tox==3.14.6",
], ],
'lint': [ "lint": [
"flake8==3.7.9", "flake8==3.7.9",
"isort>=4.2.15,<5", "isort>=4.2.15,<5",
"mypy==0.770", "mypy==0.770",
"pydocstyle>=5.0.0,<6", "pydocstyle>=5.0.0,<6",
"black>=22,<23",
], ],
'doc': [ "doc": [
"Sphinx>=1.6.5,<2", "Sphinx>=1.6.5,<2",
"sphinx_rtd_theme>=0.1.9,<1", "sphinx_rtd_theme>=0.1.9,<1",
"towncrier>=21,<22", "towncrier>=21,<22",
], ],
'dev': [ "dev": [
"bumpversion>=0.5.3,<1", "bumpversion>=0.5.3,<1",
"pytest-watch>=4.1.0,<5", "pytest-watch>=4.1.0,<5",
"wheel", "wheel",
@ -31,53 +32,52 @@ extras_require = {
], ],
} }
extras_require['dev'] = ( extras_require["dev"] = (
extras_require['dev'] + # noqa: W504 extras_require["dev"]
extras_require['test'] + # noqa: W504 + extras_require["test"]
extras_require['lint'] + # noqa: W504 + extras_require["lint"]
extras_require['doc'] + extras_require["doc"]
) )
with open('./README.md') as readme: with open("./README.md") as readme:
long_description = readme.read() long_description = readme.read()
setup( setup(
name='<PYPI_NAME>', name="<PYPI_NAME>",
# *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme # *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>""", description="""<PYPI_NAME>: <SHORT_DESCRIPTION>""",
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type="text/markdown",
author='The Ethereum Foundation', author="The Ethereum Foundation",
author_email='snakecharmers@ethereum.org', author_email="snakecharmers@ethereum.org",
url='https://github.com/ethereum/<REPO_NAME>', url="https://github.com/ethereum/<REPO_NAME>",
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
"eth-utils>=2,<3", "eth-utils>=2,<3",
], ],
python_requires='>=3.6, <4', python_requires=">=3.7, <4",
extras_require=extras_require, extras_require=extras_require,
py_modules=['<MODULE_NAME>'], py_modules=["<MODULE_NAME>"],
license="MIT", license="MIT",
zip_safe=False, zip_safe=False,
keywords='ethereum', keywords="ethereum",
packages=find_packages(exclude=["tests", "tests.*"]), packages=find_packages(exclude=["tests", "tests.*"]),
package_data={'<MODULE_NAME>': ['py.typed']}, package_data={"<MODULE_NAME>": ["py.typed"]},
classifiers=[ classifiers=[
'Development Status :: 3 - Alpha', "Development Status :: 3 - Alpha",
'Intended Audience :: Developers', "Intended Audience :: Developers",
'License :: OSI Approved :: MIT License', "License :: OSI Approved :: MIT License",
'Natural Language :: English', "Natural Language :: English",
'Operating System :: MacOS', "Operating System :: MacOS",
'Operating System :: POSIX', "Operating System :: POSIX",
'Programming Language :: Python :: 3', "Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.6', "Programming Language :: Python :: 3.7",
'Programming Language :: Python :: 3.7', "Programming Language :: Python :: 3.8",
'Programming Language :: Python :: 3.8', "Programming Language :: Python :: 3.9",
'Programming Language :: Python :: 3.9', "Programming Language :: Python :: 3.10",
'Programming Language :: Python :: 3.10', "Programming Language :: Python :: Implementation :: PyPy",
'Programming Language :: Python :: Implementation :: PyPy',
], ],
) )

View File

@ -1,6 +1,6 @@
[tox] [tox]
envlist= envlist=
py{36,37,38,39,310,py3}-core py{37,38,39,310,py3}-core
lint lint
docs docs
@ -23,10 +23,9 @@ ignore=
usedevelop=True usedevelop=True
commands= commands=
core: pytest {posargs:tests/core} core: pytest {posargs:tests/core}
docs: make build-docs docs: make check-docs
basepython = basepython =
docs: python docs: python
py36: python3.6
py37: python3.7 py37: python3.7
py38: python3.8 py38: python3.8
py39: python3.9 py39: python3.9
@ -45,3 +44,4 @@ commands=
flake8 {toxinidir}/<MODULE_NAME> {toxinidir}/tests flake8 {toxinidir}/<MODULE_NAME> {toxinidir}/tests
isort --recursive --check-only --diff {toxinidir}/<MODULE_NAME> {toxinidir}/tests isort --recursive --check-only --diff {toxinidir}/<MODULE_NAME> {toxinidir}/tests
pydocstyle --explain {toxinidir}/<MODULE_NAME> {toxinidir}/tests pydocstyle --explain {toxinidir}/<MODULE_NAME> {toxinidir}/tests
black --check {toxinidir}/<MODULE_NAME> {toxinidir}/tests setup.py