Skip to content

Commit dce27f7

Browse files
authored
Merge branch 'main' into pnet
2 parents 4d8a984 + c94d6d5 commit dce27f7

File tree

5 files changed

+43
-11
lines changed

5 files changed

+43
-11
lines changed

.github/workflows/tox.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
with:
3939
python-version: ${{ matrix.python }}
4040

41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v4
43+
with:
44+
version: "latest"
45+
4146
- name: Install Nim for interop testing
4247
if: matrix.toxenv == 'interop'
4348
run: |
@@ -65,11 +70,14 @@ jobs:
6570
./scripts/setup_nim_echo.sh
6671
6772
- run: |
68-
python -m pip install --upgrade pip
69-
python -m pip install tox
73+
uv venv venv
74+
source venv/bin/activate
75+
uv pip install --upgrade pip
76+
uv pip install tox
7077
7178
- name: Run Tests or Generate Docs
7279
run: |
80+
source venv/bin/activate
7381
if [[ "${{ matrix.toxenv }}" == 'docs' ]]; then
7482
export TOXENV=docs
7583
else
@@ -95,13 +103,20 @@ jobs:
95103
uses: actions/setup-python@v5
96104
with:
97105
python-version: ${{ matrix.python-version }}
106+
- name: Install uv
107+
uses: astral-sh/setup-uv@v4
108+
with:
109+
version: "latest"
98110
- name: Install dependencies
99111
run: |
100-
python -m pip install --upgrade pip
101-
python -m pip install tox
112+
uv venv venv
113+
source venv/Scripts/activate
114+
uv pip install --upgrade pip
115+
uv pip install tox
102116
- name: Test with tox
103117
shell: bash
104118
run: |
119+
source venv/Scripts/activate
105120
if [[ "${{ matrix.toxenv }}" == "wheel" ]]; then
106121
python -m tox run -e windows-wheel
107122
else

newsfragments/997.performance.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Migrated CI/CD pipeline from pip to uv for improved build performance and faster dependency resolution.
2+
3+
**Performance Improvements:**
4+
- Windows wheel tests: 60%+ faster package building
5+
- Linux lint tests: 14% average improvement
6+
- Linux interop tests: 6% average improvement
7+
- Overall CI/CD pipeline: significantly faster execution
8+
9+
**Technical Changes:**
10+
- Updated GitHub Actions workflows to use uv instead of pip
11+
- Modified tox.ini to use uv for package installation
12+
- Updated scripts to use uv commands
13+
- Maintained full compatibility with existing test environments

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ version = "0.3.0"
88
description = "libp2p: The Python implementation of the libp2p networking stack"
99
readme = "README.md"
1010
requires-python = ">=3.10, <4.0"
11-
license = { text = "MIT AND Apache-2.0" }
11+
license = "MIT AND Apache-2.0"
1212
keywords = ["libp2p", "p2p"]
1313
maintainers = [
1414
{ name = "pacrob", email = "[email protected]" },
1515
{ name = "Manu Sheel Gupta", email = "[email protected]" },
1616
{ name = "Dave Grantham", email = "[email protected]" },
17+
{ name = "Luca (acul71)" },
1718
]
1819
dependencies = [
1920
"aioquic>=1.2.0",

scripts/release/test_package.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def create_venv(parent_path: Path) -> Path:
1212
venv_path = parent_path / "package-smoke-test"
1313
venv.create(venv_path, with_pip=True)
1414
subprocess.run(
15-
[venv_path / "bin" / "pip", "install", "-U", "pip", "setuptools"], check=True
15+
[venv_path / "bin" / "uv", "pip", "install", "-U", "pip", "setuptools"],
16+
check=True,
1617
)
1718
return venv_path
1819

@@ -31,7 +32,7 @@ def find_wheel(project_path: Path) -> Path:
3132

3233
def install_wheel(venv_path: Path, wheel_path: Path) -> None:
3334
subprocess.run(
34-
[venv_path / "bin" / "pip", "install", f"{wheel_path}"],
35+
[venv_path / "bin" / "uv", "pip", "install", f"{wheel_path}"],
3536
check=True,
3637
)
3738

tox.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ deps=
5050
allowlist_externals=
5151
/bin/rm
5252
/bin/bash
53+
uv
5354
commands=
54-
python -m pip install --upgrade pip
55+
uv pip install --upgrade pip
5556
/bin/rm -rf build dist
5657
python -m build
57-
/bin/bash -c 'python -m pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --progress-bar off'
58+
/bin/bash -c 'uv pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --no-progress'
5859
python -c "import libp2p"
5960
skip_install=true
6061

@@ -64,12 +65,13 @@ deps=
6465
build[virtualenv]
6566
allowlist_externals=
6667
bash.exe
68+
uv
6769
commands=
6870
python --version
69-
python -m pip install --upgrade pip
71+
uv pip install --upgrade pip
7072
bash.exe -c "rm -rf build dist"
7173
python -m build
72-
bash.exe -c 'python -m pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --progress-bar off'
74+
bash.exe -c 'uv pip install --upgrade "$(ls dist/libp2p-*-py3-none-any.whl)" --no-progress'
7375
python -c "import libp2p"
7476
skip_install=true
7577

0 commit comments

Comments
 (0)