From a7955a560ea8f8c10694ecdd57a6b189086f1e9c Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:00:28 -0800 Subject: [PATCH 01/72] init --- .bumpversion.cfg | 23 ++++ .gitignore | 107 ++++++++++++++++ .travis.yml | 31 +++++ LICENSE | 21 ++++ Makefile | 54 ++++++++ README.md | 84 +++++++++++++ docs/conf.py | 274 +++++++++++++++++++++++++++++++++++++++++ docs/releases.rst | 7 ++ fill_template_vars.sh | 35 ++++++ pytest.ini | 7 ++ setup.py | 64 ++++++++++ tests/core/conftest.py | 0 tox.ini | 35 ++++++ 13 files changed, 742 insertions(+) create mode 100644 .bumpversion.cfg create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 docs/conf.py create mode 100644 docs/releases.rst create mode 100755 fill_template_vars.sh create mode 100644 pytest.ini create mode 100644 setup.py create mode 100644 tests/core/conftest.py create mode 100644 tox.ini diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..eefe4ad --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,23 @@ +[bumpversion] +current_version = 0.1.0-alpha.0 +commit = True +tag = True +parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-(?P[^.]*)\.(?P\d+))? +serialize = + {major}.{minor}.{patch}-{stage}.{devnum} + {major}.{minor}.{patch} + +[bumpversion:part:stage] +optional_value = stable +first_value = stable +values = + alpha + beta + stable + +[bumpversion:part:devnum] + +[bumpversion:file:setup.py] +search = version='{current_version}', +replace = version='{new_version}', + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c380203 --- /dev/null +++ b/.gitignore @@ -0,0 +1,107 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +.eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 +venv* + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +docs/_build +docs/modules.rst +docs/web3.* + +# Blockchain +chains + +# Hypothese Property base testing +.hypothesis + +# tox/pytest cache +.cache + +# Test output logs +logs +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +# VIM temp files +*.swp + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..72be81d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +sudo: false +language: python +dist: trusty +matrix: + include: + # + # Python 3.5 testing + # + # lint + - python: "3.5" + env: TOX_POSARGS="-e lint" + # core + - python: "3.5" + env: TOX_POSARGS="-e py35-core" + # + # Python 3.6 testing + # + # core + - python: "3.6" + env: TOX_POSARGS="-e py36-core" +cache: + - pip: true +install: + - travis_retry pip install pip setuptools --upgrade + - travis_retry pip install tox +before_script: + - python --version + - pip --version + - pip freeze +script: + - tox $TOX_POSARGS diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1b7a2b5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Jason Carver + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b842465 --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +.PHONY: clean-pyc clean-build docs + +help: + @echo "clean-build - remove build artifacts" + @echo "clean-pyc - remove Python file artifacts" + @echo "lint - check style with flake8" + @echo "test - run tests quickly with the default Python" + @echo "testall - run tests on every Python version with tox" + @echo "release - package and upload a release" + @echo "dist - package" + +clean: clean-build clean-pyc + +clean-build: + rm -fr build/ + rm -fr dist/ + rm -fr *.egg-info + +clean-pyc: + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + +lint: + tox -elint + +test: + py.test tests + +test-all: + tox + +build-docs: + sphinx-apidoc -o docs/ . setup.py "*conftest*" + $(MAKE) -C docs clean + $(MAKE) -C docs html + +docs: build-docs + open docs/_build/html/index.html + +linux-docs: build-docs + xdg-open docs/_build/html/index.html + +release: clean + CURRENT_SIGN_SETTING=$(git config commit.gpgSign) + git config commit.gpgSign true + bumpversion $(bump) + git push && git push --tags + python setup.py sdist bdist_wheel upload + git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" + +dist: clean + python setup.py sdist bdist_wheel + ls -l dist diff --git a/README.md b/README.md new file mode 100644 index 0000000..e29c4d9 --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +# + +[![Join the chat at https://gitter.im/ethereum/](https://badges.gitter.im/ethereum/.svg)](https://gitter.im/ethereum/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +[![Build Status](https://travis-ci.org/ethereum/.png)](https://travis-ci.org/ethereum/) + + + + +* Python 3.5+ support + +Read more in the [documentation on ReadTheDocs](http://.readthedocs.io/). [View the change log on Github](docs/releases.rst). + +## Quickstart + +```sh +pip install +``` + +## Developer setup + +If you would like to hack on , set up your dev environment with: + +```sh + +git clone git@github.com:ethereum/.git +cd +virtualenv -p python3 venv +. venv/bin/activate +pip install -e .[dev] +``` + +### Testing Setup + +During development, you might like to have tests run on every file save. + +Show flake8 errors on file change: + +```sh +# Test flake8 +when-changed -v -s -r -1 / tests/ -c "clear; flake8 tests && echo 'flake8 success' || echo 'error'" +``` + +Run multi-process tests in one command, but without color: + +```sh +# in the project root: +pytest --numprocesses=4 --looponfail --maxfail=1 +# the same thing, succinctly: +pytest -n 4 -f --maxfail=1 +``` + +Run in one thread, with color and desktop notifications: + +```sh +cd venv +ptw --onfail "notify-send -t 5000 'Test failure ⚠⚠⚠⚠⚠' 'python 3 test on failed'" ../tests ../ +``` + +### Release setup + +For Debian-like systems: +``` +apt install pandoc +``` + +To release a new version: + +```sh +make release bump=$$VERSION_PART_TO_BUMP$$ +``` + +#### How to bumpversion + +The version format for this repo is `{major}.{minor}.{patch}` for stable, and +`{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta). + +To issue the next version in line, specify which part to bump, +like `make release bump=minor` or `make release bump=devnum`. + +If you are in a beta version, `make release bump=stage` will switch to a stable. + +To issue an unstable version when the current version is stable, specify the +new version explicitly, like `make release bump="--new-version 4.0.0-alpha.1 devnum"` diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..77bcb7e --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,274 @@ +# -*- coding: utf-8 -*- +# +# documentation build configuration file, created by +# sphinx-quickstart on Thu Oct 16 20:43:24 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# 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('.')) + +import os + +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] + break + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#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.intersphinx'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = '' +copyright = '2018, Jason Carver, Piper Merriam' + +__version__ = setup_version +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +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 + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#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', + '.rst', + 'modules.rst', +] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#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 + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#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' + +# 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 = {} + +# 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 +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#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 + +# 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 + +# 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'] + +# 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 = [] + +# 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' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = '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': '', +} + +# 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', '.tex', ' Documentation', + 'Jason Carver', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', '', ' Documentation', + ['Jason Carver'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', '', ' Documentation', + 'Jason Carver', '', '', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + +# -- Intersphinx configuration ------------------------------------------------ + +intersphinx_mapping = { + 'python': ('https://docs.python.org/3.5', None), +} diff --git a/docs/releases.rst b/docs/releases.rst new file mode 100644 index 0000000..ec4804d --- /dev/null +++ b/docs/releases.rst @@ -0,0 +1,7 @@ +Release Notes +============= + +v0.1.0-alpha.1 +------------- + +- Launched repository, claimed names for pip, RTD, github, etc diff --git a/fill_template_vars.sh b/fill_template_vars.sh new file mode 100755 index 0000000..ecbdcb0 --- /dev/null +++ b/fill_template_vars.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +# List of all non-executable files +TEMPLATE_FILES=$(find . ! -perm -u=x -type f) + +echo "What is your python module name?" +read MODULE_NAME + +echo "What is your pypi package name? (default: $MODULE_NAME)" +read PYPI_INPUT +PYPI_NAME=${PYPI_INPUT:-$MODULE_NAME} + +echo "What is your github project name? (default: $PYPI_NAME)" +read REPO_INPUT +REPO_NAME=${REPO_INPUT:-$PYPI_NAME} + +echo "What is your readthedocs.org project name? (default: $PYPI_NAME)" +read RTD_INPUT +RTD_NAME=${RTD_INPUT:-$PYPI_NAME} + +echo "What is your project name (ex: at the top of the README)? (default: $REPO_NAME)" +read PROJECT_INPUT +PROJECT_NAME=${PROJECT_INPUT:-$REPO_NAME} + +echo "What is a one-liner describing the project?" +read SHORT_DESCRIPTION + +sed -i "s//$MODULE_NAME/g" $TEMPLATE_FILES +sed -i "s//$PYPI_NAME/g" $TEMPLATE_FILES +sed -i "s//$REPO_NAME/g" $TEMPLATE_FILES +sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..d53de3a --- /dev/null +++ b/pytest.ini @@ -0,0 +1,7 @@ +[pytest] +addopts= -v --showlocals --durations 10 +python_paths= . +xfail_strict=true + +[pytest-watch] +runner= py.test --failed-first --maxfail=1 --no-success-flaky-report diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4882a64 --- /dev/null +++ b/setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from setuptools import ( + setup, + find_packages, +) + +extras_require={ + 'test': [ + "pytest==3.3.2", + "tox>=2.9.1,<3", + ], + 'lint': [ + "flake8==3.4.1", + "isort>=4.2.15,<5", + ], + 'document': [ + "Sphinx>=1.6.5,<2", + "sphinx_rtd_theme>=0.1.9", + ], + 'dev': [ + "bumpversion>=0.5.3,<1", + "pytest-xdist", + "wheel", + ], +} + +extras_require['dev'] = ( + extras_require['dev'] + + extras_require['test'] + + extras_require['lint'] + + extras_require['document'] +) + +setup( + name='', + # *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme + version='0.1.0-alpha.1', + description=""": """, + long_description_markdown_filename='README.md', + author='Jason Carver', + author_email='ethcalibur+pip@gmail.com', + url='https://github.com/ethereum/', + include_package_data=True, + install_requires=[ + "eth-utils>=0.7.4,<1.0.0", + ], + setup_requires=['setuptools-markdown'], + extras_require=extras_require, + py_modules=[''], + license="MIT", + zip_safe=False, + keywords='ethereum', + packages=find_packages(exclude=["tests", "tests.*"]), + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], +) diff --git a/tests/core/conftest.py b/tests/core/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..0277275 --- /dev/null +++ b/tox.ini @@ -0,0 +1,35 @@ +[tox] +envlist= + py{35,36}-core + lint + +[isort] +combine_as_imports=True +force_sort_within_sections=True +include_trailing_comma=True +known_standard_library=pytest +known_first_party= +line_length=21 +multi_line_output=3 +use_parentheses=True + +[flake8] +max-line-length= 100 +exclude= venv*,.tox,docs,build +ignore= + +[testenv] +usedevelop=True +commands= + core: py.test {posargs:tests/core} +basepython = + py35: python3.5 + py36: python3.6 +extras=test + +[testenv:lint] +basepython=python +extras=lint +commands= + flake8 {toxinidir}/ {toxinidir}/tests + isort --recursive --check-only --diff {toxinidir}/ {toxinidir}/tests From 3d87ff715396b8a9cdfc9d8f13b71c4e0dd2dace Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:24:08 -0800 Subject: [PATCH 02/72] Replace all template vars --- fill_template_vars.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index ecbdcb0..236733a 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -32,4 +32,6 @@ read SHORT_DESCRIPTION sed -i "s//$MODULE_NAME/g" $TEMPLATE_FILES sed -i "s//$PYPI_NAME/g" $TEMPLATE_FILES sed -i "s//$REPO_NAME/g" $TEMPLATE_FILES +sed -i "s//$RTD_NAME/g" $TEMPLATE_FILES +sed -i "s//$PROJECT_NAME/g" $TEMPLATE_FILES sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES From cdba56a29525ba9c4ba5e82dcb7901cdc3bccd9a Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:24:31 -0800 Subject: [PATCH 03/72] skip replacing variables inside .git/* files --- fill_template_vars.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 236733a..d4dba88 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -5,7 +5,7 @@ set -o nounset set -o pipefail # List of all non-executable files -TEMPLATE_FILES=$(find . ! -perm -u=x -type f) +TEMPLATE_FILES=$(find . ! -perm -u=x -type f | grep -v "\.git") echo "What is your python module name?" read MODULE_NAME From 9cdfd649d581c20939f90cb549c28c6b7e03dae8 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:31:02 -0800 Subject: [PATCH 04/72] create empty module with supplied name --- fill_template_vars.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index d4dba88..a0f9b90 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -35,3 +35,6 @@ sed -i "s//$REPO_NAME/g" $TEMPLATE_FILES sed -i "s//$RTD_NAME/g" $TEMPLATE_FILES sed -i "s//$PROJECT_NAME/g" $TEMPLATE_FILES sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES + +mkdir $MODULE_NAME +touch $MODULE_NAME/__init__.py From 4a8b7b06afca9a9d0d533e76ba1cca24788244b7 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:33:03 -0800 Subject: [PATCH 05/72] shorten extra name for documentation install --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4882a64..181033e 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ extras_require={ "flake8==3.4.1", "isort>=4.2.15,<5", ], - 'document': [ + 'doc': [ "Sphinx>=1.6.5,<2", "sphinx_rtd_theme>=0.1.9", ], @@ -29,7 +29,7 @@ extras_require['dev'] = ( extras_require['dev'] + extras_require['test'] + extras_require['lint'] - + extras_require['document'] + + extras_require['doc'] ) setup( From ca670f43a4be6b2d6f326e07419c6b07c2167db1 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 16:35:36 -0800 Subject: [PATCH 06/72] start at devnum 0 so the first bump goes to 1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 181033e..fbef344 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ extras_require['dev'] = ( setup( name='', # *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme - version='0.1.0-alpha.1', + version='0.1.0-alpha.0', description=""": """, long_description_markdown_filename='README.md', author='Jason Carver', From 1d4e19d929e6e2845a4da76d3bb2114d9abe932e Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 24 Jan 2018 17:04:52 -0800 Subject: [PATCH 07/72] add docs index --- docs/index.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/index.rst diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..bddbdbe --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ + +======= + + + +Contents +-------- + +.. toctree:: + :maxdepth: 1 + + releases + + +Indices and tables +------------------ + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From 3290919ff1cd31aa1c6c491f347335ffc7d93f73 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Thu, 25 Jan 2018 15:51:14 -0800 Subject: [PATCH 08/72] add github templates for issues and pull requests --- .github/ISSUE_TEMPLATE.md | 38 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..5ff4880 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,38 @@ + _If this is a bug report, please fill in the following sections. +If this is a feature request, delete and describe what you would like with examples._ + +## What was wrong? + +### Code that produced the error + +```py +CODE_TO_REPRODUCE +``` + +### Full error output + +```sh +ERROR_HERE +``` + +### Expected Result + +_This section may be deleted if the expectation is "don't crash"._ + +```sh +EXPECTED_RESULT +``` + +### Environment + +```sh +# run this: +$ python -m eth_utils + +# then copy the output here: +OUTPUT_HERE +``` + +## How can it be fixed? + +Fill this section in if you know how this could or should be fixed. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..76ef5ac --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +## What was wrong? + +Issue # + +## How was it fixed? + +Summary of approach. + +#### Cute Animal Picture + +![put a cute animal picture link inside the parentheses]() From 2938497f022a90e44d7589f19f5d960c5d1fa4c9 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Thu, 25 Jan 2018 17:21:42 -0800 Subject: [PATCH 09/72] Link to dev tactical manual --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e29c4d9..709130c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,18 @@ pip install ## Developer setup -If you would like to hack on , set up your dev environment with: +If you would like to hack on , please check out the +[Ethereum Development Tactical Manual](https://github.com/pipermerriam/ethereum-dev-tactical-manual) +for information on how we do: + +- Testing +- Pull Requests +- Code Style +- Documentation + +### Development Environment Setup + +You can set up your dev environment with: ```sh From 76bfefa66c987ffb8004c234190aebda1d145065 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Fri, 26 Jan 2018 19:01:36 -0800 Subject: [PATCH 10/72] add `make lint-roll` to locally auto de-lint --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index b842465..1a7f8c6 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ clean-pyc: lint: tox -elint +lint-roll: lint + isort --recursive tests + test: py.test tests From 195249cdabb2f097baed392c0ed37e0aca549768 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 30 Jan 2018 10:46:34 -0800 Subject: [PATCH 11/72] docs cleanup: Makefile, conf, warnings --- docs/Makefile | 177 ++++++++++++++++++++ docs/_static/.suppress-sphinx-build-warning | 0 docs/conf.py | 1 - docs/index.rst | 6 +- docs/releases.rst | 2 +- 5 files changed, 181 insertions(+), 5 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/_static/.suppress-sphinx-build-warning diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..3280093 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/web3.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/web3.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/web3" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/web3" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/_static/.suppress-sphinx-build-warning b/docs/_static/.suppress-sphinx-build-warning new file mode 100644 index 0000000..e69de29 diff --git a/docs/conf.py b/docs/conf.py index 77bcb7e..d2294f7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,7 +76,6 @@ release = __version__ # directories to ignore when looking for source files. exclude_patterns = [ '_build', - '.rst', 'modules.rst', ] diff --git a/docs/index.rst b/docs/index.rst index bddbdbe..b3598a4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -======= +============================== @@ -7,8 +7,9 @@ Contents -------- .. toctree:: - :maxdepth: 1 + :maxdepth: 3 + releases @@ -17,4 +18,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` -* :ref:`search` diff --git a/docs/releases.rst b/docs/releases.rst index ec4804d..6fdd6c9 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -2,6 +2,6 @@ Release Notes ============= v0.1.0-alpha.1 -------------- +-------------- - Launched repository, claimed names for pip, RTD, github, etc From 109a0866ed06f97e2f7b34d1090e36dd6cbf499a Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 30 Jan 2018 15:17:03 -0800 Subject: [PATCH 12/72] requirements.txt: best way to build on readthedocs --- requirements-docs.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements-docs.txt diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 0000000..1b49b74 --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1 @@ +[doc] From 96a371705b810bd036817ac33c1aed8c045644d1 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 30 Jan 2018 15:17:50 -0800 Subject: [PATCH 13/72] bugfix: run tox -elint *after* isort otherwise tox fails, and the auto-lint never runs --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a7f8c6..97eab7c 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,9 @@ clean-pyc: lint: tox -elint -lint-roll: lint +lint-roll: isort --recursive tests + $(make) lint test: py.test tests From 0e57d8e262a1c46d5191e7fd31fd17026bdf3e2c Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 30 Jan 2018 15:18:59 -0800 Subject: [PATCH 14/72] when do you not want ipython in local dev? never --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index fbef344..518ee26 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ extras_require={ "bumpversion>=0.5.3,<1", "pytest-xdist", "wheel", + "ipython", ], } From 9a7d72a816dc5352ace5916a4b3ea3991e146b1c Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 30 Jan 2018 15:37:40 -0800 Subject: [PATCH 15/72] pytest default settings, plus pytest-watch --- pytest.ini | 1 - setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index d53de3a..9cc5a18 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,6 @@ [pytest] addopts= -v --showlocals --durations 10 python_paths= . -xfail_strict=true [pytest-watch] runner= py.test --failed-first --maxfail=1 --no-success-flaky-report diff --git a/setup.py b/setup.py index 518ee26..a89f4ac 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ extras_require={ 'dev': [ "bumpversion>=0.5.3,<1", "pytest-xdist", + "pytest-watch>=4.1.0,<5", "wheel", "ipython", ], From cb71fb443028771e35370a4dd0bfbe848e694dda Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Thu, 1 Feb 2018 09:42:48 -0800 Subject: [PATCH 16/72] add circle ci config --- .circleci/config.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7384eab --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,51 @@ +version: 2.0 + +# heavily inspired by https://raw.githubusercontent.com/pinax/pinax-wiki/6bd2a99ab6f702e300d708532a6d1d9aa638b9f8/.circleci/config.yml + +common: &common + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - run: + name: install dependencies + command: pip install --user tox + - run: + name: run tox + command: ~/.local/bin/tox + - save_cache: + paths: + - .tox + - ~/.cache/pip + - ~/.local + - ./eggs + key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + +jobs: + lint: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV: lint + py35-core: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV: py35-core + py36-core: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV: py36-core +workflows: + version: 2 + test: + jobs: + - lint + - py35-core + - py36-core From f7b0f07b45798548550a3dd90444b350b9b95ff7 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Thu, 1 Feb 2018 13:07:33 -0800 Subject: [PATCH 17/72] fixups: rm template filler, xfail strict, make bug --- Makefile | 2 +- fill_template_vars.sh | 3 +++ pytest.ini | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 97eab7c..3bf2403 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ lint: lint-roll: isort --recursive tests - $(make) lint + $(MAKE) lint test: py.test tests diff --git a/fill_template_vars.sh b/fill_template_vars.sh index a0f9b90..17f2503 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -38,3 +38,6 @@ sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES mkdir $MODULE_NAME touch $MODULE_NAME/__init__.py + +# template filler is no longer needed, delete it +rm "$0" diff --git a/pytest.ini b/pytest.ini index 9cc5a18..d53de3a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,7 @@ [pytest] addopts= -v --showlocals --durations 10 python_paths= . +xfail_strict=true [pytest-watch] runner= py.test --failed-first --maxfail=1 --no-success-flaky-report From 4bb4f720db893c4e3f44c22d4693869ed934ef6d Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 15:33:04 -0800 Subject: [PATCH 18/72] add badges: pypi version and pythons supported --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 709130c..228615f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # [![Join the chat at https://gitter.im/ethereum/](https://badges.gitter.im/ethereum/.svg)](https://gitter.im/ethereum/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - [![Build Status](https://travis-ci.org/ethereum/.png)](https://travis-ci.org/ethereum/) +[![PyPI version](https://badge.fury.io/py/.svg)](https://badge.fury.io/py/) +[![Python versions](https://img.shields.io/pypi/pyversions/.svg)](https://pypi.python.org/pypi/) From b825c36defd58715d02a0dd8b5eb47f52c2795d9 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 15:42:21 -0800 Subject: [PATCH 19/72] docs: show badge, link to release notes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 228615f..d478ded 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,14 @@ [![Build Status](https://travis-ci.org/ethereum/.png)](https://travis-ci.org/ethereum/) [![PyPI version](https://badge.fury.io/py/.svg)](https://badge.fury.io/py/) [![Python versions](https://img.shields.io/pypi/pyversions/.svg)](https://pypi.python.org/pypi/) +[![Docs build](https://readthedocs.org/projects//badge/?version=latest)](http://.readthedocs.io/en/latest/?badge=latest) * Python 3.5+ support -Read more in the [documentation on ReadTheDocs](http://.readthedocs.io/). [View the change log on Github](docs/releases.rst). +Read more in the [documentation on ReadTheDocs](http://.readthedocs.io/). [View the change log](http://.readthedocs.io/en/latest/releases.html). ## Quickstart From 7bfa2ac5d45d274ac7e4a50415cf02eee140cdd3 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 15:52:41 -0800 Subject: [PATCH 20/72] add pypy3 as a supported environment, by default --- .travis.yml | 6 ++++++ setup.py | 1 + tox.ini | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 72be81d..42b63c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,12 @@ matrix: # core - python: "3.6" env: TOX_POSARGS="-e py36-core" + # + # pypy3 testing + # + # core + - python: "pypy3" + env: TOX_POSARGS="-e pypy3-core" cache: - pip: true install: diff --git a/setup.py b/setup.py index a89f4ac..a59d9ee 100644 --- a/setup.py +++ b/setup.py @@ -62,5 +62,6 @@ setup( 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation :: PyPy3', ], ) diff --git a/tox.ini b/tox.ini index 0277275..9b1727e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist= - py{35,36}-core + py{35,36,py3}-core lint [isort] @@ -25,6 +25,7 @@ commands= basepython = py35: python3.5 py36: python3.6 + pypy3: pypy3 extras=test [testenv:lint] From 6abf0667793022b1b077f6eea69c4e706cc3513d Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 15:56:11 -0800 Subject: [PATCH 21/72] add module import test --- tests/core/test_import.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/core/test_import.py diff --git a/tests/core/test_import.py b/tests/core/test_import.py new file mode 100644 index 0000000..2243d05 --- /dev/null +++ b/tests/core/test_import.py @@ -0,0 +1,4 @@ + + +def test_import(): + import From 1695a3b3262f183dbee81229a7cbd326edc5c210 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 16:04:41 -0800 Subject: [PATCH 22/72] bugfix: setuptools reference to pypy --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a59d9ee..4eeb8d7 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,6 @@ setup( 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: Implementation :: PyPy3', + 'Programming Language :: Python :: Implementation :: PyPy', ], ) From beb1b10ee893ee68b188048dba8210ebcbd0506c Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 6 Feb 2018 16:10:25 -0800 Subject: [PATCH 23/72] silence flake8 error during module import test --- tests/core/test_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_import.py b/tests/core/test_import.py index 2243d05..f146ae7 100644 --- a/tests/core/test_import.py +++ b/tests/core/test_import.py @@ -1,4 +1,4 @@ def test_import(): - import + import # noqa: F401 From a9d9fec258284bc01524cd59d6d18629cca523cd Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 11:14:11 -0800 Subject: [PATCH 24/72] add doctest by default --- Makefile | 1 + docs/conf.py | 17 ++++++++++++++++- tox.ini | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3bf2403..bb5c6a0 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ build-docs: sphinx-apidoc -o docs/ . setup.py "*conftest*" $(MAKE) -C docs clean $(MAKE) -C docs html + $(MAKE) -C docs doctest docs: build-docs open docs/_build/html/index.html diff --git a/docs/conf.py b/docs/conf.py index d2294f7..a74a977 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,7 +34,11 @@ with open (os.path.join(DIR, '../setup.py'), 'r') as f: # 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.intersphinx'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -271,3 +275,14 @@ texinfo_documents = [ intersphinx_mapping = { 'python': ('https://docs.python.org/3.5', None), } + +# -- Doctest configuration ---------------------------------------- + +import doctest + +doctest_default_flags = (0 + | doctest.DONT_ACCEPT_TRUE_FOR_1 + | doctest.ELLIPSIS + | doctest.IGNORE_EXCEPTION_DETAIL + | doctest.NORMALIZE_WHITESPACE +) diff --git a/tox.ini b/tox.ini index 9b1727e..162657f 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist= py{35,36,py3}-core lint + doctest [isort] combine_as_imports=True @@ -22,11 +23,14 @@ ignore= usedevelop=True commands= core: py.test {posargs:tests/core} + doctest: make -C {toxinidir}/docs doctest basepython = py35: python3.5 py36: python3.6 pypy3: pypy3 -extras=test +extras= + test + doctest: doc [testenv:lint] basepython=python From a1ba89ed413b1f6ea2691f14948d0ef3cc03fbf0 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 11:18:47 -0800 Subject: [PATCH 25/72] every tox environment should have a basic python --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 162657f..f28e277 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,7 @@ commands= core: py.test {posargs:tests/core} doctest: make -C {toxinidir}/docs doctest basepython = + python py35: python3.5 py36: python3.6 pypy3: pypy3 @@ -33,7 +34,6 @@ extras= doctest: doc [testenv:lint] -basepython=python extras=lint commands= flake8 {toxinidir}/ {toxinidir}/tests From 37d978c5b3c1de029e624b1335a7d0a3df96c045 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 11:24:37 -0800 Subject: [PATCH 26/72] squash warning about using make inside tox --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index f28e277..8328bc5 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,7 @@ basepython = extras= test doctest: doc +whitelest_externals=make [testenv:lint] extras=lint From ecb3731cbe45acfc762443ff9e702e040b642b08 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 11:26:47 -0800 Subject: [PATCH 27/72] can't override python that way in tox --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8328bc5..e7e9713 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ commands= core: py.test {posargs:tests/core} doctest: make -C {toxinidir}/docs doctest basepython = - python + doctest: python py35: python3.5 py36: python3.6 pypy3: pypy3 @@ -35,6 +35,7 @@ extras= whitelest_externals=make [testenv:lint] +basepython=python extras=lint commands= flake8 {toxinidir}/ {toxinidir}/tests From 60b026e3edfc75d696ffb896312f9d35f4e8ab17 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 11:40:35 -0800 Subject: [PATCH 28/72] add doctest run to travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 42b63c9..5600ec0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,9 @@ matrix: # lint - python: "3.5" env: TOX_POSARGS="-e lint" + # doctest + - python: "3.5" + env: TOX_POSARGS="-e doctest" # core - python: "3.5" env: TOX_POSARGS="-e py35-core" From 58902032c755c9a61ec1a32f574a9a655db68490 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 14:37:30 -0800 Subject: [PATCH 29/72] add doctest run to circle-ci --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7384eab..2ba8898 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,12 @@ common: &common key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} jobs: + doctest: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV: doctest lint: <<: *common docker: @@ -46,6 +52,7 @@ workflows: version: 2 test: jobs: + - doctest - lint - py35-core - py36-core From b3461e9c934bcf017c90744192f218d2ab0a504c Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 7 Feb 2018 14:40:01 -0800 Subject: [PATCH 30/72] tox.ini bugfix: whitelist make --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e7e9713..34a66b4 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ basepython = extras= test doctest: doc -whitelest_externals=make +whitelist_externals=make [testenv:lint] basepython=python From f0e0b10cc5f9a6086c249074d91c0ca18f63a575 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 20 Feb 2018 18:09:58 -0800 Subject: [PATCH 31/72] add pypy3 as a default test environment in circle --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ba8898..821d1b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,12 @@ jobs: - image: circleci/python:3.6 environment: TOXENV: py36-core + pypy3-core: + <<: *common + docker: + - image: pypy + environment: + TOXENV: pypy3-core workflows: version: 2 test: @@ -56,3 +62,4 @@ workflows: - lint - py35-core - py36-core + - pypy3-core From 974fae3a2b6a414dab8eafc4aea2f968a6d5c8d7 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 20 Feb 2018 18:10:30 -0800 Subject: [PATCH 32/72] travis config: use latest pypy3 container --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5600ec0..78c56a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ matrix: # pypy3 testing # # core - - python: "pypy3" + - python: "pypy3.5" env: TOX_POSARGS="-e pypy3-core" cache: - pip: true From 588b1af6ee556cfd39b5681383c84b326b153a60 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 28 Feb 2018 10:29:45 -0800 Subject: [PATCH 33/72] Makefile: deploy to upstream --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bb5c6a0..5b0f799 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ release: clean CURRENT_SIGN_SETTING=$(git config commit.gpgSign) git config commit.gpgSign true bumpversion $(bump) - git push && git push --tags + git push upstream && git push upstream --tags python setup.py sdist bdist_wheel upload git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" From 031b1175f4c03ead623b54067fbc95485de17966 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 28 Feb 2018 14:20:39 -0800 Subject: [PATCH 34/72] force tox to rebuild in circle runs --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 821d1b4..2393a06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ common: &common command: pip install --user tox - run: name: run tox - command: ~/.local/bin/tox + command: ~/.local/bin/tox -r - save_cache: paths: - .tox From 84ecb7effc827b9f070b5eb6d50e4e7a341d078d Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 10 Apr 2018 10:16:17 -0700 Subject: [PATCH 35/72] require python 3.5 during setup (and reject py4) --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4eeb8d7..4308294 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,7 @@ setup( "eth-utils>=0.7.4,<1.0.0", ], setup_requires=['setuptools-markdown'], + python_requires='>=3.5, <4', extras_require=extras_require, py_modules=[''], license="MIT", From 30473b3ff54da0b6f06e7cd761fd9ec40f6651f1 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 19 Apr 2018 16:31:48 -0600 Subject: [PATCH 36/72] Make Circle CI test against merge with PR base --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2393a06..7c636af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,22 @@ common: &common working_directory: ~/repo steps: - checkout + - run: + name: merge pull request base + command: | + if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then + PR_INFO_URL=https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER + + PR_BASE_BRANCH=$(curl -L "$PR_INFO_URL" | python -c 'import json, sys; obj = json.load(sys.stdin); sys.stdout.write(obj["base"]["ref"])') + git fetch origin +"$PR_BASE_BRANCH":circleci/pr-base + + # We need these config values or git complains when creating the + # merge commit + git config --global user.name "Circle CI" + git config --global user.email "circleci@example.com" + + git merge --no-edit circleci/pr-base + fi - restore_cache: keys: - cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} From f7535eb99204e2c691aa6b330e5672caa29a29c0 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sun, 22 Apr 2018 01:34:42 -0600 Subject: [PATCH 37/72] Add circle ci status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d478ded..ac1ee8b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # [![Join the chat at https://gitter.im/ethereum/](https://badges.gitter.im/ethereum/.svg)](https://gitter.im/ethereum/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://travis-ci.org/ethereum/.png)](https://travis-ci.org/ethereum/) +[![Build Status](https://circleci.com/gh/ethereum/.svg?style=shield)](https://circleci.com/gh/ethereum/) [![PyPI version](https://badge.fury.io/py/.svg)](https://badge.fury.io/py/) [![Python versions](https://img.shields.io/pypi/pyversions/.svg)](https://pypi.python.org/pypi/) [![Docs build](https://readthedocs.org/projects//badge/?version=latest)](http://.readthedocs.io/en/latest/?badge=latest) From cdc83bd498d3e145109a760314d41ea3504f821f Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sun, 22 Apr 2018 01:35:08 -0600 Subject: [PATCH 38/72] Make find replace script more macOS friendly Also, make handling of arbitrary filenames a bit more robust. --- fill_template_vars.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 17f2503..531efcf 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -4,9 +4,6 @@ set -o errexit set -o nounset set -o pipefail -# List of all non-executable files -TEMPLATE_FILES=$(find . ! -perm -u=x -type f | grep -v "\.git") - echo "What is your python module name?" read MODULE_NAME @@ -29,12 +26,20 @@ PROJECT_NAME=${PROJECT_INPUT:-$REPO_NAME} echo "What is a one-liner describing the project?" read SHORT_DESCRIPTION -sed -i "s//$MODULE_NAME/g" $TEMPLATE_FILES -sed -i "s//$PYPI_NAME/g" $TEMPLATE_FILES -sed -i "s//$REPO_NAME/g" $TEMPLATE_FILES -sed -i "s//$RTD_NAME/g" $TEMPLATE_FILES -sed -i "s//$PROJECT_NAME/g" $TEMPLATE_FILES -sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES +_replace() { + local find_cmd=(find . ! -perm -u=x ! -path '*/.git/*' -type f) + + if [[ $(uname) == Darwin ]]; then + "${find_cmd[@]}" -exec sed -i '' "$1" {} + + else + "${find_cmd[@]}" -exec sed -i "$1" {} + + fi +} +_replace "s//$PYPI_NAME/g" +_replace "s//$REPO_NAME/g" +_replace "s//$RTD_NAME/g" +_replace "s//$PROJECT_NAME/g" +_replace "s//$SHORT_DESCRIPTION/g" mkdir $MODULE_NAME touch $MODULE_NAME/__init__.py From d7ce1100ed8c80b108d98f78dc080c6e64d74b9f Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 25 Apr 2018 15:05:30 -0700 Subject: [PATCH 39/72] gitignore utils and internals docs; fill-in fixup --- .gitignore | 3 ++- fill_template_vars.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c380203..e5902e4 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,8 @@ output/*/index.html # Sphinx docs/_build docs/modules.rst -docs/web3.* +docs/*.internals.rst +docs/*.utils.rst # Blockchain chains diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 531efcf..197f490 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -41,7 +41,7 @@ _replace "s//$RTD_NAME/g" _replace "s//$PROJECT_NAME/g" _replace "s//$SHORT_DESCRIPTION/g" -mkdir $MODULE_NAME +mkdir -p $MODULE_NAME touch $MODULE_NAME/__init__.py # template filler is no longer needed, delete it From 0dd03f0a3fc3a895a4276789f0043c150b6a7705 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 25 Apr 2018 15:19:05 -0700 Subject: [PATCH 40/72] re-add MODULE_NAME in new template filler --- fill_template_vars.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 197f490..286daad 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -35,6 +35,7 @@ _replace() { "${find_cmd[@]}" -exec sed -i "$1" {} + fi } +_replace "s//$MODULE_NAME/g" _replace "s//$PYPI_NAME/g" _replace "s//$REPO_NAME/g" _replace "s//$RTD_NAME/g" From b98147efcabaca4dfbc61c53fa55eaf81b880ee8 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 25 Apr 2018 15:20:03 -0700 Subject: [PATCH 41/72] keep template filler around for future merges --- fill_template_vars.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 286daad..5360f31 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -44,6 +44,3 @@ _replace "s//$SHORT_DESCRIPTION/g" mkdir -p $MODULE_NAME touch $MODULE_NAME/__init__.py - -# template filler is no longer needed, delete it -rm "$0" From 285f5c6c70b6b5ac1204ecd81a31cf1a5d4c591e Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 25 Apr 2018 15:39:52 -0700 Subject: [PATCH 42/72] Remove duplicate python version mention in readme Rely on the badge instead --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index ac1ee8b..041ad81 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ -* Python 3.5+ support - Read more in the [documentation on ReadTheDocs](http://.readthedocs.io/). [View the change log](http://.readthedocs.io/en/latest/releases.html). ## Quickstart From 1f89c6385ab4c9b2cdf6ce18e52c1f40cd25f075 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 25 Apr 2018 18:50:01 -0700 Subject: [PATCH 43/72] fix gitignore typo about internals module in docs/ --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e5902e4..58654f8 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ output/*/index.html # Sphinx docs/_build docs/modules.rst -docs/*.internals.rst +docs/*.internal.rst docs/*.utils.rst # Blockchain From 8815766abf57e21498c7e8422c7dece38f503ec9 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 May 2018 11:52:40 -0700 Subject: [PATCH 44/72] circleci: merge (and reattempt) PR before testing --- .circleci/config.yml | 12 ++++++++++++ .circleci/merge_pr.sh | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .circleci/merge_pr.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c636af..af93963 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,17 @@ common: &common working_directory: ~/repo steps: - checkout + - run: + name: merge pull request base + command: ./.circleci/merge_pr.sh + - run: + name: merge pull request base (2nd try) + command: ./.circleci/merge_pr.sh + when: on_fail + - run: + name: merge pull request base (3nd try) + command: ./.circleci/merge_pr.sh + when: on_fail - run: name: merge pull request base command: | @@ -33,6 +44,7 @@ common: &common command: ~/.local/bin/tox -r - save_cache: paths: + - .hypothesis - .tox - ~/.cache/pip - ~/.local diff --git a/.circleci/merge_pr.sh b/.circleci/merge_pr.sh new file mode 100644 index 0000000..91eb47c --- /dev/null +++ b/.circleci/merge_pr.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then + PR_INFO_URL=https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER + PR_BASE_BRANCH=$(curl -L "$PR_INFO_URL" | python -c 'import json, sys; obj = json.load(sys.stdin); sys.stdout.write(obj["base"]["ref"])') + git fetch origin +"$PR_BASE_BRANCH":circleci/pr-base + # We need these config values or git complains when creating the + # merge commit + git config --global user.name "Circle CI" + git config --global user.email "circleci@example.com" + git merge --no-edit circleci/pr-base +fi From 1091971637ff0afc3531cc011c4d00db1a2fc620 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 May 2018 12:09:51 -0700 Subject: [PATCH 45/72] remove old merge code from circle template --- .circleci/config.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af93963..7f542a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,22 +17,6 @@ common: &common name: merge pull request base (3nd try) command: ./.circleci/merge_pr.sh when: on_fail - - run: - name: merge pull request base - command: | - if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then - PR_INFO_URL=https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER - - PR_BASE_BRANCH=$(curl -L "$PR_INFO_URL" | python -c 'import json, sys; obj = json.load(sys.stdin); sys.stdout.write(obj["base"]["ref"])') - git fetch origin +"$PR_BASE_BRANCH":circleci/pr-base - - # We need these config values or git complains when creating the - # merge commit - git config --global user.name "Circle CI" - git config --global user.email "circleci@example.com" - - git merge --no-edit circleci/pr-base - fi - restore_cache: keys: - cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} From 85e33cf3801b19e9d46b237c7837baab0eb1e468 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 May 2018 12:17:36 -0700 Subject: [PATCH 46/72] move template filler to own directory --- .../fill_template_vars.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename fill_template_vars.sh => .project-template/fill_template_vars.sh (89%) diff --git a/fill_template_vars.sh b/.project-template/fill_template_vars.sh similarity index 89% rename from fill_template_vars.sh rename to .project-template/fill_template_vars.sh index 5360f31..7ae7ebb 100755 --- a/fill_template_vars.sh +++ b/.project-template/fill_template_vars.sh @@ -4,6 +4,8 @@ set -o errexit set -o nounset set -o pipefail +PROJECT_ROOT=$(dirname $(dirname $(readlink -f $0))) + echo "What is your python module name?" read MODULE_NAME @@ -27,7 +29,7 @@ echo "What is a one-liner describing the project?" read SHORT_DESCRIPTION _replace() { - local find_cmd=(find . ! -perm -u=x ! -path '*/.git/*' -type f) + local find_cmd=(find "$PROJECT_ROOT" ! -perm -u=x ! -path '*/.git/*' -type f) if [[ $(uname) == Darwin ]]; then "${find_cmd[@]}" -exec sed -i '' "$1" {} + From 71ba221c493d70b04046fc624bf39ea05b8b38d5 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 May 2018 12:25:21 -0700 Subject: [PATCH 47/72] Enable template refilling --- .project-template/fill_template_vars.sh | 4 ++-- .project-template/refill_template_vars.sh | 1 + .project-template/template_vars.txt | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .project-template/refill_template_vars.sh create mode 100644 .project-template/template_vars.txt diff --git a/.project-template/fill_template_vars.sh b/.project-template/fill_template_vars.sh index 7ae7ebb..1e76d8a 100755 --- a/.project-template/fill_template_vars.sh +++ b/.project-template/fill_template_vars.sh @@ -44,5 +44,5 @@ _replace "s//$RTD_NAME/g" _replace "s//$PROJECT_NAME/g" _replace "s//$SHORT_DESCRIPTION/g" -mkdir -p $MODULE_NAME -touch $MODULE_NAME/__init__.py +mkdir -p "$PROJECT_ROOT/$MODULE_NAME" +touch "$PROJECT_ROOT/$MODULE_NAME/__init__.py" diff --git a/.project-template/refill_template_vars.sh b/.project-template/refill_template_vars.sh new file mode 100644 index 0000000..bbb39e9 --- /dev/null +++ b/.project-template/refill_template_vars.sh @@ -0,0 +1 @@ + + + + + + From b357fda082fa2d560ea7fb8e07d2560c1404dbb3 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 May 2018 12:33:36 -0700 Subject: [PATCH 48/72] refill from any directory --- .project-template/refill_template_vars.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 .project-template/refill_template_vars.sh diff --git a/.project-template/refill_template_vars.sh b/.project-template/refill_template_vars.sh old mode 100644 new mode 100755 index bbb39e9..6e7943f --- a/.project-template/refill_template_vars.sh +++ b/.project-template/refill_template_vars.sh @@ -1 +1,2 @@ - Date: Tue, 15 May 2018 13:02:56 -0700 Subject: [PATCH 49/72] make merge script executable --- .circleci/merge_pr.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .circleci/merge_pr.sh diff --git a/.circleci/merge_pr.sh b/.circleci/merge_pr.sh old mode 100644 new mode 100755 From 5e509100e7174eef6169f1d152197c0db22163d9 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 1 Jun 2018 14:05:57 -0600 Subject: [PATCH 50/72] Some readme updates --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 041ad81..937344d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ -Read more in the [documentation on ReadTheDocs](http://.readthedocs.io/). [View the change log](http://.readthedocs.io/en/latest/releases.html). +Read more in the [documentation on ReadTheDocs](https://.readthedocs.io/). [View the change log](https://.readthedocs.io/en/latest/releases.html). ## Quickstart @@ -17,7 +17,7 @@ Read more in the [documentation on ReadTheDocs](http://.readthedocs.io pip install ``` -## Developer setup +## Developer Setup If you would like to hack on , please check out the [Ethereum Development Tactical Manual](https://github.com/pipermerriam/ethereum-dev-tactical-manual) @@ -33,7 +33,6 @@ for information on how we do: You can set up your dev environment with: ```sh - git clone git@github.com:ethereum/.git cd virtualenv -p python3 venv From 32c8c981f262248b20730d18e2d4fcad074488dd Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Jun 2018 16:36:02 -0600 Subject: [PATCH 51/72] Remove references to deprecated "py.test" --- Makefile | 2 +- pytest.ini | 2 +- tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5b0f799..7b93655 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ lint-roll: $(MAKE) lint test: - py.test tests + pytest tests test-all: tox diff --git a/pytest.ini b/pytest.ini index d53de3a..f5fdc0e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,4 +4,4 @@ python_paths= . xfail_strict=true [pytest-watch] -runner= py.test --failed-first --maxfail=1 --no-success-flaky-report +runner= pytest --failed-first --maxfail=1 --no-success-flaky-report diff --git a/tox.ini b/tox.ini index 34a66b4..066b377 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ ignore= [testenv] usedevelop=True commands= - core: py.test {posargs:tests/core} + core: pytest {posargs:tests/core} doctest: make -C {toxinidir}/docs doctest basepython = doctest: python From 00819dd924174c78829f97679871fd181dd12509 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Jun 2018 16:36:35 -0600 Subject: [PATCH 52/72] Whitespace --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 066b377..74ea1d4 100644 --- a/tox.ini +++ b/tox.ini @@ -38,5 +38,5 @@ whitelist_externals=make basepython=python extras=lint commands= - flake8 {toxinidir}/ {toxinidir}/tests - isort --recursive --check-only --diff {toxinidir}/ {toxinidir}/tests + flake8 {toxinidir}/ {toxinidir}/tests + isort --recursive --check-only --diff {toxinidir}/ {toxinidir}/tests From e7d0a8577b8f6f5cac11e6f86199f7bca24b3ecd Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Jun 2018 16:37:38 -0600 Subject: [PATCH 53/72] Fix testing dependencies --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4308294..92ee090 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ from setuptools import ( extras_require={ 'test': [ "pytest==3.3.2", + "pytest-xdist", "tox>=2.9.1,<3", ], 'lint': [ @@ -20,7 +21,6 @@ extras_require={ ], 'dev': [ "bumpversion>=0.5.3,<1", - "pytest-xdist", "pytest-watch>=4.1.0,<5", "wheel", "ipython", From 0a83658b3ee41fdc8473e3156a5b7591ef992c9b Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Jun 2018 16:37:52 -0600 Subject: [PATCH 54/72] Lint in setup.py --- setup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 92ee090..55b3c90 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import ( find_packages, ) -extras_require={ +extras_require = { 'test': [ "pytest==3.3.2", "pytest-xdist", @@ -28,10 +28,10 @@ extras_require={ } extras_require['dev'] = ( - extras_require['dev'] - + extras_require['test'] - + extras_require['lint'] - + extras_require['doc'] + extras_require['dev'] + + extras_require['test'] + + extras_require['lint'] + + extras_require['doc'] ) setup( From 0088da3781742674729aa54eb423f35e4a3826ae Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Jun 2018 18:40:58 -0600 Subject: [PATCH 55/72] Fix possibly incorrect isort config --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 74ea1d4..6ae707b 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ envlist= combine_as_imports=True force_sort_within_sections=True include_trailing_comma=True -known_standard_library=pytest +known_third_party=hypothesis,pytest known_first_party= line_length=21 multi_line_output=3 From 6ed7bb011f7c7bd77c0e3a1802e3381d6bf3d8a5 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 6 Jun 2018 18:30:40 -0600 Subject: [PATCH 56/72] Make template filler more BSD friendly --- .project-template/fill_template_vars.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.project-template/fill_template_vars.sh b/.project-template/fill_template_vars.sh index 1e76d8a..f09e8ff 100755 --- a/.project-template/fill_template_vars.sh +++ b/.project-template/fill_template_vars.sh @@ -4,7 +4,7 @@ set -o errexit set -o nounset set -o pipefail -PROJECT_ROOT=$(dirname $(dirname $(readlink -f $0))) +PROJECT_ROOT=$(dirname $(dirname $(python -c 'import os, sys; sys.stdout.write(os.path.realpath(sys.argv[1]))' "$0"))) echo "What is your python module name?" read MODULE_NAME From 016f48d17ddf549955f2baea0c6dd32fefdbd5a8 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 6 Jun 2018 19:35:31 -0600 Subject: [PATCH 57/72] Use twine for pypi uploading per packaging docs See here: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives --- Makefile | 3 ++- setup.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b93655..db66037 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,8 @@ release: clean git config commit.gpgSign true bumpversion $(bump) git push upstream && git push upstream --tags - python setup.py sdist bdist_wheel upload + python setup.py sdist bdist_wheel + twine upload dist/* git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" dist: clean diff --git a/setup.py b/setup.py index 55b3c90..511490f 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ extras_require = { "bumpversion>=0.5.3,<1", "pytest-watch>=4.1.0,<5", "wheel", + "twine", "ipython", ], } From a9d531615da67410bc42fe7285e0e049dc42a78d Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 7 Jun 2018 12:23:32 -0600 Subject: [PATCH 58/72] Fix ineffectual commands in Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b93655..8339d7d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign) + .PHONY: clean-pyc clean-build docs help: @@ -47,7 +49,6 @@ linux-docs: build-docs xdg-open docs/_build/html/index.html release: clean - CURRENT_SIGN_SETTING=$(git config commit.gpgSign) git config commit.gpgSign true bumpversion $(bump) git push upstream && git push upstream --tags From d3537cf1ab18cf813c5bfd957e51ca6699e3e0a3 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 7 Jun 2018 12:27:07 -0600 Subject: [PATCH 59/72] Update eth-utils version requirement --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 55b3c90..4bfc7a7 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ setup( url='https://github.com/ethereum/', include_package_data=True, install_requires=[ - "eth-utils>=0.7.4,<1.0.0", + "eth-utils>=1,<2", ], setup_requires=['setuptools-markdown'], python_requires='>=3.5, <4', From 5ad0973c3d16c0a43a705db6ce33b1510989d8cb Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Wed, 29 Aug 2018 09:47:22 -0700 Subject: [PATCH 60/72] Ignore any internal `_utils` module --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 58654f8..9a48c01 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ docs/_build docs/modules.rst docs/*.internal.rst docs/*.utils.rst +docs/*._utils.* # Blockchain chains From 0b004a8597fcf27cf259d9002d9bc30c2e2a0179 Mon Sep 17 00:00:00 2001 From: Nick Gheorghita Date: Mon, 27 Aug 2018 11:15:43 -0600 Subject: [PATCH 61/72] Add changelog instructions --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 937344d..8843960 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,11 @@ The version format for this repo is `{major}.{minor}.{patch}` for stable, and `{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta). To issue the next version in line, specify which part to bump, -like `make release bump=minor` or `make release bump=devnum`. +like `make release bump=minor` or `make release bump=devnum`. This is typically done from the +master branch, except when releasing a beta (in which case the beta is released from master, +and the previous stable branch is released from said branch). To include changes made with each +release, update "docs/releases.rst" with the changes, and apply commit directly to master +before release. If you are in a beta version, `make release bump=stage` will switch to a stable. From caf9050a19a889c90afd23a05b6d5f9aefadd665 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Tue, 15 Jan 2019 16:06:18 -0800 Subject: [PATCH 62/72] Drop py3.5, add py3.7 --- .circleci/config.yml | 18 +++++++++--------- .travis.yml | 24 ++++++++++++------------ docs/conf.py | 2 +- setup.py | 4 ++-- tox.ini | 4 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f542a1..bbc56d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,27 +39,27 @@ jobs: doctest: <<: *common docker: - - image: circleci/python:3.5 + - image: circleci/python:3.6 environment: TOXENV: doctest lint: <<: *common docker: - - image: circleci/python:3.5 + - image: circleci/python:3.6 environment: TOXENV: lint - py35-core: - <<: *common - docker: - - image: circleci/python:3.5 - environment: - TOXENV: py35-core py36-core: <<: *common docker: - image: circleci/python:3.6 environment: TOXENV: py36-core + py37-core: + <<: *common + docker: + - image: circleci/python:3.7 + environment: + TOXENV: py37-core pypy3-core: <<: *common docker: @@ -72,6 +72,6 @@ workflows: jobs: - doctest - lint - - py35-core - py36-core + - py37-core - pypy3-core diff --git a/.travis.yml b/.travis.yml index 78c56a6..c523874 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,23 +4,23 @@ dist: trusty matrix: include: # - # Python 3.5 testing - # - # lint - - python: "3.5" - env: TOX_POSARGS="-e lint" - # doctest - - python: "3.5" - env: TOX_POSARGS="-e doctest" - # core - - python: "3.5" - env: TOX_POSARGS="-e py35-core" - # # Python 3.6 testing # # core - python: "3.6" env: TOX_POSARGS="-e py36-core" + # lint + - python: "3.6" + env: TOX_POSARGS="-e lint" + # doctest + - python: "3.6" + env: TOX_POSARGS="-e doctest" + # + # Python 3.7 testing + # + # core + - python: "3.7" + env: TOX_POSARGS="-e py37-core" # # pypy3 testing # diff --git a/docs/conf.py b/docs/conf.py index a74a977..0c63ed4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -273,7 +273,7 @@ texinfo_documents = [ # -- Intersphinx configuration ------------------------------------------------ intersphinx_mapping = { - 'python': ('https://docs.python.org/3.5', None), + 'python': ('https://docs.python.org/3.6', None), } # -- Doctest configuration ---------------------------------------- diff --git a/setup.py b/setup.py index 99618aa..047d6ff 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ setup( "eth-utils>=1,<2", ], setup_requires=['setuptools-markdown'], - python_requires='>=3.5, <4', + python_requires='>=3.6, <4', extras_require=extras_require, py_modules=[''], license="MIT", @@ -62,8 +62,8 @@ setup( 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: PyPy', ], ) diff --git a/tox.ini b/tox.ini index 6ae707b..71e19f2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist= - py{35,36,py3}-core + py{36,37,py3}-core lint doctest @@ -26,8 +26,8 @@ commands= doctest: make -C {toxinidir}/docs doctest basepython = doctest: python - py35: python3.5 py36: python3.6 + py37: python3.7 pypy3: pypy3 extras= test From dd74824840c0b5899dcbc4b5a7b61b4398218fd1 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 24 Jan 2019 13:57:17 -0700 Subject: [PATCH 63/72] Add docstring checking with pydocstyle --- .pydocstyle.ini | 30 ++++++++++++++++++++++++++++++ setup.py | 1 + tox.ini | 1 + 3 files changed, 32 insertions(+) create mode 100644 .pydocstyle.ini diff --git a/.pydocstyle.ini b/.pydocstyle.ini new file mode 100644 index 0000000..0d40aa8 --- /dev/null +++ b/.pydocstyle.ini @@ -0,0 +1,30 @@ +[pydocstyle] +; All error codes found here: +; http://www.pydocstyle.org/en/3.0.0/error_codes.html +; +; Ignored: +; D1 - Missing docstring error codes +; +; Selected: +; D2 - Whitespace error codes +; D3 - Quote error codes +; D4 - Content related error codes +select=D2,D3,D4 + +; Extra ignores: +; D200 - One-line docstring should fit on one line with quotes +; D203 - 1 blank line required before class docstring +; D204 - 1 blank line required after class docstring +; D205 - 1 blank line required between summary line and description +; D212 - Multi-line docstring summary should start at the first line +; D302 - Use u""" for Unicode docstrings +; D400 - First line should end with a period +; D401 - First line should be in imperative mood +; D412 - No blank lines allowed between a section header and its content +add-ignore=D200,D203,D204,D205,D212,D302,D400,D401,D412 + +; Explanation: +; D400 - Enabling this error code seems to make it a requirement that the first +; sentence in a docstring is not split across two lines. It also makes it a +; requirement that no docstring can have a multi-sentence description without a +; summary line. Neither one of those requirements seem appropriate. diff --git a/setup.py b/setup.py index 047d6ff..6c02fb2 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ extras_require = { 'lint': [ "flake8==3.4.1", "isort>=4.2.15,<5", + "pydocstyle>=3.0.0,<4", ], 'doc': [ "Sphinx>=1.6.5,<2", diff --git a/tox.ini b/tox.ini index 71e19f2..6372125 100644 --- a/tox.ini +++ b/tox.ini @@ -40,3 +40,4 @@ extras=lint commands= flake8 {toxinidir}/ {toxinidir}/tests isort --recursive --check-only --diff {toxinidir}/ {toxinidir}/tests + pydocstyle {toxinidir}/ {toxinidir}/tests From de4bdf9e308e7eba871e7399a67dcdbf6c5a8bbc Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 25 Mar 2019 15:14:04 -0600 Subject: [PATCH 64/72] Remove attribution to specific person --- LICENSE | 2 +- README.md | 4 ++-- docs/conf.py | 8 ++++---- setup.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 1b7a2b5..d93175a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Jason Carver +Copyright (c) 2019 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 diff --git a/README.md b/README.md index 8843960..ad7eb27 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ pip install ## Developer Setup -If you would like to hack on , please check out the -[Ethereum Development Tactical Manual](https://github.com/pipermerriam/ethereum-dev-tactical-manual) +If you would like to hack on , please check out the [Snake Charmers +Tactical Manual](https://github.com/ethereum/snake-charmers-tactical-manual) for information on how we do: - Testing diff --git a/docs/conf.py b/docs/conf.py index 0c63ed4..aaf6fb6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,7 +54,7 @@ master_doc = 'index' # General information about the project. project = '' -copyright = '2018, Jason Carver, Piper Merriam' +copyright = '2019, The Ethereum Foundation' __version__ = setup_version # The version info for the project you're documenting, acts as replacement for @@ -210,7 +210,7 @@ latex_elements = { # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', '.tex', ' Documentation', - 'Jason Carver', 'manual'), + 'The Ethereum Foundation', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -240,7 +240,7 @@ latex_documents = [ # (source start file, name, description, authors, manual section). man_pages = [ ('index', '', ' Documentation', - ['Jason Carver'], 1) + ['The Ethereum Foundation'], 1) ] # If true, show URL addresses after external links. @@ -254,7 +254,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ ('index', '', ' Documentation', - 'Jason Carver', '', '', + 'The Ethereum Foundation', '', '', 'Miscellaneous'), ] diff --git a/setup.py b/setup.py index 6c02fb2..904429c 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( version='0.1.0-alpha.0', description=""": """, long_description_markdown_filename='README.md', - author='Jason Carver', + author='The Ethereum Foundation', author_email='ethcalibur+pip@gmail.com', url='https://github.com/ethereum/', include_package_data=True, From 5f3e6b37bf6f596e23b05bac12069ddc1c34fd83 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 25 Mar 2019 20:04:26 -0600 Subject: [PATCH 65/72] Remove travis config --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c523874..0000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -sudo: false -language: python -dist: trusty -matrix: - include: - # - # Python 3.6 testing - # - # core - - python: "3.6" - env: TOX_POSARGS="-e py36-core" - # lint - - python: "3.6" - env: TOX_POSARGS="-e lint" - # doctest - - python: "3.6" - env: TOX_POSARGS="-e doctest" - # - # Python 3.7 testing - # - # core - - python: "3.7" - env: TOX_POSARGS="-e py37-core" - # - # pypy3 testing - # - # core - - python: "pypy3.5" - env: TOX_POSARGS="-e pypy3-core" -cache: - - pip: true -install: - - travis_retry pip install pip setuptools --upgrade - - travis_retry pip install tox -before_script: - - python --version - - pip --version - - pip freeze -script: - - tox $TOX_POSARGS From 5e6dc2999162c19f87bf123d839f693399babbb5 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 26 Mar 2019 11:51:15 -0600 Subject: [PATCH 66/72] Update default author email --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 904429c..0203cbf 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup( description=""": """, long_description_markdown_filename='README.md', author='The Ethereum Foundation', - author_email='ethcalibur+pip@gmail.com', + author_email='snakecharmers@ethereum.org', url='https://github.com/ethereum/', include_package_data=True, install_requires=[ From 720b2cf3d2cbef46d73cff6d0e237a60d59a6b62 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Fri, 26 Apr 2019 15:59:33 +0200 Subject: [PATCH 67/72] Add mypy support --- mypy.ini | 16 ++++++++++++++++ setup.py | 1 + tox.ini | 1 + 3 files changed, 18 insertions(+) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..1fcbd14 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,16 @@ +[mypy] + +check_untyped_defs = True +disallow_incomplete_defs = True +disallow_untyped_defs = True +disallow_any_generics = True +disallow_untyped_calls = True +disallow_untyped_decorators = True +disallow_subclassing_any = True +ignore_missing_imports = True +strict_optional = True +strict_equality = True +warn_redundant_casts = True +warn_return_any = True +warn_unused_configs = True +warn_unused_ignores = True diff --git a/setup.py b/setup.py index 0203cbf..97ac1c3 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ extras_require = { 'lint': [ "flake8==3.4.1", "isort>=4.2.15,<5", + "mypy==0.701", "pydocstyle>=3.0.0,<4", ], 'doc': [ diff --git a/tox.ini b/tox.ini index 6372125..e7e9920 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,7 @@ whitelist_externals=make basepython=python extras=lint commands= + mypy -p {toxinidir}/ --config-file {toxinidir}/mypy.ini flake8 {toxinidir}/ {toxinidir}/tests isort --recursive --check-only --diff {toxinidir}/ {toxinidir}/tests pydocstyle {toxinidir}/ {toxinidir}/tests From 84d2b22a7b9214b3ff40463325b2ffb338594628 Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Wed, 1 May 2019 14:31:32 -0600 Subject: [PATCH 68/72] switch to native pypy markdown support --- setup.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 97ac1c3..edd6685 100644 --- a/setup.py +++ b/setup.py @@ -31,18 +31,24 @@ extras_require = { } extras_require['dev'] = ( - extras_require['dev'] + - extras_require['test'] + - extras_require['lint'] + + extras_require['dev'] + # noqa: W504 + extras_require['test'] + # noqa: W504 + extras_require['lint'] + # noqa: W504 extras_require['doc'] ) + +with open('./README.md') as readme: + long_description = readme.read() + + setup( name='', # *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme version='0.1.0-alpha.0', description=""": """, - long_description_markdown_filename='README.md', + long_description=long_description, + long_description_content_type='text/markdown', author='The Ethereum Foundation', author_email='snakecharmers@ethereum.org', url='https://github.com/ethereum/', @@ -50,7 +56,6 @@ setup( install_requires=[ "eth-utils>=1,<2", ], - setup_requires=['setuptools-markdown'], python_requires='>=3.6, <4', extras_require=extras_require, py_modules=[''], From a6f607881443a06c3bbf3be3aad0651651b84c8a Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Mon, 3 Jun 2019 12:22:46 -0700 Subject: [PATCH 69/72] Add vim .swo files and .mypy_cache to .gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9a48c01..0e05727 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,10 @@ logs .idea/mongoSettings.xml # VIM temp files -*.swp +*.sw[op] + +# mypy +.mypy_cache ## File-based project format: *.iws From 02fe35663c96b81bbd7512480653fbd6140d7ff5 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Mon, 29 Jul 2019 12:51:01 +0200 Subject: [PATCH 70/72] Setup towncrier to generate release notes --- .circleci/config.yml | 6 ++-- .github/PULL_REQUEST_TEMPLATE.md | 10 ++++++ Makefile | 14 ++++++++- README.md | 4 +-- docs/index.rst | 2 +- docs/{releases.rst => release_notes.rst} | 2 ++ newsfragments/README.md | 26 ++++++++++++++++ newsfragments/validate_files.py | 32 +++++++++++++++++++ pyproject.toml | 39 ++++++++++++++++++++++++ setup.py | 1 + tox.ini | 8 ++--- 11 files changed, 132 insertions(+), 12 deletions(-) rename docs/{releases.rst => release_notes.rst} (78%) create mode 100644 newsfragments/README.md create mode 100755 newsfragments/validate_files.py create mode 100644 pyproject.toml diff --git a/.circleci/config.yml b/.circleci/config.yml index bbc56d0..fa7691e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,12 +36,12 @@ common: &common key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} jobs: - doctest: + docs: <<: *common docker: - image: circleci/python:3.6 environment: - TOXENV: doctest + TOXENV: docs lint: <<: *common docker: @@ -70,7 +70,7 @@ workflows: version: 2 test: jobs: - - doctest + - docs - lint - py36-core - py37-core diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 76ef5ac..21d4db5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,16 @@ Issue # Summary of approach. +### To-Do + +[//]: # (Stay ahead of things, add list items here!) +- [ ] Clean up commit history + +[//]: # (For important changes that should go into the release notes please add a newsfragment file as explained here: https://github.com/ethereum//blob/master/newsfragments/README.md) + +[//]: # (See: https://.readthedocs.io/en/latest/contributing.html#pull-requests) +- [ ] Add entry to the [release notes](https://github.com/ethereum//blob/master/newsfragments/README.md) + #### Cute Animal Picture ![put a cute animal picture link inside the parentheses]() diff --git a/Makefile b/Makefile index 18f7003..5603310 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,8 @@ build-docs: $(MAKE) -C docs clean $(MAKE) -C docs html $(MAKE) -C docs doctest + ./newsfragments/validate_files.py + towncrier --draft --version preview docs: build-docs open docs/_build/html/index.html @@ -49,13 +51,23 @@ linux-docs: build-docs xdg-open docs/_build/html/index.html release: clean + CURRENT_SIGN_SETTING=$(git config commit.gpgSign) git config commit.gpgSign true - bumpversion $(bump) + # Let UPCOMING_VERSION be the version that is used for the current bump + $(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g')) + # Now generate the release notes to have them included in the release commit + towncrier --yes --version $(UPCOMING_VERSION) + # Before we bump the version, make sure that the towncrier-generated docs will build + make build-docs + # We need --allow-dirty because of the generated release_notes file that goes into the release + # commit. No other files are added accidentially. The dry-run still runs *without* --allow-dirty + bumpversion --allow-dirty $(bump) git push upstream && git push upstream --tags python setup.py sdist bdist_wheel twine upload dist/* git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" + dist: clean python setup.py sdist bdist_wheel ls -l dist diff --git a/README.md b/README.md index ad7eb27..3ceb98c 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,7 @@ The version format for this repo is `{major}.{minor}.{patch}` for stable, and To issue the next version in line, specify which part to bump, like `make release bump=minor` or `make release bump=devnum`. This is typically done from the master branch, except when releasing a beta (in which case the beta is released from master, -and the previous stable branch is released from said branch). To include changes made with each -release, update "docs/releases.rst" with the changes, and apply commit directly to master -before release. +and the previous stable branch is released from said branch). If you are in a beta version, `make release bump=stage` will switch to a stable. diff --git a/docs/index.rst b/docs/index.rst index b3598a4..89815ef 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,7 +10,7 @@ Contents :maxdepth: 3 - releases + release_notes Indices and tables diff --git a/docs/releases.rst b/docs/release_notes.rst similarity index 78% rename from docs/releases.rst rename to docs/release_notes.rst index 6fdd6c9..63786ac 100644 --- a/docs/releases.rst +++ b/docs/release_notes.rst @@ -1,6 +1,8 @@ Release Notes ============= +.. towncrier release notes start + v0.1.0-alpha.1 -------------- diff --git a/newsfragments/README.md b/newsfragments/README.md new file mode 100644 index 0000000..09c1cc8 --- /dev/null +++ b/newsfragments/README.md @@ -0,0 +1,26 @@ +This directory collects "newsfragments": short files that each contain +a snippet of ReST-formatted text that will be added to the next +release notes. This should be a description of aspects of the change +(if any) that are relevant to users. (This contrasts with the +commit message and PR description, which are a description of the change as +relevant to people working on the code itself.) + +Each file should be named like `..rst`, where +`` is an issue numbers, and `` is one of: + +* `feature` +* `bugfix` +* `performance` +* `doc` +* `removal` +* `misc` + +So for example: `123.feature.rst`, `456.bugfix.rst` + +If the PR fixes an issue, use that number here. If there is no issue, +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 + will look like in the final release notes. \ No newline at end of file diff --git a/newsfragments/validate_files.py b/newsfragments/validate_files.py new file mode 100755 index 0000000..c6695bc --- /dev/null +++ b/newsfragments/validate_files.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# 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 + +ALLOWED_EXTENSIONS = { + '.bugfix.rst', + '.doc.rst', + '.feature.rst', + '.misc.rst', + '.performance.rst', + '.removal.rst', +} + +ALLOWED_FILES = { + 'validate_files.py', + 'README.md', +} + +THIS_DIR = pathlib.Path(__file__).parent + +for fragment_file in THIS_DIR.iterdir(): + + if fragment_file.name in ALLOWED_FILES: + continue + + full_extension = "".join(fragment_file.suffixes) + if full_extension not in ALLOWED_EXTENSIONS: + raise Exception(f"Unexpected file: {fragment_file}") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..42a4130 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[tool.towncrier] +# Read https://github.com/ethereum//newsfragments/README.md for instructions +package = "" +filename = "docs/release_notes.rst" +directory = "newsfragments" +underlines = ["-", "~", "^"] +issue_format = "`#{issue} /issues/{issue}>`__" + +# Configure all default sections plus an extra one for performance improvements. + +[[tool.towncrier.type]] +directory = "feature" +name = "Features" +showcontent = true + +[[tool.towncrier.type]] +directory = "bugfix" +name = "Bugfixes" +showcontent = true + +[[tool.towncrier.type]] +directory = "performance" +name = "Performance improvements" +showcontent = true + +[[tool.towncrier.type]] +directory = "doc" +name = "Improved Documentation" +showcontent = true + +[[tool.towncrier.type]] +directory = "removal" +name = "Deprecations and Removals" +showcontent = true + +[[tool.towncrier.type]] +directory = "misc" +name = "Miscellaneous internal changes" +showcontent = false \ No newline at end of file diff --git a/setup.py b/setup.py index edd6685..54dbd6c 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ extras_require = { 'doc': [ "Sphinx>=1.6.5,<2", "sphinx_rtd_theme>=0.1.9", + "towncrier>=19.2.0, <20", ], 'dev': [ "bumpversion>=0.5.3,<1", diff --git a/tox.ini b/tox.ini index e7e9920..953e83a 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist= py{36,37,py3}-core lint - doctest + docs [isort] combine_as_imports=True @@ -23,15 +23,15 @@ ignore= usedevelop=True commands= core: pytest {posargs:tests/core} - doctest: make -C {toxinidir}/docs doctest + docs: make build-docs basepython = - doctest: python + docs: python py36: python3.6 py37: python3.7 pypy3: pypy3 extras= test - doctest: doc + docs: doc whitelist_externals=make [testenv:lint] From 07eecb5c69b9c92e5e5699fafded51bbfaddca54 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Mon, 25 Nov 2019 12:22:29 -0800 Subject: [PATCH 71/72] Separate release-note build from release --- Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5603310..5e087e3 100644 --- a/Makefile +++ b/Makefile @@ -50,18 +50,24 @@ docs: build-docs linux-docs: build-docs xdg-open docs/_build/html/index.html -release: clean - CURRENT_SIGN_SETTING=$(git config commit.gpgSign) - git config commit.gpgSign true +notes: # Let UPCOMING_VERSION be the version that is used for the current bump $(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g')) # Now generate the release notes to have them included in the release commit towncrier --yes --version $(UPCOMING_VERSION) # Before we bump the version, make sure that the towncrier-generated docs will build make build-docs - # We need --allow-dirty because of the generated release_notes file that goes into the release - # commit. No other files are added accidentially. The dry-run still runs *without* --allow-dirty - bumpversion --allow-dirty $(bump) + git commit -m "Compile release notes" + +release: clean + # require that you be on a branch that's linked to upstream/master + git status -s -b | head -1 | grep "\.\.upstream/master" + # verify that docs build correctly + ./newsfragments/validate_files.py is-empty + make build-docs + CURRENT_SIGN_SETTING=$(git config commit.gpgSign) + git config commit.gpgSign true + bumpversion $(bump) git push upstream && git push upstream --tags python setup.py sdist bdist_wheel twine upload dist/* From 89363b2d9b67c30a04dc9aa3ef2ad6e1ad1b1709 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Mon, 25 Nov 2019 12:28:05 -0800 Subject: [PATCH 72/72] Add internal type for release notes --- newsfragments/README.md | 3 ++- newsfragments/validate_files.py | 17 ++++++++++++++--- pyproject.toml | 11 +++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/newsfragments/README.md b/newsfragments/README.md index 09c1cc8..09a10dd 100644 --- a/newsfragments/README.md +++ b/newsfragments/README.md @@ -12,6 +12,7 @@ Each file should be named like `..rst`, where * `bugfix` * `performance` * `doc` +* `internal` * `removal` * `misc` @@ -23,4 +24,4 @@ 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 - will look like in the final release notes. \ No newline at end of file + will look like in the final release notes. diff --git a/newsfragments/validate_files.py b/newsfragments/validate_files.py index c6695bc..c0e9b28 100755 --- a/newsfragments/validate_files.py +++ b/newsfragments/validate_files.py @@ -5,11 +5,13 @@ import os import pathlib +import sys ALLOWED_EXTENSIONS = { '.bugfix.rst', '.doc.rst', '.feature.rst', + '.internal.rst', '.misc.rst', '.performance.rst', '.removal.rst', @@ -22,11 +24,20 @@ ALLOWED_FILES = { THIS_DIR = pathlib.Path(__file__).parent +num_args = len(sys.argv) - 1 +assert num_args in {0, 1} +if num_args == 1: + assert sys.argv[1] in ('is-empty', ) + for fragment_file in THIS_DIR.iterdir(): if fragment_file.name in ALLOWED_FILES: continue - - full_extension = "".join(fragment_file.suffixes) - if full_extension not in ALLOWED_EXTENSIONS: + elif num_args == 0: + full_extension = "".join(fragment_file.suffixes) + if full_extension not in ALLOWED_EXTENSIONS: + raise Exception(f"Unexpected file: {fragment_file}") + elif sys.argv[1] == 'is-empty': raise Exception(f"Unexpected file: {fragment_file}") + else: + raise RuntimeError("Strange: arguments {sys.argv} were validated, but not found") diff --git a/pyproject.toml b/pyproject.toml index 42a4130..a9724ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,6 @@ directory = "newsfragments" underlines = ["-", "~", "^"] issue_format = "`#{issue} /issues/{issue}>`__" -# Configure all default sections plus an extra one for performance improvements. - [[tool.towncrier.type]] directory = "feature" name = "Features" @@ -33,7 +31,12 @@ directory = "removal" name = "Deprecations and Removals" showcontent = true +[[tool.towncrier.type]] +directory = "internal" +name = "Internal Changes - for Contributors" +showcontent = true + [[tool.towncrier.type]] directory = "misc" -name = "Miscellaneous internal changes" -showcontent = false \ No newline at end of file +name = "Miscellaneous changes" +showcontent = false