Page MenuHomePhabricator

[tbs] Create a tutorial/howto work with diffent python version using pyenv+tox
Closed, ResolvedPublic

Description

We want to improve and learn how to develop with different version op python using the current tooling.

This task is to investigate, play and write down a small tutorial on how to use pyenv with tox and potentially poetry
too.

Feel free to investigate different ways of using those tools, don't feel bound by the ways we use them in existing
projects, but focus on being able to test in the different constraints that we found ourselves in (pythons
3.8/3.9/3.10/3.11, different OSes debian/mac/ubuntu).

Integration with some ides might be interesting too, but not necessary.

Event Timeline

dcaro triaged this task as High priority.Feb 21 2023, 2:44 PM
dcaro created this task.
dcaro added a project: Toolforge Build Service.

My personal "go-to" is pyenv + pyenv-virtualenv for projects without poetry, or pyenv + poetry. In both cases, I resort to tox if I want to run tests across different versions. For CI via GitHub actions, it's easy to set up a matrix of different OS + python version combinations to test across. I don't have experience with setting this up in other CI runners.

Anecdotally, I've been experimenting a bit with nix flakes + direnv for personal projects, and while the nix universe is quite complex and (often) ill-documented, I think it has some potential for reproducible and deterministic dev environments.
https://determinate.systems/posts/nix-direnv

Feel free to investigate different ways of using those tools, don't feel bound by the ways we use them in existing
projects, but focus on being able to test in the different constraints that we found ourselves in (pythons
3.8/3.9/3.10/3.11, different OSes debian/mac/ubuntu).

Cross-platform testing is an altogether different beast than testing across different Python versions. We could have different versions of run_ci_locally.sh for debian/ubuntu, but macOS can't run as a container in Docker. That leaves testing in a VM as the only option, but this adds a lot of complexity compared to macOS users just complaining loudly if/when something breaks, then fixing it.

dcaro raised the priority of this task from High to Needs Triage.Mar 6 2023, 3:07 PM

A draft of this tutorial can be found here: https://docs.google.com/document/d/1pl6QCDWGebGjRrHixgQNES8qRf-8PCzwLSsFj7jI1HY/edit?usp=sharing

It needs some editing but is ready for review from a content point of view. Once finished, it will be transferred to the wikis.

Slst2020 changed the task status from Open to Stalled.May 3 2023, 2:01 PM