Skip to content

Commit e4e513a

Browse files
committed
refactor: change to plugin setup
1 parent 4caf765 commit e4e513a

File tree

19 files changed

+763
-53
lines changed

19 files changed

+763
-53
lines changed

.github/workflows/publish.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
deploy:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e .[release]
24+
25+
- name: Build
26+
run: python setup.py sdist bdist_wheel
27+
28+
- name: Publish
29+
env:
30+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32+
run: twine upload dist/*

.github/workflows/test.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
on: ["push", "pull_request"]
2+
3+
name: Test
4+
5+
jobs:
6+
linting:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.8
16+
17+
- name: Install Dependencies
18+
run: pip install .[lint]
19+
20+
- name: Run Black
21+
run: black --check .
22+
23+
- name: Run flake8
24+
run: flake8 ./ape_accounts ./tests ./setup.py
25+
26+
type-check:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Setup Python
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: 3.8
36+
37+
- name: Install Dependencies
38+
run: pip install .[lint]
39+
40+
- name: Run MyPy
41+
run: mypy -p ape_accounts
42+
43+
functional:
44+
runs-on: ubuntu-latest
45+
46+
strategy:
47+
matrix:
48+
python-version: [3.6, 3.7, 3.8, 3.9]
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
53+
- name: Setup Python
54+
uses: actions/setup-python@v2
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Install Dependencies
59+
run: pip install .[test]
60+
61+
- name: Run Tests
62+
run: pytest -m "not fuzzing" -s --coverage
63+
64+
fuzzing:
65+
runs-on: ubuntu-latest
66+
67+
strategy:
68+
fail-fast: true
69+
70+
steps:
71+
- uses: actions/checkout@v2
72+
73+
- name: Setup Python
74+
uses: actions/setup-python@v2
75+
with:
76+
python-version: 3.8
77+
78+
- name: Install Dependencies
79+
run: pip install .[test]
80+
81+
- name: Run Tests
82+
run: pytest -m "fuzzing" --no-cov -s

.gitignore

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
88+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
89+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
90+
# install all needed dependencies.
91+
#Pipfile.lock
92+
93+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
94+
__pypackages__/
95+
96+
# Celery stuff
97+
celerybeat-schedule
98+
celerybeat.pid
99+
100+
# Environments
101+
.env
102+
.venv
103+
env/
104+
venv/
105+
ENV/
106+
env.bak/
107+
venv.bak/
108+
109+
# mkdocs documentation
110+
/site
111+
112+
# mypy
113+
.mypy_cache/
114+
.dmypy.json
115+
dmypy.json

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.1.0
4+
hooks:
5+
- id: check-yaml
6+
7+
- repo: https://github.com/asottile/seed-isort-config
8+
rev: v2.2.0
9+
hooks:
10+
- id: seed-isort-config
11+
12+
- repo: https://github.com/pre-commit/mirrors-isort
13+
rev: v4.3.21
14+
hooks:
15+
- id: isort
16+
17+
- repo: https://github.com/psf/black
18+
rev: 20.8b0
19+
hooks:
20+
- id: black
21+
name: black
22+
23+
- repo: https://gitlab.com/pycqa/flake8
24+
rev: 3.8.3
25+
hooks:
26+
- id: flake8
27+
28+
- repo: https://github.com/pre-commit/mirrors-mypy
29+
rev: v0.800
30+
hooks:
31+
- id: mypy
32+
33+
34+
default_language_version:
35+
python: python3

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CHANGELOG
2+
3+
All notable changes to this project are documented in this file.
4+
5+
This changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased](https://github.com/ApeWorX/ape-accounts)

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Development
2+
3+
To get started with working on the codebase, use the following steps prepare your local environment:
4+
5+
```bash
6+
# clone the github repo and navigate into the folder
7+
git clone https://github.com/ApeWorX/ape-accounts.git
8+
cd ape-accounts
9+
10+
# create and load a virtual environment
11+
python3 -m venv venv
12+
source venv/bin/activate
13+
14+
# install brownie into the virtual environment
15+
python setup.py install
16+
17+
# install the developer dependencies (-e is interactive mode)
18+
pip install -e .[dev]
19+
```
20+
21+
## Pre-Commit Hooks
22+
23+
We use [`pre-commit`](https://pre-commit.com/) hooks to simplify linting and ensure consistent formatting among contributors.
24+
Use of `pre-commit` is not a requirement, but is highly recommended.
25+
26+
Install `pre-commit` locally from the root folder:
27+
28+
```bash
29+
pip install pre-commit
30+
pre-commit install
31+
```
32+
33+
Commiting will now automatically run the local hooks and ensure that your commit passes all lint checks.
34+
35+
## Pull Requests
36+
37+
Pull requests are welcomed! Please adhere to the following:
38+
39+
- Ensure your pull request passes our linting checks
40+
- Include test cases for any new functionality
41+
- Include any relevant documentation updates
42+
43+
It's a good idea to make pull requests early on.
44+
A pull request represents the start of a discussion, and doesn't necessarily need to be the final, finished submission.
45+
46+
If you are opening a work-in-progress pull request to verify that it passes CI tests, please consider
47+
[marking it as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests).
48+
49+
Join the Ethereum Python [Discord](https://discord.gg/PcEJ54yX) if you have any questions.

0 commit comments

Comments
 (0)