Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
08fef3b
Use requirements .in instead of .txt in setuptools
edelanghe-ledger Oct 11, 2024
83fc13a
Bump dependencies to use protobuf v5
edelanghe-ledger Oct 11, 2024
429db88
Re-generate protobuf stubs
edelanghe-ledger Dec 17, 2024
341b149
Merge pull request #4 from LedgerHQ/update-protobuf-v5
pthierry-ledger Mar 10, 2025
907338e
build: moving to pythonic build with tox
pthierry-ledger Mar 11, 2025
839a2a5
fix: moving soures to src standard directory
pthierry-ledger Mar 11, 2025
7d460d1
fix: fully fixed unit testing
pthierry-ledger Mar 11, 2025
1527e4f
build: make python generation from protobuf automatic through tox
pthierry-ledger Mar 11, 2025
d4fb42d
fix: remove useless from manifest file
pthierry-ledger Mar 11, 2025
f9e5d3c
build: adding lint target to tox
pthierry-ledger Mar 11, 2025
1af7d0e
fix: add doc generation target to tox
pthierry-ledger Mar 11, 2025
df2810a
ci: adding CI workflow with usual python jobs
pthierry-ledger Mar 11, 2025
17b2385
ci: ensure unit testing on various python versions used
pthierry-ledger Mar 11, 2025
26cac16
Merge pull request #5 from LedgerHQ/fix/pythonic-model
pthierry-ledger Mar 11, 2025
8eaca0d
Merge pull request #6 from LedgerHQ/fix/doc-build
pthierry-ledger Mar 11, 2025
8f89794
Merge pull request #7 from LedgerHQ/ci/adding-pythonic-workflows
pthierry-ledger Mar 11, 2025
08b3779
ci: adding doc build
pthierry-ledger Mar 11, 2025
f874aa5
fix: removing py36 test as no more supported at CI level
pthierry-ledger Mar 11, 2025
68acc9f
build: fixing doc ToX target with missing deps
pthierry-ledger Mar 11, 2025
e737021
Merge pull request #8 from LedgerHQ/ci/adding-doc
pthierry-ledger Mar 11, 2025
13f9533
ci: adding jfrog publication
pthierry-ledger Mar 11, 2025
e5553b6
ci: removing useless Nexus publishing
pthierry-ledger Mar 31, 2025
a640945
Merge pull request #9 from LedgerHQ/ci/adding-jfrog-cd
pthierry-ledger Mar 31, 2025
03f0b03
ci: update Ledger runner tag after renaming
pthierry-ledger Mar 31, 2025
265a6ef
Merge pull request #10 from LedgerHQ/fix/public-runner-name
pthierry-ledger Mar 31, 2025
6f87906
build: removing generated files from gconf
pthierry-ledger Mar 31, 2025
eefc842
build: removing deprecated license field
pthierry-ledger Mar 31, 2025
631e5b3
build: adding py file generation for unit testing
pthierry-ledger Mar 31, 2025
cd1151b
doc: updating README to describes the tox-based production system
pthierry-ledger Apr 1, 2025
86985f4
Merge pull request #11 from LedgerHQ/fix/pythonic-version
pthierry-ledger Apr 2, 2025
daa090c
fix: fixing minimum version of grpcio dep
pthierry-ledger Apr 10, 2025
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
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: build package

on:
pull_request:
branches:
- main
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install tox
- name: Run linters
run: |
tox -e genproto
tox -e build || true

test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
pyversion:
- '3.8'
- '3.10'
- '3.12'
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
python-version: ${{ matrix.pyversion }}
- run: |
pip install tox
- name: Run unittests
run: |
tox -e genproto
tox -e unittests

lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install tox
- name: Run linters
run: |
tox -e genproto
tox -e lint || true

doc:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install tox
- name: Run linters
run: |
tox -e genproto
tox -e doc
95 changes: 95 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: build

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: public-ledgerhq-shared-small
permissions:
id-token: write
contents: read
attestations: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install tox
tox -e genproto
tox -e build
# initiate jfrog login and install jf
- name: Login to JFrog Ledger
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
# upload package to jfrog
- name: upload package
run: jf rt u --build-name=python-etcd3-release --build-number=1 --module=etcd3 'dist/*.tar.gz' enclave-pypi-prod-green
# attest that the delivered package is authenticated as a CI build
- name: Attest
id: attest
uses: LedgerHQ/actions-security/actions/attest@actions/attest-1
with:
subject-path: 'dist/*.tar.gz'
push-to-registry: false
- uses: LedgerHQ/actions/gemfury/publish@main
env:
PUSH_TOKEN: ${{ secrets.PYPI_PUSH_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: dist-${{ github.run_id }}
path: |
dist
retention-days: 2

validate:
runs-on: public-ledgerhq-shared-small
permissions:
id-token: write
contents: read
needs:
- publish
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist-${{ github.run_id }}
path: dist
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- run: |
pip install build twine wheel-filename blob
# in order to allow test pip install after publish, get back pkg version
- name: get back local build version
id: get_pkg_version
run: |
from wheel_filename import parse_wheel_filename
import glob
import os
from random import choices
from string import ascii_letters

whl = str(glob.glob('dist/*.whl')[0]);
pwf = parse_wheel_filename('dist/' + whl);
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_output:
delimiter = "".join(choices(ascii_letters, k=16))
gh_output.writelines([
f"pkg_version<<{delimiter}\n",
f"{pwf.version}\n",
delimiter + "\n",
])
shell: python
- name: Login to JFrog Ledger
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
# configure jfrog repo and test pip install from it for the delivered package
- name: set jfrog Repo URL
run: jf pipc --global --repo-resolve=enclave-pypi-virtual-green
- name: test install from jfrog
run: |
jf pip install etcd3==${{ steps.get_pkg_version.outputs.pkg_version }}
pip show etcd3
shell: bash
4 changes: 0 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include requirements/base.txt
include requirements/test.txt

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
24 changes: 23 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,29 @@ If you're interested in using this library, please get involved.
* Free software: Apache Software License 2.0
* Documentation: https://python-etcd3.readthedocs.io.

Basic usage:

Building python package
-----------------------

The package build is made using the ToX orchestrator.
It is required to generate python files before building the package as they are
not kept in gconf.
You only need the ToX orchestrator to produce the package:

```
pip install tox
```

A typical build sequence is the folling:

```
tox -e genproto
tox -e build
```


Basic usage
-----------

.. code-block:: python

Expand Down
177 changes: 0 additions & 177 deletions docs/Makefile

This file was deleted.

Empty file added docs/_static/.placeholder
Empty file.
Loading