Skip to content

Commit

Permalink
chore(python): Rename venv folder to .venv (#7790)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Mar 26, 2023
1 parent aaf6155 commit 8763812
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Create virtual environment
working-directory: py-polars
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/py-polars/venv/bin" >> $GITHUB_PATH
python -m venv .venv
echo "$GITHUB_WORKSPACE/py-polars/.venv/bin" >> $GITHUB_PATH
- name: Install Python dependencies
working-directory: py-polars
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:

- name: Create virtual environment
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/py-polars/venv/bin" >> $GITHUB_PATH
python -m venv .venv
echo "$GITHUB_WORKSPACE/py-polars/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ data/
node_modules/
polars/vendor
target/
venv/
.venv/
.vim
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ make test

This will do a number of things:

- Use Python to create a virtual environment in the `py-polars/venv` folder.
- Use Python to create a virtual environment in the `py-polars/.venv` folder.
- Use [pip](https://pip.pypa.io/) to install all Python dependencies for development, linting, and building documentation.
- Use Rust to compile and install Polars in your virtual environment.
- Use [pytest](https://docs.pytest.org/) to run the Python unittests in your virtual environment
Expand Down
3 changes: 2 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
],
"excludes": [
"**/target",
"py-polars/venv"
"py-polars/.pytest_cache",
"py-polars/.venv"
],
"plugins": [
"https://plugins.dprint.dev/markdown-0.15.2.wasm",
Expand Down
2 changes: 1 addition & 1 deletion py-polars/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
wheels/
!Cargo.lock
target/
venv/
.venv/
.hypothesis
.DS_Store
.ruff_cache/
22 changes: 11 additions & 11 deletions py-polars/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@

PYTHONPATH=
SHELL=/bin/bash
VENV = venv
VENV = .venv

ifeq ($(OS),Windows_NT)
VENV_BIN=$(VENV)/Scripts
else
VENV_BIN=$(VENV)/bin
endif

venv: ## Set up virtual environment and install requirements
.venv: ## Set up virtual environment and install requirements
python3 -m venv $(VENV)
$(MAKE) requirements

.PHONY: requirements
requirements: venv ## Install/refresh all project requirements
requirements: .venv ## Install/refresh all project requirements
$(VENV_BIN)/python -m pip install --upgrade pip
$(VENV_BIN)/pip install -r requirements-dev.txt
$(VENV_BIN)/pip install -r requirements-lint.txt
$(VENV_BIN)/pip install -r docs/requirements-docs.txt

.PHONY: build
build: venv ## Compile and install Polars for development
build: .venv ## Compile and install Polars for development
@unset CONDA_PREFIX && source $(VENV_BIN)/activate && maturin develop

.PHONY: build-release
build-release: venv ## Compile and install a faster Polars binary
build-release: .venv ## Compile and install a faster Polars binary
@unset CONDA_PREFIX && source $(VENV_BIN)/activate && maturin develop --release

.PHONY: fmt
fmt: venv ## Run autoformatting and linting
fmt: .venv ## Run autoformatting and linting
$(VENV_BIN)/black .
$(VENV_BIN)/blackdoc .
$(VENV_BIN)/ruff .
Expand All @@ -48,25 +48,25 @@ clippy: ## Run clippy
pre-commit: fmt clippy ## Run all code quality checks

.PHONY: test
test: venv build ## Run fast unittests
test: .venv build ## Run fast unittests
$(VENV_BIN)/pytest -n auto --dist worksteal

.PHONY: doctest
doctest: venv build ## Run doctests
doctest: .venv build ## Run doctests
$(VENV_BIN)/python tests/docs/run_doctest.py

.PHONY: test-all
test-all: venv build ## Run all tests
test-all: .venv build ## Run all tests
$(VENV_BIN)/pytest -n auto --dist worksteal -m "slow or not slow"
$(VENV_BIN)/python tests/docs/run_doctest.py

.PHONY: coverage
coverage: venv build ## Run tests and report coverage
coverage: .venv build ## Run tests and report coverage
$(VENV_BIN)/pytest --cov -n auto --dist worksteal -m "not benchmark"

.PHONY: clean
clean: ## Clean up caches and build artifacts
@rm -rf venv/
@rm -rf .venv/
@rm -rf target/
@rm -rf docs/build/
@rm -rf docs/source/reference/api/
Expand Down

0 comments on commit 8763812

Please sign in to comment.