Skip to content

Commit

Permalink
chore(python): Fix make requirements when conda environment is acti…
Browse files Browse the repository at this point in the history
…ve (#14693)
  • Loading branch information
stinodego committed Feb 26, 2024
1 parent 698e417 commit b8e1f31
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ jobs:
env:
RUSTFLAGS: -C embed-bitcode -D warnings
working-directory: py-polars
run: |
source activate
maturin develop --release -- -C codegen-units=8 -C lto=thin -C target-cpu=native
run: maturin develop --release -- -C codegen-units=8 -C lto=thin -C target-cpu=native

- name: Run H2O AI database benchmark - on strings
working-directory: py-polars/tests/benchmark
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ jobs:
run: cargo test --all-features -p polars --test it

- name: Install Polars
run: |
source activate
maturin develop
run: maturin develop

- name: Run Python tests
run: pytest --cov -n auto --dist loadgroup -m "not benchmark and not docs" --cov-report xml:main.xml
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docs-global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ jobs:

- name: Install Polars
working-directory: py-polars
run: |
source activate
maturin develop
run: maturin develop

- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ jobs:
save-if: ${{ github.ref_name == 'main' }}

- name: Install Polars
run: |
source activate
maturin develop
run: maturin develop

- name: Run doctests
if: github.ref_name != 'main' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
Expand Down
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,64 @@ FILTER_PIP_WARNINGS=| grep -v "don't match your environment"; test $${PIPESTATUS

.PHONY: requirements
requirements: .venv ## Install/refresh Python project requirements
$(VENV_BIN)/python -m pip install --upgrade uv
$(VENV_BIN)/uv pip install --upgrade -r py-polars/requirements-dev.txt
$(VENV_BIN)/uv pip install --upgrade -r py-polars/requirements-lint.txt
$(VENV_BIN)/uv pip install --upgrade -r py-polars/docs/requirements-docs.txt
$(VENV_BIN)/uv pip install --upgrade -r docs/requirements.txt
@unset CONDA_PREFIX \
&& $(VENV_BIN)/python -m pip install --upgrade uv \
&& $(VENV_BIN)/uv pip install --upgrade -r py-polars/requirements-dev.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r py-polars/requirements-lint.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r py-polars/docs/requirements-docs.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r docs/requirements.txt

.PHONY: build
build: .venv ## Compile and install Python Polars for development
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml \
$(FILTER_PIP_WARNINGS)

.PHONY: build-debug-opt
build-debug-opt: .venv ## Compile and install Python Polars with minimal optimizations turned on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
&& maturin develop -m py-polars/Cargo.toml --profile opt-dev \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --profile opt-dev \
$(FILTER_PIP_WARNINGS)

.PHONY: build-debug-opt-subset
build-debug-opt-subset: .venv ## Compile and install Python Polars with minimal optimizations turned on and no default features
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --no-default-features --profile opt-dev \
$(FILTER_PIP_WARNINGS)

.PHONY: build-opt
build-opt: .venv ## Compile and install Python Polars with nearly full optimization on and debug assertions turned off, but with debug symbols on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --profile debug-release \
$(FILTER_PIP_WARNINGS)

.PHONY: build-release
build-release: .venv ## Compile and install a faster Python Polars binary with full optimizations
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --release \
$(FILTER_PIP_WARNINGS)

.PHONY: build-native
build-native: .venv ## Same as build, except with native CPU optimizations turned on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml -- -C target-cpu=native \
$(FILTER_PIP_WARNINGS)

.PHONY: build-debug-opt-native
build-debug-opt-native: .venv ## Same as build-debug-opt, except with native CPU optimizations turned on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --profile opt-dev -- -C target-cpu=native \
$(FILTER_PIP_WARNINGS)

.PHONY: build-opt-native
build-opt-native: .venv ## Same as build-opt, except with native CPU optimizations turned on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --profile debug-release -- -C target-cpu=native \
$(FILTER_PIP_WARNINGS)

.PHONY: build-release-native
build-release-native: .venv ## Same as build-release, except with native CPU optimizations turned on
@unset CONDA_PREFIX && source $(VENV_BIN)/activate \
@unset CONDA_PREFIX \
&& maturin develop -m py-polars/Cargo.toml --release -- -C target-cpu=native \
$(FILTER_PIP_WARNINGS)

Expand Down

0 comments on commit b8e1f31

Please sign in to comment.