Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add .tool-versions #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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