Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions {{ cookiecutter.project_name_dashed }}/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# =================================================================:
# This file specifies the tools and environments required for the project.
# While you may use your own methods to install these dependencies,
# this file also provides automated instructions for installation.
#
# Each dependency entry can include up to three tags, part from normal tags
# namely TODO, FIXME, XXX:
#
# - INSTALL: Specifies the exact commands to automate the installation process.
# (This tag is mandatory to enable automation through the Makefile.)
# - DEBUG(scope): Offers scoped debugging guidance for known issues.
# The scope is specified in parentheses (e.g., "build").
#
# Ensure that the INSTALL commands are up-to-date for automated setups.
# ===================================================================

# INSTALL: asdf plugin add poetry; asdf install poetry 1.8.5
poetry 1.8.5

# INSTALL: asdf plugin add python; asdf install python {{ cookiecutter.python_version }}
# DEBUG(build): Refer to https://github.com/asdf-community/asdf-python/issues/119#issuecomment-1146655005
python {{ cookiecutter.python_version }}

12 changes: 12 additions & 0 deletions {{ cookiecutter.project_name_dashed }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ help:
@echo " \033[1m\033[35mdocs\033[0m \033[37m(d)\033[0m: \033[36mGenerate project documentation.\033[0m\n"

@echo "Environment Management --------------------------------------------------------"
@echo " \033[1m\033[35masdf-install\033[0m \033[37m(asdfi)\033[0m: \033[36mInstall tools mentioned in .tool-versions.\033[0m"
@echo " \033[1m\033[35mclean-venv\033[0m \033[37m(cv)\033[0m: \033[36mRemove virtual environment.\033[0m"
@echo " \033[1m\033[35minstall\033[0m \033[37m(i)\033[0m: \033[36mInstall app and dependencies.\033[0m"
@echo " \033[1m\033[35mvenv\033[0m \033[37m(v)\033[0m: \033[36mCreate virtual environment.\033[0m\n"
Expand All @@ -39,6 +40,17 @@ help:
# NOTE: Do not modify the autogenerated targets, unless necessary, write custom
# targets in the custom section below..

.PHONY: asdf-install
asdf-install:
@echo "\nIntalling environment and tools mentioned in .tool-versions +++++++++++++++++++\n"
@grep "# INSTALL:" .tool-versions | sed 's/# INSTALL: //' | while read -r command; do \
echo "Running: $$command"; \
eval $$command; \
done

.PHONY: asdfi
asdfi: asdf-install

.PHONY: clean-venv
clean-venv:
@echo "\nRemoving the virtual environment ++++++++++++++++++++++++++++++++++++++++++++++\n"
Expand Down
22 changes: 22 additions & 0 deletions {{ cookiecutter.project_name_dashed }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
- [Basic Usage](#basic-usage)
- [Installation](#installation)
- [Development](#development)
- [Makefile](#makefile)
- [Environment](#environment-reproducibility)
- [asdf](#asdf)
- [Contributing](#contributing)
- [Code of Conduct](#code-of-conduct)
- [Versioning](#versioning)
Expand All @@ -29,6 +32,8 @@

## Development

### Makefile

For ease of use, certain scripts have been abbreviated in `Makefile`, make sure
that you have installed the dependencies before running the commands.

Expand Down Expand Up @@ -119,6 +124,22 @@ make u
> **Note**: This is not the complete list of commands, run `make` to find out if
> more have been added.

### Environment reproducibility

Below mentioned are some tools and configuration that you can use to make your
environment development-ready. This is optional and opinionated but can help you
set up your environment quickly.

#### asdf

We recommend using [asdf][asdf] to manage your development environment. Take a look at
the `.tool-versions` file to see the versions of the tools used in this project.
Additionally, you can use the make command to install all the required tools at once.

```sh
make asdfi
```

## Contributing

This project is a community effort and lives off _your_ contributions, be it in
Expand Down Expand Up @@ -162,6 +183,7 @@ To get in touch with us, please use one of the following routes:

[![logo-elixir]][elixir] [![logo-elixir-cloud-aai]][elixir-cloud-aai]

[asdf]: https://asdf-vm.com/
[badge-chat-url]: https://join.slack.com/t/elixir-cloud/shared_invite/enQtNzA3NTQ5Mzg2NjQ3LTZjZGI1OGQ5ZTRiOTRkY2ExMGUxNmQyODAxMDdjM2EyZDQ1YWM0ZGFjOTJhNzg5NjE0YmJiZTZhZDVhOWE4MWM
[badge-license-url]: http://www.apache.org/licenses/LICENSE-2.0
[code-of-conduct]: https://elixir-cloud-aai.github.io/about/code-of-conduct/
Expand Down