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

make fails with Python 3.10 #7

Open
stevepiercy opened this issue Sep 18, 2022 · 0 comments
Open

make fails with Python 3.10 #7

stevepiercy opened this issue Sep 18, 2022 · 0 comments

Comments

@stevepiercy
Copy link

This section will cause make to fail because it evaluates 3.10 as a float, or 3.1, which is less than 3.7.

# version ok?
PYTHON_VERSION_MIN=3.7
PYTHON_VERSION_OK=$(shell $(PYTHON) -c 'import sys; print(int(float("%d.%d"% sys.version_info[0:2]) >= float($(PYTHON_VERSION_MIN))))' )
ifeq ($(PYTHON_VERSION_OK),0)
$(error "Need python $(PYTHON_VERSION) >= $(PYTHON_VERSION_MIN)")
endif

Makefile:127: *** "Need python 0 >= 3.7". Stop.

This works by comparing tuples.

PYTHON_VERSION_MIN="(3, 7)"
PYTHON_VERSION_OK=$(shell $(PYTHON) -c 'import sys; from ast import literal_eval; print(int(sys.version_info[0:2] >= literal_eval($(PYTHON_VERSION_MIN))))' )
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

No branches or pull requests

1 participant