Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 45 additions & 25 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
uses: PyO3/maturin-action@v1.49.1
with:
target: x86_64
args: --release --locked --out dist
args: --release --locked --out dist -i python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed and we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had many interpreters available in the OS, we had to tell it specifically which one to use. It's complicated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I..... trust you

- name: "Upload wheels"
uses: actions/upload-artifact@v4.6.2
with:
Expand All @@ -101,10 +101,10 @@ jobs:
uses: PyO3/maturin-action@v1.49.1
with:
target: aarch64
args: --release --locked --out dist
args: --release --locked --out dist -i python3
- name: "Test wheel - aarch64"
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
pip install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
python -m ${{ env.MODULE_NAME }} --help
- name: "Upload wheels"
Expand All @@ -121,10 +121,7 @@ jobs:
platform:
- target: x86_64-pc-windows-msvc
arch: x64
- target: aarch64-pc-windows-msvc
arch: x64
# NOTE: Disabling this target due to poor support in PyArrow and
# friends.
# NOTE: i686 disabled due to poor support in PyArrow and friends.
#- target: i686-pc-windows-msvc
# arch: x86
steps:
Expand All @@ -140,15 +137,11 @@ jobs:
uses: PyO3/maturin-action@v1.49.1
with:
target: ${{ matrix.platform.target }}
args: --release --locked --out dist
env:
# aarch64 build fails, see https://github.com/PyO3/maturin/issues/2110
XWIN_VERSION: 16
args: --release --locked --out dist -i python3
- name: "Test wheel"
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
run: |
python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
python -m pip install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
python -m ${{ env.MODULE_NAME }} --help
- name: "Upload wheels"
Expand All @@ -157,6 +150,34 @@ jobs:
name: wheels-${{ matrix.platform.target }}
path: dist

windows-aarch64:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: windows-11-arm
steps:
- uses: actions/checkout@v4.2.2
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
- uses: actions/setup-python@v5.5.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build wheels"
uses: PyO3/maturin-action@v1.49.1
with:
target: aarch64-pc-windows-msvc
args: --release --locked --out dist -i python3
- name: "Test wheel"
shell: bash
run: |
python -m pip install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
python -m ${{ env.MODULE_NAME }} --help
- name: "Upload wheels"
uses: actions/upload-artifact@v4.6.2
with:
name: wheels-aarch64-pc-windows-msvc
path: dist

linux:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: ubuntu-latest
Expand All @@ -178,7 +199,7 @@ jobs:
uses: PyO3/maturin-action@v1.49.1
with:
manylinux: auto
args: --release --locked --out dist
args: --release --locked --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
before-script-linux: |
# If we're running on rhel centos, install needed packages.
if command -v yum &> /dev/null; then
Expand All @@ -197,7 +218,7 @@ jobs:
- name: "Test wheel"
if: ${{ startsWith(matrix.target, 'x86_64') }}
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
pip install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
python -m ${{ env.MODULE_NAME }} --help
- name: "Upload wheels"
Expand All @@ -216,7 +237,7 @@ jobs:
arch: aarch64
# see https://github.com/astral-sh/ruff/issues/3791
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 -e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1

steps:
- uses: actions/checkout@v4.2.2
Expand All @@ -232,7 +253,7 @@ jobs:
target: ${{ matrix.platform.target }}
manylinux: auto
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --locked --out dist
args: --release --locked --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# Set the CFLAGS for the aarch64 target, defining the ARM architecture
Expand All @@ -244,8 +265,8 @@ jobs:
if: ${{ matrix.platform.arch != 'ppc64' && matrix.platform.arch != 'ppc64le'}}
name: Test wheel
with:
arch: ${{ matrix.platform.arch == 'arm' && 'armv6' || matrix.platform.arch }}
distro: ${{ matrix.platform.arch == 'arm' && 'bookworm' || 'ubuntu22.04' }}
arch: ${{ matrix.platform.arch }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
Expand All @@ -258,7 +279,7 @@ jobs:
export CARGO_HOME=/tmp/cargo-home
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
pip3 install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
- name: "Upload wheels"
uses: actions/upload-artifact@v4.6.2
Expand Down Expand Up @@ -288,7 +309,7 @@ jobs:
with:
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --locked --out dist
args: --release --locked --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
- name: "Test wheel"
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
Expand All @@ -298,7 +319,7 @@ jobs:
run: |
apk add python3 python3-dev py3-pip rust
python -m venv .venv
.venv/bin/pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
.venv/bin/pip3 install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
.venv/bin/${{ env.EXECUTABLE_NAME }} --help
- name: "Upload wheels"
uses: actions/upload-artifact@v4.6.2
Expand Down Expand Up @@ -326,8 +347,7 @@ jobs:
with:
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --locked --out dist
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --locked --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
- uses: uraimo/run-on-arch-action@v2
name: Test wheel
with:
Expand All @@ -338,7 +358,7 @@ jobs:
apk add python3 python3-dev py3-pip rust
run: |
python -m venv .venv
.venv/bin/pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
.venv/bin/pip3 install ${{ env.PACKAGE_NAME }} --find-links dist/ --force-reinstall
.venv/bin/${{ env.EXECUTABLE_NAME }} --help
- name: "Upload wheels"
uses: actions/upload-artifact@v4.6.2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.venv
*.pyc
__pycache__
*.so


# may contain sensitive data
Expand Down
98 changes: 97 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ http = "1.1"
indicatif = "0.17"
nix = { version = "0.30", features = ["signal"] }
pem = "3"
pyo3 = { version = "0.24", features = ["extension-module"] }
promptly = "0.3"
rand = "0.8"
regex = "1"
Expand Down
18 changes: 16 additions & 2 deletions crates/tower-cmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub use error::Error;
pub struct App {
session: Option<Session>,
cmd: Command,
args: Option<Vec<String>>,
}

impl App {
Expand All @@ -38,7 +39,17 @@ impl App {
Session::from_config_dir().ok()
};

Self { cmd, session }
Self {
cmd,
session,
args: None,
}
}

pub fn new_from_args(args: Vec<String>) -> Self {
let mut app = Self::new();
app.args = Some(args);
app
}

async fn check_latest_version() -> Option<String> {
Expand All @@ -52,7 +63,10 @@ impl App {

pub async fn run(self) {
let mut cmd_clone = self.cmd.clone();
let matches = self.cmd.get_matches();
let matches = match self.args {
Some(args) => self.cmd.get_matches_from(args),
None => self.cmd.get_matches(),
};

let config = Config::from_arg_matches(&matches);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dlt[snowflake,filesystem]==1.4.0
pandas
requests
4 changes: 2 additions & 2 deletions crates/tower-runtime/tests/example-apps/03-legacy-app/task.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import dlt
import requests

print(dlt.version.__version__)
print(requests.__version__)
Loading