Skip to content

Commit

Permalink
Update protocol to ParisC (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Jun 24, 2024
1 parent 864c9fc commit d225e17
Show file tree
Hide file tree
Showing 21 changed files with 332 additions and 249 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@ jobs:
include:
- os: ubuntu-latest
arch: amd64
python-version: '3.12'
- os: ubuntu-latest
arch: arm64
python-version: '3.12'
- os: ubuntu-latest
arch: amd64
python-version: '3.11'
- os: ubuntu-latest
arch: amd64
python-version: '3.10'
- os: ubuntu-latest
arch: amd64
python-version: '3.9'
- os: ubuntu-latest
arch: amd64
python-version: '3.8'

# FIXME: docker.errors.DockerException: Error while fetching server API version
# - os: macos-latest
# arch: amd64
Expand All @@ -34,14 +49,12 @@ jobs:
- name: Install poetry
run: pipx install poetry

- name: Configure poetry
run: poetry config installer.modern-installation false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
python-version: ${{ matrix.python-version }}
# FIXME: temporary
# cache: 'poetry'

- name: Install binary dependencies
run: OSTYPE=$OSTYPE make install-deps
Expand All @@ -51,7 +64,7 @@ jobs:

- name: Run lint
run: make lint
if: contains(matrix.os, 'ubuntu') && contains(matrix.arch, 'amd64')
if: contains(matrix.python-version, '3.12')

- name: Run tests
run: OSTYPE=$OSTYPE make test-ci
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [Unreleased]

### Changed

* Octez binaries updated to v20.1-1

### Fixed

* Fixed Python 3.8 compatibility

## [3.12.1](https://github.com/baking-bad/pytezos/compare/3.12.0...3.12.1) (2024-06-11)

### Changed
Expand Down
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/baking-bad/pytezos/master?filepath=michelson_quickstart.ipynb)


* RPC query engine
* Cryptography
* Building and parsing operations
Expand All @@ -16,15 +15,18 @@
* Working with Michelson AST

#### PyTezos CLI

* Generating contract parameter/storage schema
* Activating and revealing accounts
* Deploying contracts (+ GitHub integration)

#### Michelson REPL

* Builtin interpreter (reimplemented)
* Set of extra helpers (stack visualization, blockchain context mocking)

#### Michelson Jupyter kernel

* Custom interpreter with runtime type checker
* Syntax highlighting, autocomplete with `Tab`
* In-place docstrings with `Shift+Tab`
Expand All @@ -33,48 +35,54 @@
* Debug helpers

#### Michelson integration testing framework

* Writing integration tests using `unittest` package
* Simulating contract execution using remote intepreter (via RPC) or builtin one


## Installation

Make sure you have Python 3.8 to 3.11 installed and set as default in the system.
Make sure you have Python 3.8 to 3.12 installed and set as default in the system.

You also need to install cryptographic packages before installing the library/building the project:

#### Linux
### Linux

#### Ubuntu, Debian and other apt-based distributions

##### Ubuntu, Debian and other apt-based distributions
```shell
$ sudo apt install libsodium-dev libsecp256k1-dev libgmp-dev pkg-config
```

##### Arch Linux
#### Arch Linux

```shell
$ sudo pacman -Syu --needed libsodium libsecp256k1 gmp
```
#### MacOS

### MacOS

[Homebrew](https://brew.sh/) needs to be installed.

```shell
$ brew tap cuber/homebrew-libsecp256k1
$ brew install libsodium libsecp256k1 gmp pkg-config
```

##### M1 (ARM)
#### M1 (ARM)

In case `secp256k1` or `gmp` cannot find either include or lib paths, try explicitly set environment vars:
```

```shell
CFLAGS="-I/opt/homebrew/Cellar/gmp/6.2.1_1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1_1/lib/" LIB_DIR="/opt/homebrew/Cellar/libsecp256k1/0.1/lib" INCLUDE_DIR=/opt/homebrew/Cellar/libsecp256k1/0.1/include pip3 install --user pytezos
```

For running tests you might also need to export `LD_LIBRARY_PATH`:
```

```shell
export LD_LIBRARY_PATH=/opt/homebrew/lib/
```

#### Windows
### Windows

The recommended way is to use WSL and then follow the instructions for Linux,
but if you feel lucky you can try to install natively:
Expand All @@ -100,7 +108,9 @@ $ pip install pytezos
`````

### Docker container

Verified & minified images for CI/CD https://hub.docker.com/r/bakingbad/pytezos/tags

```shell
$ # 1. Use image from registry
$ docker pull bakingbad/pytezos
Expand All @@ -113,27 +123,30 @@ $ docker-compose up -d notebook
### Building from sources

Requirements:
* Python 3.8+

* Python 3.8 to 3.12
* libsodium, libsecp256k1, gmp
* make

```shell
$ # prepare environment
$ make install
# # run full CI with tests
$ make
$ make all
```

## Quick start

Read [quick start guide](https://pytezos.org/quick_start.html)
Learn how to [enable Jupyter with Michelson](./src/michelson_kernel/README.md)

## API reference

Check out a complete [API reference](https://pytezos.org/contents.html)

### Inline documentation
If you are working in Jupyter/Google Colab or any other interactive console,
you can display documentation for a particular class/method:

If you are working in Jupyter/Google Colab or any other interactive console, you can display documentation for a particular class/method:

```python
>>> from pytezos import pytezos
Expand All @@ -155,10 +168,12 @@ https://medium.com/tezoscommons/preparing-for-the-tezos-hackathon-with-baking-ba
https://medium.com/tezoscommons/testing-michelson-contracts-with-pytezos-513718499e93

### Contact

* Telegram chat: [@baking_bad_chat](https://t.me/baking_bad_chat)
* Slack channel: [#baking-bad](https://tezos-dev.slack.com/archives/CV5NX7F2L)

## Credits

* The project was initially started by Arthur Breitman, now it's maintained by Baking Bad team.
* Baking Bad is supported by Tezos Foundation
* Michelson test set from the Tezos repo is used to ensure the interpreter workability
Expand Down
Loading

0 comments on commit d225e17

Please sign in to comment.