Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: make installable via poetry / pipx #47

Merged
merged 6 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 45 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,10 @@

Diff your Ethereum smart contracts code from GitHub against Blockchain explorer verified source code.

## Prerequisites
## Install

This project was developed using these dependencies with their exact versions listed below:

- Python 3.12
- Poetry 1.8

Other versions may work as well but were not tested at all.

## Setup

1. Install Poetry

Use the following command to install poetry:

```shell
pip install --user poetry~=1.8
```

alternatively, you could proceed with `pipx`:

```shell
pipx install poetry~=1.8
```

2. Activate poetry virtual environment,

```shell
poetry shell
```

3. Install Python dependencies

```shell
poetry install
```bash
pipx install git+https://github.com/lidofinance/diffyscan
```

## Usage
Expand All @@ -61,7 +30,7 @@ export GITHUB_API_TOKEN=<your-github-token>
Start script with one of the examples provided

```bash
python3 main.py config_samples/lido_dao_sepolia_config.json
diffyscan config_samples/lido_dao_sepolia_config.json
```

Alternatively, create a new config file named `config.json`,
Expand Down Expand Up @@ -92,15 +61,54 @@ Alternatively, create a new config file named `config.json`,
Start the script

```bash
python3 main.py
dyffyscan
```

> Note: Brownie verification tooling might rewrite the imports in the source submission. It transforms relative paths to imported contracts into flat paths ('./folder/contract.sol' -> 'contract.sol'), which makes Diffyscan unable to find a contract for verification.

For contracts whose sources were verified by brownie tooling:

```bash
python3 main.py --support-brownie
diffyscan --support-brownie
```

ℹ️ See more config examples inside the [config_samples](./config_samples/) dir.

## Development setup

### Prerequisites

This project was developed using these dependencies with their exact versions listed below:

- Python 3.12
- Poetry 1.8

Other versions may work as well but were not tested at all.

### Setup

1. Install Poetry

Use the following command to install poetry:

```bash
pip install --user poetry~=1.8
```

alternatively, you could proceed with `pipx`:

```bash
pipx install poetry~=1.8
```

2. Activate poetry virtual environment,

```bash
poetry shell
```

3. Install Python dependencies

```bash
poetry install
```
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
[tool.poetry]
name = "explorer-github-diff-checker"
version = "0.2.0"
name = "diffyscan"
version = "0.1.0"
description = "Diff your Ethereum smart contracts code from GitHub against Blockchain explorer verified source code."
authors = ["Azat Serikov <azatsdev@gmail.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/lidofinance/diffyscan"

keywords = ["ethereum", "diff", "sources"]
package-mode = false

package-mode = true
packages = [{ include = "main.py"}, { include = "utils" }]
exclude = ["config_samples"]

[tool.poetry.scripts]
diffyscan = "main:main"

[tool.poetry.dependencies]
python = ">=3.10,<4"
requests = "^2.32.2"
termtables = "^0.2.4"

[tool.poetry.dev-dependencies]

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"

Expand Down