Skip to content

Commit b0c7a62

Browse files
authored
chore: use $(...) notation instead of legacy backticked ... in Makefile (#344)
1 parent 2e1db07 commit b0c7a62

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ force-upgrade:
103103
rm -f .venv/upgraded-on
104104
$(MAKE) upgrade
105105
upgrade-quiet:
106-
echo "Automatically generated by Python Package Makefile on `date '+%Y-%m-%d %H:%M:%S %z'`." > .venv/upgraded-on
106+
echo "Automatically generated by Python Package Makefile on $$(date '+%Y-%m-%d %H:%M:%S %z')." > .venv/upgraded-on
107107

108108
# Generate a Software Bill of Materials (SBOM).
109109
.PHONY: sbom
@@ -123,18 +123,18 @@ sbom: requirements
123123
requirements: requirements.txt
124124
requirements.txt: pyproject.toml
125125
echo -n "" > requirements.txt
126-
for pkg in `python -m pip freeze --local --disable-pip-version-check --exclude-editable`; do \
126+
for pkg in $$(python -m pip freeze --local --disable-pip-version-check --exclude-editable); do \
127127
pkg=$${pkg//[$$'\r\n']}; \
128128
echo -n $$pkg >> requirements.txt; \
129129
echo "Fetching package metadata for requirement '$$pkg'"; \
130130
[[ $$pkg =~ (.*)==(.*) ]] && curl -s https://pypi.org/pypi/$${BASH_REMATCH[1]}/$${BASH_REMATCH[2]}/json | python -c "import json, sys; print(''.join(f''' \\\\\n --hash=sha256:{pkg['digests']['sha256']}''' for pkg in json.load(sys.stdin)['urls']));" >> requirements.txt; \
131131
done
132132
echo -e -n "$(PACKAGE_NAME)==$(PACKAGE_VERSION)" >> requirements.txt
133133
if [ -f dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz ]; then \
134-
echo -e -n " \\\\\n `python -m pip hash --algorithm sha256 dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz | grep '^\-\-hash'`" >> requirements.txt; \
134+
echo -e -n " \\\\\n $$(python -m pip hash --algorithm sha256 dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz | grep '^\-\-hash')" >> requirements.txt; \
135135
fi
136136
if [ -f dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl ]; then \
137-
echo -e -n " \\\\\n `python -m pip hash --algorithm sha256 dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl | grep '^\-\-hash'`" >> requirements.txt; \
137+
echo -e -n " \\\\\n $$(python -m pip hash --algorithm sha256 dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl | grep '^\-\-hash')" >> requirements.txt; \
138138
fi
139139
echo "" >> requirements.txt
140140
cp requirements.txt dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-requirements.txt
@@ -145,7 +145,7 @@ requirements.txt: pyproject.toml
145145
# found an issue.
146146
.PHONY: audit
147147
audit:
148-
if ! `python -c "import pip_audit" &> /dev/null`; then \
148+
if ! $$(python -c "import pip_audit" &> /dev/null); then \
149149
echo "No package pip_audit installed, upgrade your environment!" && exit 1; \
150150
fi;
151151
python -m pip_audit --skip-editable --desc on --fix --dry-run

0 commit comments

Comments
 (0)