John Kealy
John Kealy

Reputation: 1883

How to manage Python versions for a virtualenv in my open source project?

I have an open source project called Djengu. To install it, the user must clone the repo and run make to initiate the setup script. The setup script creates a Python virtual environment using virtualenv. The command goes like

virtualenv -p python3.8 .python3.8_env

I'd like to pin the Python version to avoid anything breaking. I also cannot assume that any given user will have a python3.8 binary installed on their machine. And I cannot assume that they have pyenv installed either.

I imagine I will have to make a trade off somewhere. How can I pin Python without making assumptions on what the user has installed? Is there a standard way to do something like this?

Upvotes: 0

Views: 236

Answers (1)

Marlon Richert
Marlon Richert

Reputation: 6985

Since your Djengu project is a development environment, I think it's completely fine to require that your users first install pyenv before calling make. Just tell them to do so in the Readme. You can then use their pyenv in your Makefile to install the Python version you need.

Upvotes: 1

Related Questions