Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Makefile by changing the following prerequisite name: .venv -> venv #99

Closed
wants to merge 1 commit into from

Conversation

anmyachev
Copy link
Contributor

Closes #98

Before this change, the prerequisite was not executed correctly (at least for GNU Make 4.3).

python3 -m venv $(VENV)
$(MAKE) install-deps

.PHONY: install-deps
install-deps: .venv ## Install Python project dependencies
install-deps: ## Install Python project dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid recursion.

@anmyachev anmyachev marked this pull request as ready for review April 4, 2024 12:07
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

This is not valid. The folder is called .venv.

@stinodego stinodego closed this Apr 4, 2024
@anmyachev
Copy link
Contributor Author

This is not valid. The folder is called .venv.

@stinodego Previous approach is more error-prone, since if an error occurs during the process of building the environment, then it will be difficult to understand what happened later.

Prerequisite doesn't have to be a file name, right? Locally, with my changes, the output is something like this:

make run-pandas
python3 -m venv .venv
make install-deps
make[1]: Entering directory '/home/anatoly/tpch'
.venv/bin/python -m pip install --upgrade uv
Requirement already satisfied: uv in ./.venv/lib/python3.10/site-packages (0.1.28)
.venv/bin/uv pip install -r requirements.txt
Audited 39 packages in 6ms
.venv/bin/uv pip install -r requirements-dev.txt
Audited 7 packages in 1ms
make[1]: Leaving directory '/home/anatoly/tpch'
.venv/bin/python -m queries.pandas.executor

It’s still fast, even if it checks not for the presence of a folder, but for installed dependencies in the environment.

@anmyachev anmyachev mentioned this pull request Apr 4, 2024
@anmyachev
Copy link
Contributor Author

@stinodego one more thought. In the current implementation, two calls in a row will not work (for example, make tables & make run-pandas), since with the second call the folder (.venv) will already be created and the virtual environment will not be activated.

@stinodego
Copy link
Member

Prerequisite doesn't have to be a file name, right?

It does, that is the whole idea of a Makefile.

I'd like to keep the current structure, at least for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make tables failed
2 participants