Skip to content

Commit

Permalink
Avoid building package during dependencies installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Oct 10, 2024
1 parent e24e2bb commit 63149f9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/multiplatform_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,23 @@ jobs:
arch: "x64"
env: true

- if: matrix.os == 'ubuntu-24.04'
name: Install dependencies
run: sudo apt-get install libtinfo5

- if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
name: Set CXXFLAGS
run: export CXXFLAGS="-stdlib=libc++"
- if: startsWith(matrix.os, 'ubuntu')
name: Install Python dependencies
run: |
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm \
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
libffi-dev liblzma-dev python3-openssl git libtinfo5
export CXXFLAGS="-stdlib=libc++"
- if: startsWith(matrix.os, 'windows')
name: Install Python dependencies
run: |
chcp 65001 #set code page to utf-8
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
Expand All @@ -57,13 +67,13 @@ jobs:
- name: Install Poetry
run: pip install poetry==1.8.3

- name: Install Python dependencies
run: poetry install --no-cache --sync
- name: Install project dependencies
run: poetry install --no-cache --sync --no-root

- name: Build distribution package
run: poetry build --format wheel

- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}-${{ matrix.python-version }}
name: build-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
path: ./dist/*
21 changes: 11 additions & 10 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@
from pathlib import Path
import multiprocessing


THIS_DIR = Path(__file__).parent


class Builder:
"""Class responsible for building epseon_backend binaries."""

DEPS: tuple[tuple[str, str], ...] = (
("googletest", "release-1.12.1"),
("spdlog", "v1.12.0"),
("pybind11", "v2.11.1"),
("fmt", "10.1.1"),
("vma_hpp", "v3.0.1-3"),
)

def __init__(self) -> None:
"""Initialize builder object."""
self.repo_path = Path(__file__).parent

def build(self) -> None:
"""Build extension module."""
build_directory = Path.cwd() / "build"
os.environ["PATH"] += os.pathsep + os.path.dirname(sys.executable)
self.cmake(
"-S", ".", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", "-G", "Ninja"
"-S",
".",
"-B",
build_directory.as_posix(),
"-DCMAKE_BUILD_TYPE=Release",
"-G",
"Ninja",
)
self.cmake(
"--build",
"build",
build_directory.as_posix(),
"--target",
"PyGerberGerberParserCpp",
"-j",
Expand Down

0 comments on commit 63149f9

Please sign in to comment.