Getting started시작하기
From installing ppp to a package with per-target dependencies and a first build.
ppp 설치부터 타깃별 의존성을 가진 패키지와 첫 빌드까지.
1. Prerequisites1. 준비물
| Need필요한 것 | Why이유 |
|---|---|
uvuv | It installs pypackpack, and every dependency operation runs it. When none is on PATH at run time, pypackpack downloads one into ~/.pypackpack/uv.pypackpack 을 설치하고, 모든 의존성 작업이 이것을 실행합니다. 실행할 때 PATH 에 없으면 pypackpack 이 ~/.pypackpack/uv 에 내려받습니다. |
| A supported platform지원 플랫폼 | The wheel carries a native binary: macOS 11+ on Apple silicon, Linux x86_64 and aarch64 (glibc), Windows x86_64. Elsewhere, build from a checkout (below).휠에는 네이티브 바이너리가 들어 있습니다: Apple silicon 의 macOS 11+, Linux x86_64 와 aarch64 (glibc), Windows x86_64. 그 밖의 플랫폼에서는 체크아웃에서 빌드하세요 (아래). |
| Network access네트워크 | uv, wheels, Python distributions and, for ppp build, meson and ninja (installed with uv tool install when missing).uv, 휠, Python 배포판, 그리고 ppp build 에 쓰이는 meson, ninja (없으면 uv tool install 로 설치). |
2. Install the command line2. 명령줄 도구 설치
uv tool install pypackpack # puts pypackpack and ppp on PATH
ppp --version # from 0.3.0; on 0.2.0 use ppp version
ppp version # pypackpack and uv versions
ppp --help
uvx pypackpack --help # or run it without installing
To upgrade later: uv tool upgrade pypackpack.
나중에 올리려면 uv tool upgrade pypackpack.
Build from a checkout instead대신 체크아웃에서 빌드하기
For an unreleased change or an unsupported platform. Needs JDK 21 (the wrapper brings Gradle).
아직 배포되지 않은 변경이나 지원하지 않는 플랫폼용입니다. JDK 21 이 필요합니다 (Gradle 은 래퍼가 받아옵니다).
git clone -b develop https://github.com/thisisthepy/pypackpack
cd pypackpack
./gradlew :packpack:installCliDist
alias ppp="$PWD/packpack/build/install/pypackpack/bin/pypackpack"
For one self-contained binary, ./gradlew :packpack:nativeCompile writes packpack/build/native/nativeCompile/pypackpack with GraalVM Native Image (GraalVM as JAVA_HOME). The PyPI wheels carry the same binary.
실행 파일 하나로 쓰려면 ./gradlew :packpack:nativeCompile 가 GraalVM Native Image 로 packpack/build/native/nativeCompile/pypackpack 를 만듭니다 (JAVA_HOME 이 GraalVM 이어야 함). PyPI 휠에 든 것과 같은 바이너리입니다.
3. A project and a package3. 프로젝트와 패키지
ppp init myapp --python 3.15t # uv init --bare --no-workspace, plus .gitignore, README.md, LICENSE
cd myapp
ppp package add packages/core # a uv workspace member with ppp's scaffolding
ppp target add aarch64-linux-android arm64-apple-ios
myapp/
├── pyproject.toml # [tool.ppp.dependencies].platforms, [tool.uv.workspace].members
└── packages/core/
├── pyproject.toml
├── src/main/__init__.py # platform-common code
├── src/android/__init__.py # one directory per target family, from `target add`
├── src/ios/__init__.py
├── src/test/test_import.py
└── build/{crossenv,packpack}/
Put your modules in a package directory such as src/main/core/. With only the scaffold's src/main/__init__.py, ppp build falls back to scanning src/ and installs main, android and ios as top-level packages.
모듈은 src/main/core/ 같은 패키지 디렉터리에 두세요. 스캐폴드의 src/main/__init__.py 만 있으면 ppp build 가 src/ 를 대신 훑어 main, android, ios 를 최상위 패키지로 설치합니다.
4. Dependencies per target4. 타깃별 의존성
ppp core add requests # one marker per target in the package's platforms
ppp core add six --target arm64-apple-ios # only for that target
ppp core sync --target aarch64-linux-android arm64-apple-ios \
--python-version 3.15 --only-binary :all: # → packages/core/build/crossenv/<triple>/
ppp core tree --target arm64-apple-ios
5. Build5. 빌드
ppp build core --target aarch64-apple-darwin
# → packages/core/dist/aarch64-apple-darwin/debug/instant/ (meson install --destdir)
ppp build core resource --target aarch64-linux-android
# → packages/core/build/packpack/resource/debug/instant/ (the bundle python-multiplatform loads)
ppp build generates a meson.build, compiles C/C++ extensions and installs the package for the host. It does not cross-compile C/C++ yet. Given a bundle kind (source or resource), build also bundles: see Build levels & bundles. Next: Projects, targets & dependencies.
ppp build 는 meson.build 를 생성하고, C/C++ 확장을 컴파일하고, 호스트용으로 패키지를 설치합니다. C/C++ 크로스 컴파일은 아직 하지 않습니다. 번들 종류 (source 또는 resource) 를 주면 build 가 번들까지 만듭니다: 빌드 레벨과 번들 을 보세요. 다음: 프로젝트, 타깃, 의존성.