Hi, we are deciding what’s the best approach to se...
# best-practices
h
Hi, we are deciding what’s the best approach to set up a team development environment for our first Meltano app: 1. Install Meltano in a project-level python virtual environment, as illustrated in this Meltano guide (and potentially track meltano version in
requirements.txt
via git?) 2. Install Meltano using
pipx
Ideally, we want to be able to replicate the same dev environment (e.g. same python & meltano version) across the team easily. Not sure which approach is more maintainable in long run? Anyone can share your experiences on what would be the pros and cons of each approach, or perhaps can share your dev environment setup for us to reference? 🙂
s
What you want to do is to have not just Meltano but also Python versioned, this is going to have a big impact (because taps & targets all come with their own dependencies). I'm sure @alexander_butler e.g. has a lot to say about this, and I'd love to know how @pat_nadolny currently handles this... My take on this is: 1. Use docker as your dev environment. 2. If you don't want to do that, at the very least run your pre-commit and CI tests inside the same docker image that you version (including Python + Meltano). 3. Meltano makes is quite easy to do so by providing several combinations of python (going back to 2.8) + meltano versions on the docker hub.
s
+1 on docker; we use it for our meltano project, and it makes it super easy to share cross team
p
I'm a team of 1 so I dont have to really worry about this as of now 😄 but I'd second the docker setup. All developers can use the same docker image locally, also used in CI, and in prod. So its very consistent 👍
a
+1 for promoting Docker with the team, and also +1 for installing Meltano via
pipx
. (Meltano itself will auto-created venvs for all packages it installs, but it's important to also keep Meltano in its own venv, separate from any other python libraries or tools you might choose to install.
In terms of the Docker strategy, I highly recommend setting up a devcontainer for your repo; you can borrow this one if you want as a starting point: https://github.com/aaronsteers/meltano-demo-in-a-box/tree/main/.devcontainer
h
Ah interesting, I’m new to devcontainer, curious how the devcontainer is different from a normal docker container?
a
Devcontainers let you do two very cool things (more than two actually, but these are my favorite 🙂 )... 1. You can make sure every developer on the project starts from the same place, because dev happens inside the container. 2. You can launch the container directly from the cloud using GitHub Codespaces, or similar. 🚀
I logged an issue for us here to work on a reference implementation. Feel free to comment if you are interested or if you have suggestions. 👍
h
Sure! I will follow up in the PR. Just a quick question here, do you think it makes sense to always specify the python and meltano version in a team's dev container, to ensure all team members use the exact same dev env?
s
Yes! Indeed specifying the Python version in the dev container is quite critical, especially because the requirements on the Python versions differ between different taps & targets.