Skip to content

Commit 1d7eb47

Browse files
committed
Avoid building package during dependencies installation
1 parent e24e2bb commit 1d7eb47

File tree

2 files changed

+57
-20
lines changed

2 files changed

+57
-20
lines changed

.github/workflows/multiplatform_build.yaml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,49 @@ jobs:
4040
arch: "x64"
4141
env: true
4242

43-
- if: matrix.os == 'ubuntu-24.04'
44-
name: Install dependencies
45-
run: sudo apt-get install libtinfo5
46-
47-
- if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
48-
name: Set CXXFLAGS
49-
run: export CXXFLAGS="-stdlib=libc++"
43+
- if: startsWith(matrix.os, 'ubuntu')
44+
name: Install ubuntu specific dependencies
45+
run: |
46+
sudo add-apt-repository universe
47+
sudo add-apt-repository restricted
48+
sudo add-apt-repository multiverse
49+
sudo apt-get update
50+
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
51+
libreadline-dev libsqlite3-dev wget curl llvm \
52+
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
53+
libffi-dev liblzma-dev python3-openssl git
54+
55+
- if: endsWith(matrix.os, '20.04')
56+
name: Install ubuntu-20.04 specific dependencies
57+
run: |
58+
sudo apt-get install -y software-properties-common
59+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
60+
sudo apt-get update
61+
sudo apt-get install -y libtinfo5
62+
sudo apt install gcc-13 g++-13
63+
64+
- if: endsWith(matrix.os, '22.04')
65+
name: Install ubuntu-22.04 specific dependencies
66+
run: |
67+
sudo apt-get install -y software-properties-common
68+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
69+
sudo apt-get update
70+
sudo apt-get install -y libtinfo5
71+
sudo apt install gcc-13 g++-13
72+
73+
- if: endsWith(matrix.os, '24.04')
74+
name: Install ubuntu-24.04 specific dependencies
75+
run: |
76+
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy main"
77+
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy universe"
78+
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy multiverse"
79+
sudo apt-get update
80+
sudo apt-get install -y libtinfo5
81+
82+
- if: startsWith(matrix.os, 'windows')
83+
name: Install Python dependencies
84+
run: |
85+
chcp 65001 #set code page to utf-8
5086
5187
- name: Set up Python ${{ matrix.python-version }}
5288
uses: actions/[email protected]
@@ -57,13 +93,13 @@ jobs:
5793
- name: Install Poetry
5894
run: pip install poetry==1.8.3
5995

60-
- name: Install Python dependencies
61-
run: poetry install --no-cache --sync
96+
- name: Install project dependencies
97+
run: poetry install --no-cache --sync --no-root
6298

6399
- name: Build distribution package
64100
run: poetry build --format wheel
65101

66102
- uses: actions/upload-artifact@v4
67103
with:
68-
name: build-${{ matrix.os }}-${{ matrix.python-version }}
104+
name: build-${{ github.sha }}-${{ matrix.os }}-${{ matrix.python-version }}
69105
path: ./dist/*

build.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,33 @@
88
from pathlib import Path
99
import multiprocessing
1010

11+
1112
THIS_DIR = Path(__file__).parent
1213

1314

1415
class Builder:
1516
"""Class responsible for building epseon_backend binaries."""
1617

17-
DEPS: tuple[tuple[str, str], ...] = (
18-
("googletest", "release-1.12.1"),
19-
("spdlog", "v1.12.0"),
20-
("pybind11", "v2.11.1"),
21-
("fmt", "10.1.1"),
22-
("vma_hpp", "v3.0.1-3"),
23-
)
24-
2518
def __init__(self) -> None:
2619
"""Initialize builder object."""
2720
self.repo_path = Path(__file__).parent
2821

2922
def build(self) -> None:
3023
"""Build extension module."""
24+
build_directory = Path.cwd() / "build"
25+
os.environ["PATH"] += os.pathsep + os.path.dirname(sys.executable)
3126
self.cmake(
32-
"-S", ".", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", "-G", "Ninja"
27+
"-S",
28+
".",
29+
"-B",
30+
build_directory.as_posix(),
31+
"-DCMAKE_BUILD_TYPE=Release",
32+
"-G",
33+
"Ninja",
3334
)
3435
self.cmake(
3536
"--build",
36-
"build",
37+
build_directory.as_posix(),
3738
"--target",
3839
"PyGerberGerberParserCpp",
3940
"-j",

0 commit comments

Comments
 (0)