Skip to content

Commit c13e2be

Browse files
Merge branch 'release-2.5'
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
2 parents 71f4934 + af343d6 commit c13e2be

8 files changed

Lines changed: 46 additions & 47 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ jobs:
5858
python -m pip install --upgrade pip
5959
python -m pip install -r requirements.txt pytest pytest-asyncio
6060
61-
- name: Install official Fabric protobuf bindings
62-
run: |
63-
chmod +x scripts/install_fabric_protos.sh
64-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
65-
6661
- name: Run tests
6762
run: |
6863
python -m pytest -q

‎CONTRIBUTING.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ git config --global user.name "Your Name"
2828
git config --global user.email "you@example.com"
2929
```
3030

31+
Protobuf bindings
32+
--------------------
33+
34+
Bindings come from PyPI (`hyperledger-fabric-protos`) via `requirements.txt` - no extra steps needed.
35+
36+
If you need to test against unreleased `fabric-protos` changes, see `PROTOS.md` (`scripts/install_fabric_protos.sh` and `scripts/gen_protos.sh`).
37+
38+
3139
Licensing
3240
---------
3341

‎PROTOS.md‎

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,49 @@ Protobufs / How this project uses `fabric-protos`
44
Current integration model
55
-------------------------
66

7-
This project now consumes official Python protobuf bindings from
8-
`hyperledger/fabric-protos`.
7+
This project consumes the official Python protobuf bindings published to PyPI from `hyperledger/fabric-protos`.
98

109
- Package name: `hyperledger-fabric-protos`
1110
- Import namespace used by this repository: `fabric_protos`
1211

13-
Install with:
12+
The package is installed as a regular dependency:
1413

1514
```bash
16-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
15+
pip install -r requirements.txt
1716
```
1817

19-
Why this model
20-
--------------
18+
For contributors: custom bindings
2119

22-
- Avoids vendored generated protobuf drift inside this repository.
23-
- Keeps protocol bindings aligned with the upstream Fabric protobuf source.
24-
- Simplifies release and maintenance for `fabric-chaincode-python`.
20+
`scripts/install_fabric_protos.sh` remains available for contributors who need bindings not published to PyPI (an unreleased upstream commit, or a local checkout). Normal users do not need to run it; it is a no-op when a working fabric_protos is already importable.
2521

26-
Version compatibility
27-
---------------------
22+
Installation order of preference:
2823

29-
Use dependency ranges compatible with upstream Python bindings:
24+
1. Do nothing if a working `fabric_protos` is already importable.
25+
2. Local checkout from `FABRIC_PROTOS_SRC` (runs `make pythonbindings`).
26+
3. Default sibling checkout ../fabric-protos, if present.
27+
4. PyPI package `hyperledger-fabric-protos`.
28+
5. Git checkout of `hyperledger/fabric-protos` at `FABRIC_PROTOS_REF`,then local build/install of bindings/python.
3029

31-
- `protobuf>=5.27.0,<6.0.0`
32-
- `grpcio>=1.83.1,<2.0.0`
30+
Test against a local fabric-protos checkout
31+
-------------------------
32+
33+
```bash
34+
FABRIC_PROTOS_SRC=/path/to/fabric-protos PYTHON_BIN=python ./scripts/install_fabric_protos.sh
35+
```
36+
37+
Test against a specific upstream commit
38+
-------------------------
39+
40+
```bash
41+
FABRIC_PROTOS_REF=<commit-sha> PYTHON_BIN=python ./scripts/install_fabric_protos.sh
42+
````
3343

34-
The installer script uses the following order:
44+
The script validates after install that the required generated modules
45+
- `fabric_protos.peer.chaincode_pb2`
46+
- `fabric_protos.peer.chaincode_shim_pb2`
47+
- `fabric_protos.common.common_pb2`
3548

36-
1. Local `../fabric-protos` checkout (runs `make pythonbindings`)
37-
2. PyPI `hyperledger-fabric-protos` package (if complete)
38-
3. Official `hyperledger/fabric-protos` git checkout at pinned commit,
39-
then local build/install of `bindings/python`
49+
are importable.
4050

