Project setup
Learn how to setup a project and add the necessary dependencies and packages
Project setup
Clone the reference C# implementation. This will be used to guide us on creating the Go and Python versions of the CLI tool.
git clone https://github.com/XPRTZ/envtamer
Create a new Git repository for this workshop locally and push it on your own GitHub account. This will be the repository where we will work on.
github.com/username/envtamer-workshop
βββ go
βΒ Β βββ .gitkeep
βββ python
βββ .gitkeep
Go
Make sure you are in the go directory of the project
npx gitignore go
go mod init github.com/username/envtamer-workshop
go get -u github.com/spf13/cobra@latest
In the root of the go folder there should now be a go.mod file. This file lists all the dependencies.
Create the following folder structure. The structure is based on the recommended way to setup a Go project
βββ LICENSE
βββ README.md
βββ cmd
βΒ Β βββ envtamer
βββ go.mod
βββ go.sum
βββ internal
βββ command
βββ storage
βββ util
Python
Make sure you are in the go directory of the project
npx gitignore python
poetry new envtamer
poetry env use 3.13
poetry env activate
poetry add click
In the root of the envtamer folder there will be a pyproject.toml file. This file lists all the dependencies.
Create the following folder structure. The structure is based on the recommended way to setup a poetry python project
When opening the project in your IDE, make sure to select the correct Python interpreter. This should be the one created by poetry. You can check this by pressing ctr + shift + p and typing βPython: Select Interpreterβ. Select the one that has the path to the envtamer folder in it.
βββ envtamer
βΒ Β βββ __init__.py
βββ tests
βΒ Β βββ __init__.py
βββ poetry.lock
βββ pyproject.toml
βββ README.md