Skip to content

Commit

Permalink
Merge pull request #123 from ethereum/template-upgrade
Browse files Browse the repository at this point in the history
Template upgrade
  • Loading branch information
carver committed Aug 18, 2022
2 parents 56f340d + 2566117 commit 378bc79
Show file tree
Hide file tree
Showing 40 changed files with 430 additions and 171 deletions.
60 changes: 48 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,76 @@ common: &common
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

jobs:
doctest:
yaml:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: doctest
TOXENV: yaml
benchmark:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: benchmark
docs:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: docs
lint:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: lint
py36:
py36-core:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: py36-core
yaml:
py37-core:
<<: *common
docker:
- image: cimg/python:3.6
environment:
TOXENV: yaml
benchmark:
- image: cimg/python:3.7
environment:
TOXENV: py37-core
py38-core:
<<: *common
docker:
- image: cimg/python:3.6
- image: cimg/python:3.8
environment:
TOXENV: benchmark
TOXENV: py38-core
py39-core:
<<: *common
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-core
py310-core:
<<: *common
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-core
pypy3-core:
<<: *common
docker:
- image: pypy
environment:
TOXENV: pypy3-core

workflows:
version: 2
test:
jobs:
- doctest
- docs
- lint
- py36
- py36-core
- py37-core
- py38-core
- py39-core
- py310-core
- pypy3-core
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .git-blame-ignore-revs

# Update black and follow new style rules
272b52abe36b947702bf3f6b99e5ce8106214653
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/py-ssz/blob/master/newsfragments/README.md)

[//]: # (See: https://ssz.readthedocs.io/en/latest/contributing.html#pull-requests)
- [ ] Add entry to the [release notes](https://github.com/ethereum/py-ssz/blob/master/newsfragments/README.md)

#### Cute Animal Picture

![put a cute animal picture link inside the parentheses]()
55 changes: 22 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ develop-eggs
.installed.cfg
lib
lib64
pip-wheel-metadata
venv*
.python-version

Expand Down Expand Up @@ -56,59 +57,47 @@ chains

# tox/pytest cache
.cache
.pytest_cache/
.pytest_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
*.sw[op]

# mypy
.mypy_cache

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# For a more precise, explicit template, see:
# https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

## General
.idea/*
.idea_modules/*

## File-based project format:
*.iws

## Plugin-specific files:
## IntelliJ
out/

# IntelliJ
/out/
## Plugin-specific files:

# mpeltonen/sbt-idea plugin
### mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
### JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
### Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# END JetBrains section

# VScode

.vscode/
4 changes: 3 additions & 1 deletion .project-template/fill_template_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ echo "What is a one-liner describing the project?"
read SHORT_DESCRIPTION

_replace() {
local find_cmd=(find "$PROJECT_ROOT" ! -perm -u=x ! -path '*/.git/*' -type f)
echo "Replacing values: $1"
local find_cmd=(find "$PROJECT_ROOT" ! -perm -u=x ! -path '*/.git/*' ! -path '*/venv*/*' -type f)

if [[ $(uname) == Darwin ]]; then
"${find_cmd[@]}" -exec sed -i '' "$1" {} +
Expand All @@ -46,3 +47,4 @@ _replace "s/<SHORT_DESCRIPTION>/$SHORT_DESCRIPTION/g"

mkdir -p "$PROJECT_ROOT/$MODULE_NAME"
touch "$PROJECT_ROOT/$MODULE_NAME/__init__.py"
touch "$PROJECT_ROOT/$MODULE_NAME/py.typed"
30 changes: 30 additions & 0 deletions .pydocstyle.ini
Original file line number Diff line number Diff line change
@@ -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.
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Jason Carver
Copyright (c) 2020 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
Expand Down
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include LICENSE
include README.md
include requirements-docs.txt

global-include *.pyi

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
prune venv*
35 changes: 32 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with flake8"
@echo "lint-roll - automatically fix problems with isort, flake8, etc"
@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 "docs - generate docs and open in browser (linux-docs for version on linux)"
@echo "notes - consume towncrier newsfragments/ and update release notes in docs/"
@echo "release - package and upload a release (does not run notes target)"
@echo "dist - package"

clean: clean-build clean-pyc
Expand All @@ -22,6 +25,7 @@ clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +

lint:
tox -elint
Expand All @@ -42,20 +46,45 @@ build-docs:
$(MAKE) -C docs html
$(MAKE) -C docs doctest

docs: build-docs
validate-docs:
python ./newsfragments/validate_files.py
towncrier --draft --version preview

docs: build-docs validate-docs
open docs/_build/html/index.html

linux-docs: build-docs
xdg-open docs/_build/html/index.html

release: clean
check-bump:
ifndef bump
$(error bump must be set, typically: major, minor, patch, or devnum)
endif

notes: check-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 build --yes --version $(UPCOMING_VERSION)
# Before we bump the version, make sure that the towncrier-generated docs will build
make build-docs
git commit -m "Compile release notes"

release: check-bump 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/*
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"


dist: clean
python setup.py sdist bdist_wheel
ls -l dist
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
[![Docs build](https://readthedocs.org/projects/ssz/badge/?version=latest)](http://ssz.readthedocs.io/en/latest/?badge=latest)


<<<<<<< HEAD
Python implementation of the Simple Serialization encoding and decoding

Read more in the [documentation on ReadTheDocs](https://ssz.readthedocs.io/). [View the change log](https://ssz.readthedocs.io/en/latest/releases.html).
=======
Read more in the [documentation on ReadTheDocs](https://ssz.readthedocs.io/). [View the change log](https://ssz.readthedocs.io/en/latest/release_notes.html).
>>>>>>> template
## Quickstart

Expand All @@ -19,8 +23,8 @@ pip install ssz

## Developer Setup

If you would like to hack on py-ssz, please check out the
[Ethereum Development Tactical Manual](https://github.com/pipermerriam/ethereum-dev-tactical-manual)
If you would like to hack on py-ssz, please check out the [Snake Charmers
Tactical Manual](https://github.com/ethereum/snake-charmers-tactical-manual)
for information on how we do:

- Testing
Expand Down Expand Up @@ -88,9 +92,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.

Expand Down
Loading

0 comments on commit 378bc79

Please sign in to comment.