4151
Local regeneration (optional)
4252
-----------------------------
@@ -48,10 +58,10 @@ a local `fabric-protos` checkout:
4858
PROTO_SRC=/path/to/fabric-protos OUT_DIR=$PWD/fabric_protos bash scripts/gen_protos.sh
4959
```
5060

51-
This is optional and should not be required for normal runtime use.
61+
This is optional and should not be required for normal runtime use
5262

5363
License
5464
-------
5565

5666
`fabric-protos` is Apache-2.0. If distributing generated bindings yourself,
57-
keep original licensing notices intact.
67+
keep original licensing notices intact.

‎README.md‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ Status
1010
Requirements
1111
------------
1212
- Python 3.10+ (3.11 recommended)
13-
- See `requirements.txt` for runtime dependencies. Key packages:
14-
- `grpcio==1.83.1`
15-
- `protobuf>=5.27.0,<6.0.0`
16-
- `grpclib==0.4.3`
17-
- `hyperledger-fabric-protos` (installed via `scripts/install_fabric_protos.sh`)
13+
- See `requirements.txt` for runtime dependencies
1814

1915
Quick start (development)
2016
-------------------------
@@ -27,7 +23,6 @@ python3 -m venv .venv
2723
source .venv/bin/activate
2824
python -m pip install --upgrade pip
2925
pip install -r requirements.txt
30-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
3126
```
3227

3328
Run tests:
@@ -48,21 +43,13 @@ python -m build --wheel --no-isolation
4843

4944
Protobuf bindings
5045
-----------------
51-
This repository consumes the official Python bindings published from
46+
This repository consumes the official Python bindings published to PYPI from
5247
`hyperledger/fabric-protos`:
5348

5449
- Package name: `hyperledger-fabric-protos`
5550
- Import namespace: `fabric_protos`
5651

57-
Bindings are installed from official `hyperledger/fabric-protos` sources by
58-
`scripts/install_fabric_protos.sh`, with validation that required generated
59-
modules are present.
60-
61-
Install or refresh official bindings with:
62-
63-
```bash
64-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
65-
```
52+
They are installed as a regular dependency via requirements.txt. For custom bindings (local checkout, specific upstream commit) see PROTOS.md.
6653

6754
No vendored protobuf runtime package is required in this repository.
6855
If you need to regenerate bindings locally for debugging, use

‎examples/ccaas/asset-transfer-basic/README.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cd /path/to/fabric-chaincode-python
2828
python3 -m venv .venv
2929
source .venv/bin/activate
3030
pip install -r requirements.txt
31-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
3231
```
3332

3433
### 2. Package the Chaincode
@@ -187,7 +186,7 @@ Tells Fabric that this is a CCAAS package:
187186
### Server won't start
188187
- Ensure `CHAINCODE_ID` matches the package-id from `peer lifecycle chaincode install`
189188
- Check that `connection.json` address is accessible from the peer
190-
- Verify dependencies are installed: `pip install -r requirements.txt && PYTHON_BIN=python ./scripts/install_fabric_protos.sh`
189+
- Verify dependencies are installed: `pip install -r requirements.txt`
191190
- Verify you're using the project venv: `./.venv/bin/python -c "import grpc; print(grpc.__version__)"`
192191
- Verify Fabric protobuf bindings are importable: `./.venv/bin/python -c "from fabric_protos.peer import chaincode_shim_pb2"`
193192

‎examples/ccaas/asset-transfer-sbe/README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ cd /path/to/fabric-chaincode-python
4040
python3 -m venv .venv
4141
source .venv/bin/activate
4242
pip install -r requirements.txt
43-
PYTHON_BIN=python ./scripts/install_fabric_protos.sh
4443
```
4544

4645
### 2. Run the Chaincode Server

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
grpcio==1.83.1
22
grpclib==0.4.3
33
protobuf>=5.27.0,<6.0.0
4+
hyperledger-fabric-protos>=0.3.7.dev1,<0.4.0

‎setup.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def _read_requirements(path: str):
3636
description="Hyperledger Fabric Contract and Chaincode implementation for Python.",
3737
long_description=io.open('README.md', encoding='utf-8').read(),
3838
author='Hyperledger Community',
39-
url='https://github.com/ic-matcom/fabric-chaincode-python/',
40-
download_url='https://github.com/ic-matcom/fabric-chaincode-python/',
39+
url='https://github.com/kmilodenisglez/fabric-chaincode-python/',
40+
download_url='https://github.com/kmilodenisglez/fabric-chaincode-python/',
4141
packages=find_packages(exclude=['docs', 'tests*']),
4242
platforms='any',
4343
install_requires=requirements,

0 commit comments

Comments
 (0)