Objective | Contents | Execution
This repository intends to stand a reliable and consistent procedure for setting up a development environment for python projects.
Thus, the main dependencies for the project's structure organization are the following:
setup.sh
: Sets up a proper and isolated python environment, designed for both development and production purposes;pyproject.toml
: Describes the project's build specification, according to its specification;.editorconfig
: Applies formatting to whole repository content for any compatible editors, as depicted in its site;.gitignore
: Usual ignoring file against a python project's build, caching files and its corresponding editors.
There are other files in repository but not essential for a project initialization. such this file, LICENSE, CI/CD configuration and any other ones.
The setup.sh
file is going to run the following:
shellcheck
's check in order to verify its own content's syntax;- For both:
- Downloads each aforementioned project management tools and installs as the way its corresponding procedure recommends;
- Initiates its corresponding program and exports them to
PATH
variable; - Appends to
~/.bashrc
the code snippet once in order to activate them automatically as a new shell is spawned.
- For
pyenv
:- Creates a
virtualenv
activation using the repository's recipient folder name and according to thePROJ_VER
variable:- Skips this step if a environment had already been activated as described above;
- The current activation will be cleaned up if does not correspond to the way this script sets it.
- Creates a
- For
pypoetry
:- Verifies for poetry updates;
- Instructs the program to not creating virtual environments for itself;
- If
pyproject.toml
is present:- Checks if this file is valid;
- Updates the activated virtualenv's dependencies.
- (Creates a new one with its default setting if the file absent).
- Adds some useful development dependencies to the activated virtualenv if
absent.
- (If a
poetry.lock
file does not exist in the repository and a one is generated during the execution, it is going to be removed afterwards).
- (If a
In addition to that, it does:
- Install other complementary development tools such as
docker
,terraform
andAWS client
; - Create
.gitignore
and.editorconfig
files as previously described if the corresponding one is absent.