Skip to content

Commit

Permalink
Merge pull request #45 from iamdefinitelyahuman/repo-housekeeping
Browse files Browse the repository at this point in the history
Repo housekeeping
  • Loading branch information
iamdefinitelyahuman authored Feb 19, 2020
2 parents 98c0975 + 1ca9378 commit 5fbba46
Show file tree
Hide file tree
Showing 25 changed files with 468 additions and 423 deletions.
14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug Report
about: Report an error that you've encountered.
---
### Environment information

* `py-solc-x` Version: x.x.x
* `solc` Version: x.x.x
* Python Version: x.x.x
* OS: osx/linux/win

### What was wrong?

Please include information like:

* what command you ran
* the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code)
* full output of the error you received

### How can it be fixed?

Fill this in if you know how the bug could be fixed.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature Request
about: Request a new feature, or an improvement to existing functionality.
---
### Overview
Provide a simple overview of what you wish to see added. Please include:

* What you are trying to do
* Why solcx's current functionality is inadequate to address your goal

### Specification
Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!

Remember, your feature is much more likely to be included if it does not involve any breaking changes.
15 changes: 9 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
### What was wrong / missing?
### What I did

Related issue: #

### How I did it

### How was it fixed / added?
### How to verify it

### Checklist


#### Cute Animal Picture

> put a cute animal picture here.
- [ ] I have confirmed that my PR passes all linting checks
- [ ] I have included test cases
- [ ] I have updated the documentation (README.md)
- [ ] I have added an entry to the changelog
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
install:
- choco install python --version=3.7.4
- python -m pip install --upgrade pip
- pip3 install -r requirements-dev.txt
- pip3 install tox==3.14.2
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
script: python -m pytest tests --cov=solcx
script: tox -e tests
after_success: python -m coveralls
- name: "Python 3.8 on Bionic Linux"
language: python
Expand All @@ -19,8 +19,8 @@ jobs:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo apt-get install -y solc
- pip install -r requirements-dev.txt
script: python -m pytest tests --cov=solcx
- pip install tox==3.14.2
script: tox -e tests
after_success: python -m coveralls
- name: "Python 3.7 on Bionic Linux"
language: python
Expand All @@ -30,11 +30,8 @@ jobs:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo apt-get install -y solc
- pip install -r requirements-dev.txt
- pip install flake8
script:
- flake8 solcx/ tests/ --max-line-length=100
- python -m pytest tests --cov=solcx
- pip install tox==3.14.2
script: tox -e lint,tests
after_success: python -m coveralls
- name: "Python 3.6 on Bionic Linux"
language: python
Expand All @@ -44,8 +41,8 @@ jobs:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo apt-get install -y solc
- pip install -r requirements-dev.txt
script: python -m pytest tests --cov=solcx
- pip install tox==3.14.2
script: tox -e tests
after_success: python -m coveralls

env:
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ To start development for py-solc-x you should begin by cloning the repo.
$ git clone https://github.com/iamdefinitelyahuman/py-solc-x.git
```

## Cute Animal Pictures
Next, ensure all dev dependencies have been installed:

All pull requests need to have a cute animal picture. This is a very important
part of the development process.
```bash
pip install -r requirements-dev.txt
```

## Pull Requests

Pull requests are welcomed! Please try to adhere to the following.
Pull requests are welcomed! Please adhere to the following:

- code should conform to PEP8 and as well as the linting done by flake8
- include any relevant documentation updates and test cases
- Ensure your pull request passes our linting checks (`tox -e lint`)
- Include test cases for any new functionality
- Include any relevant [documentation updates](README.md)

It's a good idea to make pull requests early on. A pull request represents the
start of a discussion, and doesn't necessarily need to be the final, finished
submission.
It's a good idea to make pull requests early on. A pull request represents the start of a discussion, and doesn't necessarily need to be the final, finished submission.

GitHub's documentation for working on pull requests is [available here](https://help.github.com/articles/about-pull-requests/).
If you are opening a work-in-progress pull request to verify that it passes CI tests, please consider [marking it as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests).
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| env
| venv
)/
'''
8 changes: 6 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
black==19.10b0
coveralls==1.9.2
pytest>=5.0.0
pytest-cov>=2.7.1
flake8==3.7.9
isort==4.3.21
pytest==5.3.2
pytest-cov==2.8.1
semantic_version>=2.8.1,<3
tox==3.14.2
tqdm>=4.41.0,<5.0.0
twine==1.13.0
requests>=2.19.0,<3
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-line-length = 100
ignore = E203,W503

[tool:isort]
force_grid_wrap = 0
include_trailing_comma = True
line_length = 100
multi_line_output = 3
use_parentheses = True
24 changes: 12 additions & 12 deletions solcx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from __future__ import absolute_import

from .main import ( # noqa: F401
get_solc_version_string,
get_solc_version,
compile_files,
compile_source,
compile_standard,
link_code,
)
from .install import ( # noqa: F401
import_installed_solc,
install_solc,
install_solc_pragma,
get_available_solc_versions,
get_installed_solc_versions,
get_solc_folder,
import_installed_solc,
install_solc,
install_solc_pragma,
set_solc_version,
set_solc_version_pragma
set_solc_version_pragma,
)
from .main import ( # noqa: F401
compile_files,
compile_source,
compile_standard,
get_solc_version,
get_solc_version_string,
link_code,
)

# check for installed version of solc
Expand Down
21 changes: 12 additions & 9 deletions solcx/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .utils.string import force_text


def force_text_maybe(value, encoding='iso-8859-1'):
def force_text_maybe(value, encoding="iso-8859-1"):
if value is not None:
return force_text(value)

Expand All @@ -19,23 +19,26 @@ def __init__(self, command, return_code, stdin_data, stdout_data, stderr_data, m
self.message = message
self.command = command
self.return_code = return_code
self.stdin_data = force_text_maybe(stdin_data, 'utf8')
self.stderr_data = force_text_maybe(stderr_data, 'utf8')
self.stdout_data = force_text_maybe(stdout_data, 'utf8')
self.stdin_data = force_text_maybe(stdin_data, "utf8")
self.stderr_data = force_text_maybe(stderr_data, "utf8")
self.stdout_data = force_text_maybe(stdout_data, "utf8")

def __str__(self):
return textwrap.dedent(("""
return textwrap.dedent(
(
"""
{s.message}
> command: `{command}`
> return code: `{s.return_code}`
> stderr:
{s.stdout_data}
> stdout:
{s.stderr_data}
""").format(
s=self,
command=' '.join(self.command),
)).strip()
"""
).format(
s=self, command=" ".join(self.command),
)
).strip()


class ContractsNotFound(SolcError):
Expand Down
Loading

0 comments on commit 5fbba46

Please sign in to comment.