Skip to content

Commit

Permalink
perf(snap): speed up repeat snap builds
Browse files Browse the repository at this point in the history
This change caches the python-apt wheel, speeding up repeated builds of the snap in the same provider.
  • Loading branch information
lengau committed Oct 11, 2023
1 parent 7c3170d commit da21951
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements-focal.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.0.1ubuntu0.20.04.1/python-apt_2.0.1ubuntu0.20.04.1.tar.xz; sys_platform == 'linux'
python-apt@https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.0.1ubuntu0.20.04.1/python-apt_2.0.1ubuntu0.20.04.1.tar.xz
2 changes: 1 addition & 1 deletion requirements-jammy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz; sys_platform == 'linux'
python-apt@https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz
18 changes: 16 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ parts:
# As of cryptography 39, it requires rust v1.48.0 or newer, which is available from focal-updates.
# This part builds the wheel for cryptography.
cryptography-deps:
plugin: dump
plugin: nil
source: .
build-packages:
- cargo
Expand Down Expand Up @@ -115,8 +115,22 @@ parts:
snapcraftctl build
install -D -m 0755 $SNAPCRAFT_PROJECT_DIR/snap/local/sitecustomize.py $SNAPCRAFT_PART_INSTALL/usr/lib/python3.8/sitecustomize.py
python-apt:
after: [python3]
plugin: nil
source: .
build-packages:
- libapt-pkg-dev
- python3.8-dev
- libpython3.8-dev
build-environment:
- LDFLAGS: -L/usr/lib/python3.8
- CPPFLAGS: -I/usr/include/python3.8
override-build: |
pip wheel $(cat requirements-focal.txt)
charmcraft:
after: [python3, cryptography-deps]
after: [python3, cryptography-deps, python-apt]
source: .
plugin: python
requirements:
Expand Down

0 comments on commit da21951

Please sign in to comment.